C语言新人求助两道题。。没什么思路
2441: Time StopTime Limit: 1 Sec Memory Limit: 64 MB
Submit: 3511 Solved: 1075
Description
Faceless Void(JBL) is a hero in dota game. His ult is Time Stop. It makes a space(a circle of radius R) that all units in it will stop. The question is wether can JBL choose a position to release Time Stop cause all enemy units stop.
Input
The first line is integer T(T <= 50), the number of test cases.The first line fo each test case is two integers n(0 < n <= 100), R(0 <= R <= 10000), the number enemy units and the Radius of Time Stop.Then n lines, each line contains two integer x and y (-1000 <= x,y <= 1000), means the position of a enemy unit.
Output
For each case output Yes if JBL can stop all enemy units, otherwise print No.Pay attention to the output format.
Sample Input
2
5 1
0 0
0 1
1 0
1 1
2 2
5 2
0 0
0 1
1 0
1 1
2 2
Sample Output
Case #1: No
Case #2: Yes
HINT
2442: Requiem of Souls
Time Limit: 1 Sec Memory Limit: 64 MB
Submit: 2478 Solved: 1018
Description
Nevermore is a terrible monster. When he kill a life, he will absorb its soul to improve his strength.And his ult called Requiem of Souls, is very fierce and cruel. Evil spirit will be summoned to attack nearby enemy units.The damage is related to the distance to nevermore.
To simplify the problem we assume that all enemy unit are on the x-axis. The damage is A - D, A is the initial damage, D is the distance to nevermore.Nevermore can choose anywhere to release his ult as he has a blink dagger. Your task is to call the minimum initial damage A Nevermore need to kill all enemy units by release Requiem of Souls once.(If a unit's HP less than or equal to zero, it will die.)
Input
The first line is integer T(T <= 20), the number of test cases.The first line of each case contains a integer n (0 < n <= 10^5), the number of enemy units.Then n lines, each line contains two integer a, b(0 < a, b < 10^8), a is the enemy unit's location, b is the enemy unit's HP.
Output
For each case, output the minimum initial damage in the sample output format.
Sample Input
3
1
1 1
2
1 1
2 1
2
1 1
2 2
Sample Output
Case #1: 1.00
Case #2: 1.50
Case #3: 2.00
HINT
这两题要怎么做。。?求教