Start: Jun, 05, 2019 15:00:00
2019春ACM通识课考试(第二场)
End: Jun, 05, 2019 18:00:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 5ms
Memory: 1092kB
Author: 2018212212076
In contest: 1271

#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int flag=0,a,b,x,y;
	scanf("%d %d",&a,&b);
	for(int i=0;i<=a;i++)
		for(int j=0;j<=a-i;j++)
		{
			if((2*i+4*j==b)&&(i+j)==a)
			{
				flag=1;
				x=i;
				y=j;
				break;
			}
		}
	if(flag==1)
	{
		printf("%d %d\n",x,y);
	}
	else
		printf("No answer\n");
	return 0;
}