http://acm.hdu.edu.cn/showproblem.php?pid=1194
跟着狗畅找了道水题做,他真无聊啊。。。
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <iostream> using namespace std ; int main() { int n,i; int s,d; scanf("%d",&n); while(n--) { scanf("%d%d",&s,&d); for(i=s;i>0;i--) if(abs(i*2-s)==d) { printf("%d %d\n",i,s-i); break; } if(i==0) puts("impossible"); } return 0; }