https://www.acmicpc.net/problem/4299
#include <iostream> using namespace std; int main() { int a,b; cin>>a>>b; if((a+b)%2==1||a<b) cout<<-1; else{ int n=(a+b)/2; int m=a-n; cout<<n<<" "<<m; } }