Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

...

Posted by 304988557 at 2006-10-26 21:31:26 on Problem 2301
In Reply To:纪念我的第100题,HOHO Posted by:304988557 at 2006-09-14 20:52:49
#include<iostream>
using namespace std;

int main()
{
    int n;
    int sum;
    int mul;
    cin>>n;
    for(int i =0; i<n; i++)
    {
            cin>>sum>>mul;
            if(sum<mul)
            cout<<"impossible"<<endl;
            else if((sum-mul)%2==0)
            cout<<(sum+mul)/2<<" "<<(sum-mul)/2<<endl;
            else cout<<"impossible"<<endl;//如果s-d是奇数也是impossible……
    }
     return 0;
}


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator