Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- unsigned short int T,d[10]={0},x[10]={0},y[10]={0},z[10]={0};
- cin>>T;
- for (int i = 0; i < T; i++)
- {
- cin>>d[i] >>x[i] >>y[i] >>z[i];
- }
- for (int i = 0; i < T; i++)
- {
- if(x[i]*7 > (y[i]*d[i] + z[i]*(7-d[i])))
- cout<<x[i]*7<<endl;
- else
- cout<<(y[i]*d[i] + z[i]*(7-d[i]))<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment