Posted:

**Tue Aug 01, 2006 11:59 pm**To nymo: thanks a lot from me.

I started attacking this problem today and

your post was crucial for solving it. After

about 15 submissions I got ACC.

Here is some more input from me for anyone who

might still be trying to solve it.

Note: 1048575 = 2^20 - 1, this according to the

problem statement is the largest number allowed

in the input as a value for N.

INPUT

OUTPUT
Good luck to everyone!

I started attacking this problem today and

your post was crucial for solving it. After

about 15 submissions I got ACC.

Here is some more input from me for anyone who

might still be trying to solve it.

Note: 1048575 = 2^20 - 1, this according to the

problem statement is the largest number allowed

in the input as a value for N.

INPUT

Code: Select all

```
0 2
1 2
2 9
100 23
23 101
23233 344
34 799
1000000 799
1000010 800
1048575 2
1048575 3
1048575 17
1048575 101
1048575 799
1048575 800
```

OUTPUT

Code: Select all

```
0 1
0 1
0 1
4 117
0 12
552 36014
0 14
21737 1917527
125000 1917188
1048555 19458736
524281 12277096
65533 4760591
10484 2922517
22794 2018112
131070 2017734
```