j33vansh

sample

Jul 3rd, 2021
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     ios_base::sync_with_stdio(false);
  6.     cin.tie(NULL);
  7.     unsigned short int T,d[10]={0},x[10]={0},y[10]={0},z[10]={0};
  8.     cin>>T;
  9.     for (int i = 0; i < T; i++)
  10.     {
  11.        cin>>d[i] >>x[i] >>y[i] >>z[i];
  12.     }
  13.  
  14.      for (int i = 0; i < T; i++)
  15.     {
  16.       if(x[i]*7 > (y[i]*d[i] + z[i]*(7-d[i])))
  17.        cout<<x[i]*7<<endl;
  18.       else
  19.        cout<<(y[i]*d[i] + z[i]*(7-d[i]))<<endl;
  20.     }
  21.    
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment