#include <iostream>
#include <cmath>
using namespace std;
int years(float x, float y)
{
float r = sqrt(x * x + y * y);
float square = 3.1415926 * r * r / 2;
float currentSquare = 0;
int year = 0;
while(square >= currentSquare)
{
++year;
currentSquare += 50;
}
return year;
}
int main()
{
int times;
int n = 1;
float x, y;
cin >> times;
while(times--)
{
cin >> x >> y;
cout << "Property " << n++ << ":This property will begin eroding in year " << years(x, y) << "."<< endl;
}
cout << "END OF OUTPUT." << endl;
return 0;
}
转载于:https://my.oschina.net/u/196018/blog/383794