fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int n,m;
  6.  
  7. void init(){
  8. cin>>n>>m;
  9.  
  10. }
  11. void solve(){
  12. int y= (m-2*n)/2;
  13. int x=n-y;
  14. cout<<x<<" "<<y;
  15.  
  16. }
  17.  
  18. int main(){
  19. init();
  20. solve();
  21. return 0;
  22.  
  23. }
  24.  
Success #stdin #stdout 0.01s 5308KB
stdin
36 100
stdout
22 14