Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- typedef long long ll;
- #define int ll
- typedef unsigned long long ull;
- typedef long double lld;
- #define all(x) (x).begin(), (x).end()
- #define MOD 1000000007
- #define endl '\n'
- void fast_io()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- }
- void solve()
- {
- int a,b,c,d;
- cin>>a>>b>>c>>d;
- int mini = min(a,b);
- mini = min(mini,c);
- mini = min(mini,d);
- cout<<(a+b+c+d - (4*mini))<<endl;
- return;
- }
- int32_t main()
- {
- fast_io();
- ll testcases=1;ll cse = 0;
- cin >> testcases;
- while (testcases--)
- {
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement