<PREV Problem:
NEXT>
Solved by 92 users: ...
UserDateAttemptTimeCMSC
ripatti03 jun 2010C++2700.02271 
Mishunin_Alexander23 oct 2007C++1700.37274 
ripatti03 jun 2010C++2600.02277 
Mishunin_Alexander23 oct 2007C++1600.36311 
Pset16 may 2005FPC17100.01331 
Dima16 may 2005FPC1?.??331 
Mishunin_Alexander23 oct 2007C++1500.36341 
DAV12 mar 2010C++900.14344 
N1k1tung02 dec 2006Kylix300.70355 
DAV12 mar 2010C++800.14359 
WsemirZ19 jul 2008C++300.39380 
Jacob05 may 2008C++300.36398 
Ravent01 sep 2006Kylix304.45403 
tourist14 feb 2008Kylix1701.80408 
Languages
C++
52
FPC
27
Kylix
11
Java
2
C
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Star War (epizode V)

Time limit = 5 seconds

A long time ago in the galaxy far, far away.

After the Death Star had been destroyed by rebels, a group of imperial scientists started the development of new project "Death Star 2". New Star was provided by Death Ray, which destroys any object on its way and continue its passage in the original direction. For this time the resistance movement was expanded on many planets. The Emperor naturally disliked it. He gave the order to Dark Lord and Greatest Jedi Dart Vader to destroy the maximum number of planets with rebellious bases. Unfortunately, a very much time is required for recharging Death Ray, therefore Empire has one attempt only.

Help Lord Vader to choose position of new Death Star and the launch direction of the Death Ray such that the maximum number of planets is destroyed by one strike. And let the Evil Side of the Power will be with you!

Input The first line contains the number of rebellious planets N (2 ≤ N ≤ 200). Then N lines follow. Each line contains coordinates of planet x, y (integers in the range -32768 .. 32767) and its radius R (integer in the range 1..32767). The numbers is separated by one space.

Output Write in the output file the maximum number of planets, which can be destroyed by one strike of new Death Star.

Input#1
3
0 0 1
6 -1 1
3 1 2
Output#1
3
Input#2
4
5 0 1
0 5 1
-5 0 1
0 -5 1
Output#2
2

Author:
Semi-final of Ukraine student programming contest, March 2003, Khmelnitski.

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


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

SW soft NIX
ID = 52.3.228.47