# UVa10812 - Beat the Spread! [Prblem link](https://onlinejudge.org/external/108/10813.pdf) ## Review ### 題目敘述理解 要把結果不是整數或小於0的排除 ## Ans ```cpp= #include <iostream> using namespace std; int main(){ int Case; cin>>Case; for(int C=0;C<Case;C++){ int a,b; cin>>a>>b; if(a-b>=0&&(a+b)%2==0) cout<<(a+b)/2<<" "<<(a-b)/2<<"\n"; else cout<<"impossible\n"; } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up