ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2049C - MEX Cycle
Language: PyPy 3-64


Submission (verdict: Wrong answer on test 1):
Test = int(input())



def Sol():

    n, x, y = list(map(int, input().split()))

    Res = [((x + i) % 2) for i in range(1, n + 1)]

    if n % 2 or ((x - y) % 2):

        Res[0] = 2

    for i in range(-x + 1, 0, 1):

        print(Res[i], end= " ")

    for i in range(n - x + 1):

        print(Res[i], end = " ")

for _ in range(Test):

    Sol()

    print()
Problem: 2049C - MEX Cycle
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
Test = int(input())



def Sol():

    n, x, y = list(map(int, input().split()))

    Res = [((x + i) % 2) for i in range(1, n + 1)]

    if n % 2 or ((x - y) % 2):

        Res[0] = 2

    for i in range(-x + 1, 0, 1):

        print(Res[i], end= " ")

    for i in range(n - x + 1):

        print(Res[i], end = " ")

for _ in range(Test):

    Sol()

    print()

Submission (verdict: Wrong answer on test 1):
Test = int(input())



def Sol():

    n, x, y = list(map(int, input().split()))

    Res = [((x + i) % 2) for i in range(1, n + 1)]

    if n % 2 or ((y - x) % 2):

        Res[0] = 2

    for i in range(-x + 1, 0, 1):

        print(Res[i], end= " ")

    for i in range(n - x + 1):

        print(Res[i], end = " ")

for _ in range(Test):

    Sol()

    print()
Problem: 2049C - MEX Cycle
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
Test = int(input())



def Sol():

    n, x, y = list(map(int, input().split()))

    Res = [((x + i) % 2) for i in range(1, n + 1)]

    if n % 2 or ((y - x) % 2):

        Res[0] = 2

    for i in range(-x + 1, 0, 1):

        print(Res[i], end= " ")

    for i in range(n - x + 1):

        print(Res[i], end = " ")

for _ in range(Test):

    Sol()

    print()

Submission (verdict: Accepted):
Test = int(input())



def Sol():

    n, x, y = list(map(int, input().split()))

    Res = [((x + i) % 2) for i in range(1, n + 1)]

    if n % 2 or not((y - x) % 2):

        Res[0] = 2

    for i in range(-x + 1, 0, 1):

        print(Res[i], end= " ")

    for i in range(n - x + 1):

        print(Res[i], end = " ")

