Draw a circle game~2021.1.13

Title description

Jia Jia is the vice president of our ACM club. She feels like she doesn't exist, so... One day Jia Jia and Chen Chen were playing together. Chen Chen had a very high IQ and was also a game master. TAs began to play games. The rules of the game are as follows. There is a rectangular drawing board with length x and width y. Two players want to play circles on this drawing board. The center of the circle can be determined by themselves. Each circle is a standard circle with a radius of r (you guessed it) Is it freehand?) After the circle is drawn, you should paint your favorite color inside the circle. Everyone takes turns to draw a circle, and each circle on the drawing board cannot overlap (can be tangent). If one party cannot continue to draw, the other party wins. Modesty has always been the traditional virtue of our ACM laboratory, so Chenchen let Jiajia paint first. The stupid Jiajia panicked. She didn't know if she could win or how to draw. Then please tell this Jiajia who is about to be abused.

Input format

Multiple sets of data, each set of data contains 3 integers, x, y, r (1<=x,y,r<=1000). x, y represent the length and width of the rectangular drawing board, and r represents that TAs can only draw a circle with a radius of r.

Output format

For each set of data, if Canon wins the game, output "It is so easy!", if Jiajia loses, output "It is boring!", and each output occupies one line.

Input sample

5 5 2
6 7 4

Sample output

It is so easy!
It is boring!

AC code

#include <iostream>
using namespace std;
int main()
{
    
    
	int x,y,r;
	while(cin>>x>>y>>r){
    
    
		if( x < 2*r || y < 2*r ){
    
    
			cout<<"It is boring!";
		}
		else{
    
    
			cout<<"It is so easy!";
		}
		cout<<endl;
	}
	return 0;
}

Explanation

①How to win: Obviously, if you can take the lead in occupying the center of the rectangular drawing board, you will definitely win. Because after occupying the center position, if the opponent can still draw, then you can draw a circle on the symmetrical position of the center position, and eventually there will be one more circle than your opponent.
case of failure : ① as the known, only one fails, it is no way to make a start on a rectangular artboard circle , i.e., greater than the diameter of the circle to any one side of the rectangle.

Guess you like

Origin blog.csdn.net/fatfairyyy/article/details/112553419