Advertisement
Graf_Rav

Untitled

Jan 5th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.     long long blue, yel;
  8.     cin>>yel>>blue;
  9.     long long x,y,z;
  10.     cin>>x>>y>>z;
  11.  
  12.     yel-=x*2;
  13.     yel-=y;
  14.     blue-=y;
  15.  
  16.     blue-=z*3;
  17.  
  18.     unsigned long long ans=0;
  19.  
  20.     if(blue<0){
  21.         ans+=abs(blue);
  22.     }
  23.  
  24.     if(yel<0){
  25.         ans+=abs(yel);
  26.     }
  27.  
  28.     cout<<ans;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement