|
|
back to boardShow all messages Hide all messagesi divide n numbers into ceil[n/a] segments for each segment, increasing B's ties by add b until it reach a, and count the pairs. such like this: while(j + b <= a) { ans += j * b; j += b; } it use %I64d but not %lld |
|
|