I don't know why my solution is wrong for a SPOJ problem the problem name is JULKA.
Problem link is this. link text
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
int main()
{
int t=10,a,b;
while(t--) {
cin>>a>>b;
int x,y;
//x+y = a;
//x-y = b;
cout<<(a+b)/2<<"\n"<<(a-b)/2<<endl;
}
return 0;
}
Please help me to find the exact solution of this problem.