for _ in range(Test):

    Sol()

    print()
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  vector<pair<int,int>> ans;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      if (c[j] < c[i]) {
        ans.emplace_back(c[i], c[j]);
        ans.emplace_back(c[j], c[i]);
      } else {
        ans.emplace_back(c[j], c[i]);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  vector<pair<int,int>> ans;
  for (int i = n; i > 1; --i) {
    for (int j = i-1; j >= 1; --j) {
      ans.emplace_back(c[i], c[j]);
    }
    for (int j = 1; j < i; ++j) {
      if (c[j] < c[i]) {
        ans.emplace_back(c[j], c[i]);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}


Submission (verdict: Wrong answer on test 5):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  set<pair<int,int>> used;
  vector<pair<int,int>> ans;
  for (int i = n; i > 1; --i) {
    for (int j = c[i]-1; j >= 1; --j) {
      pair<int,int> key = {c[i], j};
      if (!used.count(key)) {
        ans.push_back(key);
        used.insert(key);
      }
    }
    for (int j = 1; j < i; ++j) {
      pair<int,int> key = {c[j], c[i]};
      if (!used.count(key)) {
        ans.push_back(key);
        used.insert(key);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 5):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  set<pair<int,int>> used;
  vector<pair<int,int>> ans;
  for (int i = n; i > 1; --i) {
    for (int j = c[i]-1; j >= 1; --j) {
      pair<int,int> key = {c[i], j};
      if (!used.count(key)) {
        ans.push_back(key);
        used.insert(key);
      }
    }
    for (int j = 1; j < i; ++j) {
      pair<int,int> key = {c[j], c[i]};
      if (!used.count(key)) {
        ans.push_back(key);
        used.insert(key);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  set<pair<int,int>> used;
  vector<pair<int,int>> ans;
  for (int i = n; i > 1; --i) {
    for (int j = c[i]-1; j >= 1; --j) {
      pair<int,int> key = {c[i], j};
      if (!used.count(key)) {
        ans.push_back(key);
        used.insert(key);
      }
    }
    vector<int> o;
    for (int j = 1; j < i; ++j) {
      o.push_back(c[j]);
    }
    sort(o.begin(), o.end());
    for (int j : o) {
      pair<int,int> key = {j, c[i]};
      if (!used.count(key)) {
        ans.push_back(key);
        used.insert(key);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  vector<pair<int,int>> ans;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      if (c[j] < c[i]) {
        ans.emplace_back(c[i], c[j]);
        ans.emplace_back(c[j], c[i]);
      } else {
        ans.emplace_back(c[j], c[i]);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve() {
  int n = 0;
  cin >> n;
  vector<int> c(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  vector<pair<int,int>> ans;
  for (int i = n; i > 1; --i) {
    for (int j = i-1; j >= 1; --j) {
      ans.emplace_back(c[i], c[j]);
    }
    for (int j = 1; j < i; ++j) {
      if (c[j] < c[i]) {
        ans.emplace_back(c[j], c[i]);
      }
    }
  }
  cout << ans.size() << endl;
  for (auto [x, y]: ans) {
    cout << x << " " << y << endl;
  }
}

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);

  solve();
  return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
 
#define int long long 

int findMax(vector<int>& deg){
    int ans = 0;
    for (int i = 1; i < deg.size(); i++){
        if (deg[i] > deg[ans]){
            ans = i;
        }
    }
    return ans;
}

void dfs(int cur, vector<vector<int>>& adj, vector<bool>& visited){
    visited[cur] = true;

    for (int next:adj[cur]){
        if (visited[next]) continue;
        dfs(next, adj, visited);
    }
}
 
void solve(){
    int n;
    cin >> n;
    vector<int> deg(n);
    vector<vector<int>> edge;

    for (int i = 0; i < n-1; i++){
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        edge.push_back({u, v});
        deg[u]++;
        deg[v]++;
    }

    int out = findMax(deg);
    deg[out] = 0;
    out = findMax(deg);
    deg[out] = 0;

    vector<vector<int>> adj(n);

    for (int i = 0; i < n-1; i++){
        int u = edge[i][0], v = edge[i][1];

        if (deg[u] == 0 || deg[v] == 0) continue;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    vector<bool> visited(n, false);
    int ans = 0;
    for (int i = 0; i < n; i++){
        if (visited[i]) continue;
        ans++;
        dfs(i, adj, visited);
    }

    cout << ans-2;
}
 
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1; 
    cin >> t; 
    while (t--){ 
        solve();
        cout << '\n';
    } 
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        cout << max(ans, 0LL) << "\n";
            

    }
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        if(t==9413) cout << n << " ";
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        cout << max(ans, 0LL) << "\n";
            

    }
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        //Gotta go watch interstellar
    }
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        //Gotta go watch interstellar
    }
}

Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
                break;
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        cout << max(ans, 0LL) << "\n";
            

    }
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        if(t==9413) cout << n << " ";
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        cout << max(ans, 0LL) << "\n";
            

    }
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        ll mx=0;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        mx = max(ans, mx);
        swap(vp[0], vp[1]);
        ans = vp[0].first;
        idx = vp[0].second;
        to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        mx = max(ans, mx);
        cout << mx << "\n";

            

    }
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
                break;
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        cout << max(ans, 0LL) << "\n";
            

    }
}

Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
#include <string>
using namespace std;

#define ll long long
#define vl vector<ll>
#define pb push_back
#define rep(i, a, b) for (ll i = a; i < b; i++)

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll t; cin >> t;
    while(t--){
        ll n, x, y; cin >> n;
        vector<set<ll>> v(n+1);
        rep(i, 0, n-1){
            cin >> x >> y;
            v[x].insert(y);
            v[y].insert(x);
        }
        map<ll, ll> mp;
        rep(i, 1, n+1){
            mp[i] = v[i].size();
        }
        vector<pair<ll, ll>> vp;
        for(auto i: mp){
            vp.pb({i.second, i.first});
        }
        sort(vp.begin(), vp.end(), greater<pair<ll, ll>>());
        ll ans = vp[0].first;
        ll idx = vp[0].second;
        ll to=-1;
        rep(i, 1, vp.size()){
            if(v[idx].find(vp[i].second)==v[idx].end()){
                to=max(vp[i].first-1, to);
            }
            else{
                to=max(vp[i].first-2, to);
            }
        }
        ans+=to;
        cout << max(ans, 0LL) << "\n";
            

    }
}
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 5):
#include<bits/stdc++.h>
using namespace std;
int main() {
    int t;
    cin >> t;
    while(t--) {
        int n;
        cin >> n;
        set<pair<int, int> > edges;
        map<int, int> degree;
        for(int i=0; i<n-1; i++) {
            int u, v;
            cin >> u >> v;
            edges.insert({u, v});
            edges.insert({v, u});
            degree[u]++;
            degree[v]++;
        }
        int ans = 0;
        
        for(auto it: edges) {
            int deg1 = degree[it.first];
            int deg2 = degree[it.second];
            ans = max(deg1 + deg2 - 2, ans);
        }
        
        vector<pair<int, int>> v;
        for(auto it: degree) {
            v.push_back({it.second, it.first});
        }
        
        sort(v.begin(), v.end(), greater<pair<int, int>>());
        // for(auto it: edges) cout << it.first << " " << it.second << "\n";
        for(int i=0; i<v.size(); i++) {
            for(int j=i+1; j<v.size(); j++) {
                if(edges.find({v[i].second, v[j].second}) == edges.end()) {
                    // cout << "enter ";
                    int deg1 = degree[v[i].second];
                    int deg2 = degree[v[j].second];
                    ans = max(deg1 + deg2 - 1, ans);
                }
            }
        }
        
        cout << ans << "\n";
        
    }
    
    return 0;
}

Submission (verdict: Time limit exceeded on test 5):
#include<bits/stdc++.h>
using namespace std;
int main() {
    int t;
    cin >> t;
    while(t--) {
        int n;
        cin >> n;
        set<pair<int, int> > edges;
        map<int, int> degree;
        for(int i=0; i<n-1; i++) {
            int u, v;
            cin >> u >> v;
            edges.insert({u, v});
            edges.insert({v, u});
            degree[u]++;
            degree[v]++;
        }
        int ans = 0;
        
        for(auto it: edges) {
            int deg1 = degree[it.first];
            int deg2 = degree[it.second];
            ans = max(deg1 + deg2 - 2, ans);
        }
        
        vector<pair<int, int>> v;
        for(auto it: degree) {
            v.push_back({it.second, it.first});
        }
        
        sort(v.begin(), v.end(), greater<pair<int, int>>());
        // for(auto it: edges) cout << it.first << " " << it.second << "\n";
        for(int i=0; i<n; i++) {
            for(int j=i+1; j<n; j++) {
                if(edges.find({v[i].second, v[j].second}) == edges.end()) {
                    // cout << "enter ";
                    int deg1 = v[i].first;
                    int deg2 = v[j].first;
                    ans = max(deg1 + deg2 - 1, ans);
                }
            }
        }
        
        cout << ans << "\n";
        
    }
    
    return 0;
}