poj 2301 Beat the Spread!

//这一题实在太坑爹了,没有说明分数是多少的! 
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int tc, i, s, d, sum, f1, f2;
    cin >> tc;
    while (tc--){
          cin >> s >> d;
          if (s < d || (s-d)%2 || (s+d)%2)
             cout << "impossible" << endl;
          else{
              sum = s + d;
              f1 = sum / 2;
              f2 = s - f1;
              cout << f1 << " " << f2 << endl;
          }
    }
    system("pause");
}

你可能感兴趣的:(poj 2301 Beat the Spread!)