it is couple of hundreds and, as i said, this does not causes overflow problems with this algorithm. check this: no incorrect rounding in second loop and 1 output number computation - can be done with integer division m must be >= 2 after you check b != 1 check both input numbers are satisfied dont ...
in my solution i also had to change int to unsigned because of overflows,
then got accepted.
check boundary conditions, don't count to much in first loop,
you probably need 2 x if( ... ) break;
haven't noticed any other problems or tricks
do you really need this angle ?
i did quite a lot of geometry and inconsistency was never a problem.
Check a hint for problem 109, bottom of problem description,
- detection of orientation.
Your solution is really good. Myself, i learned from this problem that judge accepts inline asm in c++. I just used three loops for logarithms and "jo" instruction to detect overflows. I think under-linear complexity algorithm is possible if "easy & dense" subset of ugly numb...