标签:des style class blog code http
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 17794 | Accepted: 8484 |
Description
Input
Output
Sample Input
2 40 20 20 40
Sample Output
30 10 impossible
Source
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 5 int main() 6 { 7 int n; 8 while(scanf("%d",&n)!=EOF) 9 { 10 int x,y; 11 for(int i=0 ;i<n;i++) 12 { 13 scanf("%d%d",&x,&y); 14 if(x<y||x%2==0&&y%2!=0||x%2!=0&&y%2==0) 15 printf("impossible\n"); 16 else 17 { 18 int larger = (x+y)/2; 19 int litter = x-larger; 20 printf("%d %d\n",larger,litter); 21 } 22 } 23 } 24 return 0; 25 }
标签:des style class blog code http
原文地址:http://www.cnblogs.com/jhldreams/p/3798916.html