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: 8ms
Memory: 1092kB
Author: 2017210904042
In contest: 1271

#include <stdio.h>
 int main()
 {
	 int a,b;
	 int i=0,j=0;
	 int flag = 0;
	 scanf("%d %d",&a,&b);
	 for(i=0;i<=100;i++)
	 {
		 for(j=0;j<=100;j++)
		 {
			 if(i+j==a&&2*i+4*j==b)
			 {
				 printf("%d %d\n",i,j);
				 flag = 1;
				 break;
			 }
			 else if(i==100&&j==100&&a!=200)
			 {
				 printf("No answer\n");
				 break;
			 }
		 }
		 if(flag==1)
		 {
			 break;
		 }
	 }
	return 0;
 }