Home > Back-end >  Help: 1580 - pears big adventure -- don't know where is wrong, ask bosses give directions
Help: 1580 - pears big adventure -- don't know where is wrong, ask bosses give directions

Time:11-25

Description

Known evil BOSS in A copy of the game map coordinates (X, Y), the protagonist pears use vehicles emit N shells, fell on the N coordinates respectively, each shell to attack the regional circular area within the scope of R (R) including boundary, the damage is A (and therefore is to attack the enemy blood values less A), known BOSS initial blood value is 100, after this wave of artillery attacks, how much is left BOSS blood (when the enemy killed, blood values into 0)?

The input values

The first line of input two real Numbers (X, Y), space interval, said BOSS map coordinates,
The second line of the input two integers R and A, respectively of artillery attacks and damage
The third line, enter an integer N, said shells number
The next English? Rows, each row two real Numbers (X, Y), space interval, said the coordinates of the artillery strikes

Output

Output as an integer, BOSS said the remaining blood values

Sample input


0 2
2 5
2
0 3
0-1
Sample output


95

Below is the code:
#include
#include
Int main ()
{
Double x, y, x0, y0, j;
Int r, a, n, mp=0;
Lf lf scanf_s (" % % ", & amp; X, & amp; Y);
Scanf_s (" % d % d ", & amp; R, & amp; A);
Scanf_s (" % d ", & amp; N);
While (n -)
{
Lf lf scanf_s (" % % ", & amp; X0, & amp; Y0);
J=SQRT ((x - x0) * (x - x0, 2) + (y - y0) * (y - y0));
If (j & lt;=r)
Mp=mp - a;
If (mp & lt; 0)
Mp=0;
}
Printf (" % d ", mp);
return 0;
}

CodePudding user response:

Problem has been solved, reason: platform, correction method: all the data are defined as double
The final output % 0 f
  • Related