malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   struct par {     ll l;     ll r;   };   int n;   ll s;   par mas[200100];   bool cmp(par a, par b) { return (a.l < b.l); }   bool good(ll m) {     vector<par> grp1;     vector<par> grp2;     vector<par> grp3;     for (int i = 0; i < n; i++) {       if (mas[i].r < m)         grp1.push_back(mas[i]);       else if (m <= mas[i].l)         grp2.push_back(mas[i]);       else         grp3.push_back(mas[i]);     }     int rem = max(0, (n + 1) / 2 - (int)grp2.size());     if (rem > grp3.size()) return false;     ll sum = 0;     for (auto el : grp1) sum += el.l;     for (auto el : grp2) sum += el.l;     if (grp3.size() > 0) sort(grp3.begin(), grp3.end(), cmp);     for (int i = 1; i <= rem; i++) sum += m;     for (int i = 0; i < grp3.size() - rem; i++) sum += grp3[i].l;     return (sum <= s);   }   ll bin_s() {     ll l = 1, r = 1e9;     ll m;     while (l < r) {       m = (l + r + 1) / 2;       if (good(m))         l = m;       else         r = m - 1;     }     return l;   }   void solve() {     cin >> n >> s;     for (int i = 0; i < n; i++) {       cin >> mas[i].l >> mas[i].r;     }     ll med = bin_s();     cout << med <<   n ;     return;   }   int main() {     ios_base::sync_with_stdio(0);     cout.tie(0);     cin.tie(0);     int t;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7, siz = 1e6 + 5;   long long t, n, m, k, a[siz], dp[5002][5002], dp2[5002];   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> t;     while (t--) {       cin >> n;       string s;       cin >> s;       s =  0  + s;       for (long long i = 1; i <= n + 1; i++)         for (long long j = i + 1; j <= n + 1; j++) dp[i][j] = 0;       for (long long i = n; i >= 1; i--) {         for (long long j = i - 1; j >= 1; j--) {           if (s[i] == s[j]) {             dp[j][i] = 1 + dp[j + 1][i + 1];           }         }       }       long long ans = 0;       for (long long i = 1; i <= n; i++) {         dp2[i] = n - i + 1;         for (long long j = 1; j < i; j++) {           if (s[i] > s[j])             dp2[i] = max(dp2[j] + n - i + 1, dp2[i]);           else if (s[i] == s[j]) {             if (s[i + dp[j][i]] > s[j + dp[j][i]]) {               dp2[i] = max(dp2[i], dp2[j] + n - (i + dp[j][i]) + 1);             }           }         }         ans = max(ans, dp2[i]);       }       cout << ans << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   double mod(double a, double b) {     long long int val = a / b;     return a - val * b;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     double a, b, m, vx, vy, vz;     cin >> a >> b >> m >> vx >> vy >> vz;     double sx, sy, sz, t, x0, y0;     t = -m / vy;     sx = abs(vx * t);     sz = vz * t;     long long int val;     if (sx > (3 * a) / 2) {       sx -= (3 * a) / 2;       val = sx / (a);       if (val % 2 == 0)         x0 = mod(sx, a);       else         x0 = a - mod(sx, a);     } else if (sx <= a / 2)       x0 = a / 2 + sx;     else       x0 = a - (sx - a / 2);     if (vx < 0) x0 = a - x0;     val = sz / (b);     if (val % 2 == 0)       y0 = mod(sz, b);     else       y0 = b - mod(sz, b);     cout << fixed << setprecision(10) << x0 <<     << y0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     char a[9][9], c;     int i, j, x, y;     string s;     for (i = 0; i < 9; i++) {       for (j = 0; j < 3; j++) {         cin >> s;         a[i][3 * j] = s[0];         a[i][3 * j + 1] = s[1];         a[i][3 * j + 2] = s[2];       }     }     cin >> x >> y;     x--;     y--;     x %= 3;     y %= 3;     bool b = 0;     for (i = 0; i < 3; i++) {       for (j = 0; j < 3; j++) {         if (a[3 * x + i][3 * y + j] ==  . ) b = 1;       }     }     if (b) {       for (i = 0; i < 9; i++) {         if (i % 3 == 0 && i != 0) cout <<   n ;         for (j = 0; j < 9; j++) {           if (j % 3 == 0 && j != 0) cout <<    ;           if (x != i / 3 || y != j / 3)             cout << a[i][j];           else {             if (a[i][j] ==  . )               cout <<  ! ;             else               cout << a[i][j];           }         }         cout <<   n ;       }     } else {       for (i = 0; i < 9; i++) {         if (i % 3 == 0 && i != 0) cout <<   n ;         for (j = 0; j < 9; j++) {           if (j % 3 == 0 && j != 0) cout <<    ;           if (a[i][j] ==  . )             cout <<  ! ;           else             cout << a[i][j];         }         cout <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   void Fast() {     ios_base ::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);   }   inline int RD() {     int i;     cin >> i;     return i;   }   inline float RF() {     float i;     cin >> i;     return i;   }   inline double RDO() {     double i;     cin >> i;     return i;   }   inline string RS() {     string i;     cin >> i;     return i;   }   inline long long Rll() {     long long i;     cin >> i;     return i;   }   inline bool super(long long n) {     int x4 = 0, x7 = 0;     while (n != 0) {       int x = n % 10;       if (x == 7)         x7++;       else         x4++;       n /= 10;     }     return (x4 == x7) ? true : false;   }   int A1[1000];   int arr[200004];   int main() {     Fast();     int n = RD(), k = RD();     string t = RS();     int x = 0;     for (int i = 1; i < t.size(); i++) {       if (t.substr(i) == t.substr(0, t.size() - i)) {         x = n - i;         break;       }     }     cout << t;     for (int i = 0; i < k - 1; i++) cout << t.substr(x);   }
#include <bits/stdc++.h>   using namespace std;   double t, k, d, start = 0, sum = 0;   int main() {     scanf( %lf%lf%lf , &k, &d, &t);     if ((long long)k % (long long)d == 0)       printf( %.1f n , t);     else if (k >= t)       printf( %.1f n , t);     else {       if (k > d) {         long long a = k / d;         d *= a + 1;       }       long long x = (long long)t / (k + (d - k) / 2);       start = (double)x * d;       sum = (double)x * (k + (d - k) / 2);       sum = t - sum;       if (sum > k)         start += k + (sum - k) * 2;       else         start += sum;       printf( %.9f n , start);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int N, M, i, dx, dy, y;   int main() {     scanf( %d %d , &N, &M);     if ((N == 5 || N == 6) && M == 3) {       printf( -1 n );       return 0;     }     dx = 9;     dy = 5;     y = 0;     for (i = 0; i < M; i++) {       printf( %d %d n , dx * i, y);       y += dy * (i + 1);     }     y = 0;     for (i = 0; i < N - M; i++) {       printf( %d %d n , 10000000 - dx * i, y);       y += dy * (i + 1);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long pos[11], neg[11], n, x, zero;   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       cin >> x;       if (x == 0) zero++;       if (x > 0) pos[x]++;       if (x < 0) neg[abs(x)]++;     }     long long cnt = 0;     cnt += zero * (zero - 1) / 2;     for (int i = 1; i <= 10; i++) cnt += (pos[i] * neg[i]);     cout << cnt;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool cmp(const pair<int, pair<int, int>> a, const pair<int, pair<int, int>> b) {     if (a.first == b.first) {       return a.second.first > b.second.first;     } else {       return a.first < b.first;     }   }   int main() {     ios_base::sync_with_stdio(false);     int n, k;     cin >> n >> k;     vector<int> be(n);     vector<int> en(n);     for (int i = 0; i < n; i++) {       cin >> be[i] >> en[i];     }     int L = 0;     int R = 1e9 + 1e9 + 5;     while (R - L > 1) {       int mid = L + (R - L) / 2;       vector<pair<int, pair<int, int>>> even;       for (int i = 0; i < n; i++) {         long long nooow = (long long)en[i] - mid + 1;         if (be[i] <= nooow) {           even.push_back({be[i], {1, 0}});           even.push_back({nooow, {-1, 0}});         }       }       sort(even.begin(), even.end(), cmp);       int bal = 0;       bool good = false;       for (int i = 0; i < even.size(); i++) {         bal += even[i].second.first;         if (bal >= k) {           good = true;         }       }       if (good) {         L = mid;       } else {         R = mid;       }     }     vector<pair<int, pair<int, int>>> even;     for (int i = 0; i < n; i++) {       long long nooow = (long long)en[i] - L + 1;       if (be[i] <= nooow) {         even.push_back({be[i], {1, i}});         even.push_back({nooow, {-1, i}});       }     }     sort(even.begin(), even.end(), cmp);     vector<int> ans;     ans.push_back(1);     int ind = 0;     for (int i = 1; i < even.size(); i++) {       if (even[i].second.first == 1) {         ans.push_back(ans[i - 1] + 1);       } else {         ans.push_back(ans[i - 1] - 1);       }       if (ans[i] == k) {         ind = i;         break;       }     }     if (L == 0) {       cout << 0 << endl;       for (int i = 0; i < k; i++) {         cout << i + 1 <<    ;       }     } else {       cout << L << endl;       set<int> answer;       for (int i = 0; i <= ind; i++) {         if (even[i].second.first == 1) {           answer.insert(even[i].second.second);         } else {           answer.erase(even[i].second.second);         }       }       for (set<int>::iterator it = answer.begin(); it != answer.end(); it++) {         cout << *it + 1 <<    ;       }     }     return 0;   }
#include <bits/stdc++.h>   int main() {     int n, k, i, st = 0, cnt = 0;     scanf( %d %d , &n, &k);     int a[n];     for (i = 0; i < n; i++) {       scanf( %d , &a[i]);     }     for (i = 0; i < n && k > 0; i++) {       if (a[i] <= 8) {         k -= a[i], cnt++;         if (st > 0 && st <= (8 - a[i]))           k -= st, st = 0;         else if (st > 0 && st > (8 - a[i]))           k -= (8 - a[i]), st -= (8 - a[i]);       } else {         k -= 8;         st += (a[i] - 8);         cnt++;       }     }     if (k > 0)       printf( -1 );     else       printf( %d , cnt);   }
#include <bits/stdc++.h>   using namespace std;   struct Edge {     int id;     int u, v, w;   } edges[100005];   int n, m;   int d[100005], cost[100005];   bool path[100005];   vector<Edge> G[100005], ans;   int main() {     ios_base::sync_with_stdio(false);     cin >> n >> m;     for (int i = 0; i < m; i++) {       int u, v, w;       cin >> u >> v >> w;       edges[i].u = u, edges[i].v = v, edges[i].w = w, edges[i].id = i;       G[u].push_back(edges[i]);       G[v].push_back(edges[i]);     }     d[1] = 0;     cost[1] = 0;     queue<int> que;     que.push(1);     while (!que.empty()) {       int u = que.front();       que.pop();       for (size_t i = 0; i < G[u].size(); i++) {         Edge e = G[u][i];         int v = e.u;         if (v == u) v = e.v;         if (v != 1 && d[v] == 0) {           d[v] = d[u] + 1;           que.push(v);         }         if (d[v] == d[u] + 1) cost[v] = max(cost[v], cost[u] + e.w);       }     }     int u = n;     while (d[u] != 0) {       for (size_t i = 0; i < G[u].size(); i++) {         Edge e = G[u][i];         int v = e.u;         if (v == u) v = e.v;         if (d[v] != d[u] - 1) continue;         if ((e.w == 1 && cost[v] == cost[u] - 1) ||             (e.w == 0 && cost[v] == cost[u])) {           path[e.id] = true;           u = v;           break;         }       }     }     for (int ind = 0; ind < m; ind++) {       if (path[ind] && edges[ind].w == 0) {         ans.push_back(edges[ind]);       } else if (!path[ind] && edges[ind].w == 1) {         ans.push_back(edges[ind]);       }     }     cout << ans.size() << endl;     for (vector<Edge>::iterator it = ans.begin(); it != ans.end(); ++it) {       cout << it->u <<     << it->v <<     << (it->w ^ 1) << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long INF = 1e9, MOD = INF + 7;   long long gcd(long long a, long long b) { return (b ? gcd(b, a % b) : a); }   long long power(long long a, long long b) {     return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1));   }   long long mod(long long a) { return (a % MOD + MOD) % MOD; }   const long long N = 1e6 + 20;   vector<long long> g[N];   long long mark[N];   vector<pair<long long, pair<long long, long long> > > ans;   bool dfs(long long v, long long par = 0) {     mark[v] = 1;     long long tmp = 0;     for (long long u : g[v]) {       if (u == par || mark[u] == 2) continue;       if (mark[u] == 0 && dfs(u, v)) continue;       if (tmp == 0)         tmp = u;       else         ans.push_back(make_pair(v, make_pair(u, tmp))), tmp = 0;     }     mark[v] = 2;     if (tmp != 0 && par != 0) ans.push_back(make_pair(v, make_pair(tmp, par)));     return tmp;   }   int32_t main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     long long n, m;     cin >> n >> m;     for (long long i = 0; i < m; i++) {       long long x, y;       cin >> x >> y;       g[x].push_back(y);       g[y].push_back(x);     }     for (long long i = 1; i <= n; i++)       if (mark[i] == 0) dfs(i);     cout << ans.size() <<   n ;     for (auto p : ans)       cout << p.second.first <<     << p.first <<     << p.second.second <<   n ;     return 0;   }
#include <bits/stdc++.h>   int main() {     long n, m;     scanf( %ld %ld , &n, &m);     std::vector<long> a(n + 2, 0);     a[n + 1] = m;     for (long p = 1; p <= n; p++) {       scanf( %ld , &a[p]);     }     long orig(0), off(0), mx(0);     for (long p = n; p >= 0; p--) {       if (p % 2) {         off += a[p + 1] - a[p];       } else {         orig += a[p + 1] - a[p];       }       mx = (mx > off - orig) ? mx : (off - orig);     }     printf( %ld n , orig + (mx > 0) * (mx - 1));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     scanf( %d , &n);     int k = (n + 1) / 2;     vector<int> A(k);     for (int& a : A) scanf( %d , &a);     int x;     scanf( %d , &x);     A.resize(n, x);     long long sum = accumulate(begin(A), begin(A) + k, 0LL);     long long min_sum = sum;     int res = -1;     for (long long i = k, s = 1LL * x * (n - k); i < n; ++i, s -= x) {       if (min_sum + s > 0) {         res = n + k - i;         break;       }       sum += A[i] - A[i - k];       min_sum = min(min_sum, sum);     }     if (res == -1 && min_sum > 0) res = k;     printf( %d n , res);   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline void smn(T &a, const T &b) {     if (b < a) a = b;   }   template <class T>   inline void smx(T &a, const T &b) {     if (b > a) a = b;   }   template <class T>   inline T rev(const T &a) {     T _ = a;     reverse(_.begin(), _.end());     return _;   }   const double eps = 1e-9;   const long double leps = 1e-14;   const int MN = 5000 + 100, MOD = 1000 * 1000 * 1000 + 7;   vector<int> dis;   int n;   int dt[MN][MN];   pair<int, int> point[MN];   int mk = 1, now;   int mark[MN];   int v[MN];   int d(pair<int, int> a, pair<int, int> b) {     return abs(a.first - b.first) + abs(a.second - b.second);   }   void dfs(int a) {     mark[a] = mk;     for (int i = 0; i < n; i++)       if (dt[a][i] > now && mark[i] != mk) v[i] = 1 - v[a], dfs(i);   }   bool av(int a) {     now = a;     for (int i = 0; i < n; i++)       if (mark[i] != mk) v[i] = 0, dfs(i);     mk++;     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++)         if (dt[i][j] > now && v[i] == v[j]) return 0;     return 1;   }   int main(int argc, char *argv[]) {     ios_base::sync_with_stdio(false);     cin >> n;     for (int i = 0; i < n; i++) cin >> point[i].first >> point[i].second;     for (int i = 0; i < n; i++)       for (int j = 0; j < n; j++) dt[i][j] = d(point[i], point[j]);     int s = 0, e = 10000;     int res = 10000;     while (s <= e) {       int m = (s + e) / 2;       if (av(m))         smn(res, m), e = m - 1;       else         s = m + 1;     }     now = res;     cout << now <<   n ;     int rn = 1;     for (int i = 0; i < n; i++)       if (mark[i] != mk) dfs(i), rn = (2LL * rn) % MOD;     cout << rn <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long MAXN = 1e5 + 10, md = 1e9 + 7;   vector<long long> child[MAXN];   long long dp[2][MAXN], dp1[2][MAXN], dp2[2][2][MAXN];   void dfs(long long v) {     long long s = child[v].size();     for (long long i = 0; i < s; ++i) {       long long now = child[v][i];       dfs(now);       if (!i) {         dp1[0][now] = dp[0][now] + 1;         dp1[1][now] = dp[1][now];         dp2[1][0][now] = dp2[0][0][now] = 1;         dp2[0][0][now] += dp[0][now];         dp2[1][1][now] = dp[1][now];         continue;       }       long long p = child[v][i - 1];       dp1[0][now] = (dp1[0][p] * (dp[0][now] + 1) + dp1[1][p] * dp[1][now]) % md;       dp1[1][now] = (dp1[0][p] * dp[1][now] + dp1[1][p] * (dp[0][now] + 1)) % md;       dp2[0][0][now] = dp2[0][0][p] * (1 + dp[0][now]) % md;       dp2[1][0][now] = (dp2[1][1][p] * dp[1][now] + dp2[1][0][p]) % md;       dp2[1][1][now] = (dp2[1][0][p] * dp[1][now] + dp2[1][1][p]) % md;     }     if (child[v].empty()) {       dp[1][v] = 1;       return;     }     long long k = child[v].back();     dp[1][v] = 2 * dp1[0][k] - dp2[0][0][k];     dp[1][v] = (dp[1][v] + md * 10) % md;     dp[0][v] = 2 * dp1[1][k] - dp2[1][1][k];     dp[0][v] = (dp[0][v] + md * 10) % md;   }   int32_t main() {     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);     long long n, a1;     cin >> n;     for (long long i = 2; i <= n; ++i) {       cin >> a1;       child[a1].push_back(i);     }     dfs(1);     cout << (dp[0][1] + dp[1][1]) % md;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     long long t, a, b, x, y, n, z, z2;     cin >> t;     while (t--) {       cin >> a >> b >> x >> y >> n;       if (abs(a - x) + abs(b - y) < n) {         n = abs(a - x) + abs(b - y);       }       long long a2 = a, b2 = b, x2 = x, y2 = y, n2 = n;       if (n2 > abs(a2 - x2)) {         n2 -= abs(a2 - x2);         a2 = x2;         b2 -= n2;       } else {         a2 -= n2;       }       if (n > abs(b - y)) {         n -= abs(b - y);         b = y;         a -= n;       } else {         b -= n;       }       cout << min(a2 * b2, a * b) <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long M = 1e9 + 7;   void solve() {     long long n, r;     cin >> n >> r;     long long ans = 0;     if (r >= n) ans++;     r = min(r, n - 1);     if (r % 2)       ans += r * ((r + 1) / 2);     else       ans += (r / 2) * (r + 1);     cout << ans <<   n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t = 1;     cin >> t;     while (t--) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, q;   void read() { scanf( %d%d , &n, &q); }   void solve() {     int p0 = 0, p1 = 0, l = 0;     while (q--) {       int t;       scanf( %d , &t);       if (t == 1) {         int x;         scanf( %d , &x);         p1 = (p1 + x) % n;         p0 = (p0 + x) % n;         l ^= ((x % 2) + 2) % 2;       } else {         if (!l) {           p0 = (p0 + 1) % n;           p1 = (p1 - 1) % n;         } else {           p0 = (p0 - 1) % n;           p1 = (p1 + 1) % n;         }         l ^= 1;       }     }     if (l == 1) swap(p0, p1);     for (int i = 0; i < n; i++) {       int x;       x = (i - p0 + n) % n;       printf( %d  , x + 1);       swap(p0, p1);     }   }   int main() {     read();     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool o[30];   int main() {     int m, n, i, x, mid;     cin >> m >> n;     for (i = 0; i < n; i++) {       cout << m << endl;       cin >> x;       if (!x) return printf( %d n , m), 0;       o[i] = x == -1;     }     i = -1;     int l = 1, r = m - 1;     while (l <= r) {       mid = (l + r) >> 1;       cout << mid << endl;       cin >> x;       if (!x) return printf( %d n , mid), 0;       if ((x == -1) ^ o[(++i) %= n])         l = mid + 1;       else         r = mid - 1;     }     return printf( %d n , l), 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int ans, h, r;     double tmp;     scanf( %d%d , &r, &h);     ans = h / r * 2;     tmp = h % r;     if (r / 2.0 - tmp > 1e-8)       ans++;     else if (sqrt(3) / 2 * r - tmp > 1e-8)       ans += 2;     else       ans += 3;     printf( %d , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 3e5 + 5;   vector<long long> adj[N];   vector<pair<long long, long long> > lol[N];   long long x[N], y[N], z[N], vis[N], tin[N], low[N], bridge[N], comp[N],       artificat[N], depth[N], par[N], path[N], timer, cur;   void dfs1(long long node, long long prvId) {     vis[node] = 1;     tin[node] = low[node] = ++timer;     for (auto &id : adj[node]) {       if (id == prvId) continue;       long long v = x[id] ^ y[id] ^ node;       if (!vis[v])         dfs1(v, id), low[node] = min(low[node], low[v]);       else         low[node] = min(low[node], tin[v]);       if (low[v] > tin[node]) bridge[id] = 1;     }   }   void dfs2(long long node) {     comp[node] = cur;     vis[node] = 1;     for (auto &id : adj[node]) {       if (bridge[id]) continue;       if (z[id]) artificat[cur] = 1;       long long v = x[id] ^ y[id] ^ node;       if (!vis[v]) dfs2(v);     }   }   void dfs3(long long node, long long pr) {     depth[node] = depth[pr] + 1;     par[node] = pr;     for (auto &ele : lol[node])       if (ele.first != pr) path[ele.first] = ele.second, dfs3(ele.first, node);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long n, m;     cin >> n >> m;     for (long long i = 1; i <= m; i++) {       cin >> x[i] >> y[i] >> z[i];       adj[x[i]].push_back(i);       adj[y[i]].push_back(i);     }     dfs1(1, 0);     for (long long i = 1; i <= n; i++) vis[i] = 0;     for (long long i = 1; i <= n; i++)       if (!vis[i]) cur++, dfs2(i);     for (long long i = 1; i <= m; i++) {       if (bridge[i]) {         lol[comp[x[i]]].push_back({comp[y[i]], z[i]});         lol[comp[y[i]]].push_back({comp[x[i]], z[i]});       }     }     dfs3(1, 0);     long long s, t;     cin >> s >> t;     s = comp[s], t = comp[t];     while (s != t) {       if (depth[s] < depth[t]) swap(s, t);       if (artificat[s] || path[s]) return cout <<  YES , 0;       s = par[s];     }     cout << (artificat[s] ?  YES  :  NO );   }
#include <bits/stdc++.h>   using namespace std;   const int N = 500000;   const int M = 70;   const int C = 300;   const int MOD = 1e9 + 7;   struct Point {     int x[5];     Point() {       for (int i = 0; i < 5; i++) x[i] = 0;     }   };   int n;   Point a[N];   vector<int> res;   Point diff(const Point &a, const Point &b) {     Point res = Point();     for (int i = 0; i < 5; i++) res.x[i] = a.x[i] - b.x[i];     return res;   }   bool check(const Point &a, const Point &b) {     int val = 0;     for (int i = 0; i < 5; i++) val += a.x[i] * b.x[i];     return (val > 0);   }   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) {       for (int j = 0; j < 5; j++) scanf( %d , &a[i].x[j]);     }     int ans = 0;     if (n <= C) {       for (int i = 0; i < n; i++) {         bool flag = true;         for (int j = 0; j < n; j++) {           for (int k = j + 1; k < n; k++) {             if (j == i || k == i) continue;             if (check(diff(a[j], a[i]), diff(a[k], a[i]))) {               flag = false;               break;             }           }         }         if (flag) {           ans++;           res.push_back(i + 1);         }       }     }     cout << ans << endl;     for (int i = 0; i < res.size(); i++) cout << res[i] <<    ;     return 0;   }