daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     freopen("dragon.in", "r", stdin);
  7.     freopen("dragon.out", "w", stdout);
  8.     int s, k, a, b, legs;
  9.     cin>>s>>k>>a>>b;
  10.     legs=b-(a-k)*s;
  11.     if(legs<0 || a-k<0)
  12.     {
  13.         cout<<-1;
  14.         return 0;
  15.     }
  16.     cout<<legs;
  17.     return 0;
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top