fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long a;
  6. long long b;
  7. cin>>a>>b;
  8. if(a>=b*3 && a!=b && a!=0)
  9. cout<<(a-b)/2-b;
  10. else
  11. cout<<"NO";
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5316KB
stdin
0
0
stdout
NO