i know that is not programming task at all but if you help me i will happy.
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
i know that is not programming task at all but if you help me i will happy.
Name |
---|
Actually, it can be solved as programming task.
Notice, that if both x, y > 2 * 2013, then 1/x + 1/y < 1/2013.
Say y<=2013, iterate now x = 1 / (1/2013 — 1/y). Check if it's natural.
f(n) — number of solutions of 1/n = 1/x + 1/y
f(n * m) = f(n) * f(m); n, m — coprime
f(p^k) = 2*k + 1; p — prime
Not full solution.
Let's see this equation: (x+y)/(xy)=1/2013. If x+y=k & xy=2013*k it will be OK. Let's solve this system of equations.
x = k — y => (k-y)y=2013k <=> -1/k * y^2 + y — 2013 = 0, there's D = 1 — 4*2013/k.
y = ( 1+sqrt(D) ) * k / 2.
D>=0 <=> k>=4*2013. Let k = 4*2013*L, there's L>=1 — natural number.
From here we got D=1-1/L and y=k/2 + k*sqrt(D)/2 = 2*2013*L + 2*2013*sqrt(L^2-L).
L^2-L is natural => L*(L-1) = q^2 for natural q. For L=1 it's OK. If L>=2 then L and L-1 are co-prime and L(L-1)=k^2 <=> L=q^2 & L-1=t^2 for natural q and t. But such numbers doesn't exist.
If L=1 then y=2*2013 and x=2*2013.
1/x+1/y=1/2013 => 2013(x+y)=xy => (x-2013)*(y-2013)=2013*2013.
and then . That's mean x, y > 2013. Lets x = 2013 + a, y = 2013 + b.
2013(2013 + a + 2013 + b) = (2013 + a)(2013 + b)
20132 = ab
And now you must only calculate amount of ways to factorize 20132 — can you solve this problem?
Well, let we want to factorize some number n. First we factorize it to prime numbers: assume that n = p1a1 × p2a2 × ... × pkak.
Lets x in divisor of n. Since x — divisor of n, if x divides to some prime q, then n must divides to q. Therefore x can divides only to primes p1, p2, ..., pk. And, if x = p1b1 × p2b2 × ... × pkbk, we now that b1 ≤ a1, b2 ≤ a2, and so on.
Then b1 = 0..a1 — it's (a1 + 1) variants. b2 = 0..a2 — it's (a2 + 1) variants, and so on. Finally we can calculate amount of different x, it is the same as that amount of sets of bi and it is equals to (a1 + 1) × (a2 + 1) × ... × (ak + 1).
This problem is present in e-olimp.com link