ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1754. Explosion in a Pyramid

hint
Posted by ASK 14 Nov 2010 18:19
It can be solved with integer-only arithmetic without divisions: sphere of radius r from D in tetrahedron ABCD touches ABC if sqr(v6(a,b,c,d)) <= sqr(r) * s4(a,b,c), where v6 is 6 times volume of the tetrahedron and s4 is 4 times area squared (all easily calculated with vector arithmetic), but you will get out of long long by this, so use v6(a,b,c,d) <= r * sqrt((double)s4(a,b,c)) instead.

Edited by author 14.11.2010 19:21

Edited by author 14.11.2010 19:22