fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6. long long k,a,b,x,y,c,d;
  7. cin>>k>>a>>x>>b>>y;
  8. if(k==0){cout<<0; return 0;}
  9. if(a>=k){a=0;x=0;}
  10. if(b>=k){b=0;y=0;}
  11. if(k!=0){
  12. c=x*(k-a)+y*(k-a-b);
  13. d=y*(k-a)+x*(k-a-b);
  14. }
  15. if(d>=c){cout<<abs(d);}
  16. if(c>d){cout<<abs(c);}
  17. return 0;
  18. }
Compilation error #stdin compilation error #stdout 0s 4956KB
stdin
4
1 1000000000
1 1000000000
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8:28: error: expected ‘;’ before ‘}’ token
  if(k==0){cout<<0; return 0}
                            ^
                            ;
prog.cpp:11:31: error: expected ‘;’ before ‘}’ token
  if((a+b)>k){cout<<0; return 0}
                               ^
                               ;
stdout
Standard output is empty