Microsoft logoMicrosoft
Coding·45 minMembers

Count Positive Pairs Satisfying 1/x + 1/y = 1/N

Members only

HackerRank OA staple branded "Equations". Given N ≤ 10⁶, count ordered positive-integer pairs (x, y) with 1/x + 1/y = 1/N. The naive scan TLEs; the right answer reduces to a divisor count.

SWE
math
medium
oa
Frequency
Low
Last asked
2026-03-26
Stage
oa

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...