Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb push_back
- #define mp make_pair
- #define sz size
- #define ll long long
- #define ld long double
- #define fs first
- #define sc second
- #define forn(i, f, t) for(int i = f; i < t; i++)
- #define all(x) (x).begin(), (x).end()
- #define ins insert
- const int INF = 2147483647;
- const int MOD = 1000000007;
- const ll INF64 = 9223372036854775807;
- const ld EPS = 1e-7;
- using namespace std;
- int main(){
- int a[2], b[2], c[2], d[2], e[2], f[2], ans = INF;
- scanf("%d%d", a, a + 1);
- scanf("%d%d", b, b + 1);
- scanf("%d%d", c, c + 1);
- scanf("%d%d", d, d + 1);
- scanf("%d%d", e, e + 1);
- scanf("%d%d", f, f + 1);
- forn(i, 0, 2)
- forn(j, 0, 2)
- forn(k, 0, 2)
- forn(l, 0, 2)
- forn(m, 0, 2)
- forn(n, 0, 2)
- if ((a[i] + b[j] + c[k] + d[l] + e[m] + f[n]) % 3 != 0)
- ans = min(ans, a[i] + b[j] + c[k] + d[l] + e[m] + f[n]);
- printf("%d\n", (ans == INF ? 0 : ans));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement