<PREV Problem:
NEXT>
Solved by 44 users: Artur, robotact, DD, NSI, Dmitry_Gozman, dan, noir_soleil, Awk, MasterZerg, mikleb, dragonghy, Ilya, ich, mishik, andyzh1314, Rizvanov, shangjingbo, Wind_Love, tourist, pmnox, zloy_mipt, mazahaka, RAVEman, MaxBuzz, UdH-WiNGeR, ilyakor, defrager, Ravent, topspin, superzz, Dest, EAA2008, ripatti, s01A15, Jacob, vi002, CoJIMuP, checkil, oleg.dudrov, Robert_Gerbicz, regmar, max-spilet, murphy, avg79.
UserDateAttemptTimeCMSC
ilyakor07 mar 2009C++600.01830 
RAVEman10 jan 2009C++1400.01956 
regmar09 oct 2013C++800.01962 
mikleb19 nov 2006C++2800.011433 
Ravent10 apr 2009C++2500.011567 
Dest17 dec 2009C++1600.02673 
Rizvanov24 jan 2008C++500.02789 
superzz29 oct 2009C++100.021034 
Wind_Love18 mar 2008FPC700.021091 
shangjingbo17 mar 2008FPC100.021108 
Languages
C++
31
FPC
6
Kylix
5
Java
3
C
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Spheres intersection

Time limit = 2 second(s)

You are give set of closed (closed = contain boundary) spheres in 3-dimentional euclidian space. You should check if they have common point.

Input. The fist line contains number of spheres N, 1 < N ≤ 20, and then N lines go, each with four integer numbers Xi Yi Zi and Ri. All numbers less than 10000 in their absolute value.

Output. YES or NO.

Input#1
2
0 0 0 1
0 0 2 1

Output#1
YES

Input#2
2
0 0 0 1
2 2 2 2

Output#2
NO

Input#3
4
0 0 0 3
0 0 4 3
0 5 0 4
0 6 0 5

Output#3
YES

Input#4
4
0 0 0 3
0 0 4 3
0 5 0 4
0 6 0 4
Output#4
NO

Author:
Artem Voroztsov, played at regional student personal contest in Moscow, 29 April 2005.
1 May 2005

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 190ms

SW soft NIX
ID = 107.23.129.77