#include #include #include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); long long int n, a, b, max, total=0, parity; vector w; cin >> n; for(int i=0; i> a >> b; w.push_back(a+b*4); } sort(w.begin(), w.end()); max = w.back(); parity = max%2; for(int i=0; i