malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int n, m;   char s[505];   int sz;   int val[505];   int ch[505][11];   void insert() {     int f, k = 0;     scanf( %s%d , s, &f);     for (int i = 0; s[i]; ++i) {       int c = s[i] -  0 ;       if (!ch[k][c]) ch[k][c] = ++sz;       k = ch[k][c];     }     val[k] += f;   }   void init() {     scanf( %d%d , &n, &m);     while (n--) insert();   }   int dep[505];   int dp[505][505][15], f[505][15];   void dfs(int i) {     if (val[i])       for (int l = 0; l <= dep[i]; ++l)         for (int k = 0; k <= m; ++k) dp[i][l][k] = l * val[i];     for (int c = 0; c < 11; ++c) {       int j = ch[i][c];       if (!j) continue;       dep[j] = dep[i] + 1;       dfs(j);       memcpy(f, dp[i], sizeof(f));       memset(dp[i], 0x3f, sizeof(dp[i]));       for (int l = 0; l <= dep[i]; ++l)         for (int k = m; ~k; --k)           for (int p = 0; p <= k; ++p) {             dp[i][l][k] = min(dp[i][l][k], f[l][k - p] + dp[j][l + 1][p]);             if (p) dp[i][l][k] = min(dp[i][l][k], f[l][k - p] + dp[j][0][p - 1]);           }     }   }   void solve() {     dfs(0);     printf( %d n , dp[0][0][m]);   }   int main() {     init();     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int LEN = (int)1e5;   int n;   long long a[LEN];   vector<int> g[60];   int bfs(int r, int t) {     queue<int> q;     static int d[LEN];     memset(d, 0, sizeof d);     q.push(r);     d[r] = 1;     while (!q.empty()) {       int u = q.front();       q.pop();       for (int j = 0; (1ll << j) <= a[u]; j++)         if ((1ll << j) & a[u])           for (auto v : g[j])             if (!d[v] && !(v == t && u == r)) {               d[v] = d[u] + 1;               if (v == t) return d[v] > 2 ? d[v] : INT_MAX;               q.push(v);             }     }     return INT_MAX;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a[i];       for (int j = 0; (1ll << j) <= a[i]; j++)         if ((1ll << j) & a[i]) g[j].push_back(i);       ;       ;     }     for (int i = 0; i < 60; i++)       if ((int)(g[i]).size() >= 3) {         cout << 3;         return 0;       }     int ans = INT_MAX;     for (int i = 0; i < 60; i++)       if ((int)(g[i]).size() > 1) {         a[g[i][0]] &= ~(1ll << i);         ans = min(ans, bfs(g[i][0], g[i][1]));         a[g[i][0]] |= 1ll << i;       }     cout << (ans < INT_MAX ? ans : -1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int s[10], a, b, c;     cin >> a >> b >> c;     s[0] = a + (b * c);     s[1] = a * (b + c);     s[2] = a * b * c;     s[3] = (a + b) * c;     s[4] = a + b + c;     s[5] = (a * b) + c;     sort(s, s + 5, greater<int>());     cout << s[0] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   T __trace(string s, T x) {     cerr << s << x << endl;     return x;   }   template <class T>   ostream& operator<<(ostream& os, const vector<T>& v) {     for (T x : v) os << x <<    ;     return os;   }   template <class T>   istream& operator>>(istream& is, vector<T>& v) {     for (T& x : v) is >> x;     return is;   }   void run() {     long long n;     cin >> n;     map<pair<long long, long long>, long long> m;     long long ans = 0;     for (long long i = 0; i < (n); i++) {       long long h, mi;       cin >> h >> mi;       m[make_pair(h, mi)]++;       ans = max(ans, m[make_pair(h, mi)]);     }     cout << ans << endl;   }   int main() {     run();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline void _read(T& x) {     char ch = getchar();     bool sign = true;     while (!isdigit(ch)) {       if (ch ==  - ) sign = false;       ch = getchar();     }     for (x = 0; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch -  0 ;     if (!sign) x = -x;   }   bool mark[1505];   int n, ans[1505], lim;   int d[5] = {0, 1, 5, 10, 50};   void dfs(int id, int x, int tot) {     if (x == lim + 1) {       mark[tot] = true;       return;     }     for (int i = id; i <= 4; i++) dfs(i, x + 1, tot + d[i]);   }   int main() {     cin >> n;     for (int i = 1; i <= 30; i++) {       lim = i;       memset(mark, 0, sizeof(mark));       dfs(1, 1, 0);       int temp = 0;       for (int j = 1; j <= i * 50; j++)         if (mark[j]) temp++;       ans[i] = temp;     }     if (n <= 12) {       cout << ans[n];       return 0;     }     cout << 1ll * 49 * (n - 12) + ans[12];   }
#include <bits/stdc++.h>   using namespace std;   set<string> S;   void flip(string& s1) {     char temp = s1[0];     for (int i = 1; i < 4; i++) s1[i - 1] = s1[i];     s1[3] = temp;     return;   }   bool isFirst(string s1) {     for (int i = 0; i < 4; i++) {       if (S.find(s1) != S.end()) return false;       flip(s1);     }     return true;   }   int main() {     int N, result(0);     string s1, s2;     cin >> N;     cin >> s1 >> s2;     s1 += s2[1];     s1 += s2[0];     if (isFirst(s1)) {       S.insert(s1);       result++;     }     for (int i = 1; i < N; i++) {       cin >> s1;       cin >> s1 >> s2;       s1 += s2[1];       s1 += s2[0];       if (isFirst(s1)) {         S.insert(s1);         result++;       }     }     cout << result << endl;   }
#include <bits/stdc++.h>   using namespace std;   inline void Boost() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);   }   const int NMax = 1e5 + 50;   struct Event {     int d, w, t;     bool operator<(const Event &e) const {       if (w != e.w) return w > e.w;       return d > e.d;     }   };   vector<int> DP, jump;   map<Event, int> Map;   vector<Event> v[NMax];   int main() {     Boost();     int n, k, m;     cin >> n >> m >> k;     DP.resize(n);     jump.resize(n);     for (int i = 0; i < n; ++i) jump[i] = i + 1;     for (int i = 0; i < k; ++i) {       int s, t, d, w;       cin >> s >> t >> d >> w;       v[s - 1].push_back({d, w, 1});       v[t].push_back({d, w, 0});     }     for (int i = 0; i < n; ++i) {       for (auto x : v[i]) {         if (x.t == 1) {           if (Map.count(x)) {             ++Map[x];           } else {             Map[x] = 1;           }         } else {           --Map[x];           if (Map[x] == 0) {             Map.erase(x);           }         }       }       if (!Map.empty()) {         DP[i] = (*Map.begin()).first.w;         jump[i] = (*Map.begin()).first.d;       }     }     vector<long long int> ans[m + 1];     for (auto &x : ans) x.resize(n + 1, LLONG_MAX);     ans[0][0] = 0;     for (int i = 0; i <= n; ++i) {       for (int j = 1; j <= m && i; ++j) {         ans[j][i] = min(ans[j][i], ans[j - 1][i - 1]);       }       for (int j = 0; j <= m && i < n; ++j) {         if (ans[j][i] == LLONG_MAX) continue;         ans[j][jump[i]] = min(ans[j][jump[i]], ans[j][i] + DP[i]);       }     }     long long int ret = ans[0][n];     for (int i = 0; i <= m; ++i) {       ret = min(ret, ans[i][n]);     }     cout << ret;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2510;   const int INF = 0x3f3f3f3f;   int prime[400];   bool isprime[N];   int k;   void init() {     k = 0;     for (int i = 2; i <= N; i++) {       if (!isprime[i]) {         prime[k++] = i;         for (int j = i + i; j <= N; j += i) isprime[j] = 1;       }     }   }   char s[N];   int ma[N * 2][N * 2], pre[N * 2][N * 2];   int main() {     init();     memset(pre, 0, sizeof(pre));     int n, m;     scanf( %d%d , &n, &m);     for (int i = 1; i < 2 * N; i++) {       if (i <= n) scanf( %s , s + 1);       int tmp = 0;       for (int j = 1; j <= m; j++) {         if (i > n)           ma[i][j] = 0;         else {           if (s[j] ==  0 )             ma[i][j] = 0;           else {             ma[i][j] = 1;             tmp++;           }         }         pre[i][j] = tmp + pre[i - 1][j];       }       for (int j = m + 1; j < N * 2; j++) {         pre[i][j] = tmp + pre[i - 1][j];       }     }     int ans = INF;     for (int f = 0; f < k; f++) {       int p = prime[f];       int res = 0;       for (int i = p; i < n + p; i += p) {         for (int j = p; j < m + p; j += p) {           int ff = pre[i][j] + pre[i - p][j - p] - pre[i][j - p] - pre[i - p][j];           res = res + min(p * p - ff, ff);         }       }       ans = min(ans, res);     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   class Node {    public:     int vol, l, r, tot;     Node(int val) {       tot = vol = val;       l = r = 0;     }     Node() {       tot = vol = 0;       l = r = 0;     }   };   int main() {     int H, q;     cin >> H >> q;     vector<Node> tree(1);     string s;     int v, val;     for (int query = 0; query < q; ++query) {       cin >> s;       if (s[0] ==  a ) {         cin >> v >> val;         vector<int> vbit;         while (v) {           vbit.push_back(v % 2);           v /= 2;         }         int it = 0;         for (int h = (int)vbit.size() - 2; h >= 0; --h) {           if (!tree[it].r) {             tree[it].l = tree.size();             tree[it].r = tree.size() + 1;             tree.resize(tree.size() + 2);           }           tree[it].tot += val;           int nextit = tree[it].l;           if (vbit[h]) {             nextit = tree[it].r;           }           it = nextit;         }         tree[it].vol += val;         tree[it].tot += val;       } else {         double res = 0.;         int it = 0;         int ma = 0;         int h = H;         for (; h > 0 && tree[it].r; --h) {           int nextit = tree[it].r;           if (tree[it].vol + tree[tree[it].r].tot > tree[tree[it].l].tot) {             res += max(ma, tree[it].vol + tree[tree[it].r].tot) *                    (double)(1 << (h - 1));             ma = max(ma, tree[it].vol + tree[tree[it].l].tot);           } else {             res += max(ma, tree[it].vol + tree[tree[it].l].tot) *                    (double)(1 << (h - 1));             ma = max(ma, tree[it].vol + tree[tree[it].r].tot);             nextit = tree[it].l;           }           it = nextit;         }         res += max(ma, tree[it].vol) * (double)(1 << h);         printf( %lf n , res / (1 << (H)));       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     long long int n;     cin >> n;     long long int a, c1 = 0, c2 = 0, c3 = 0;     vector<long long int> v1;     vector<long long int> v2;     vector<long long int> v3;     for (int i = 1; i <= n; i++) {       cin >> a;       if (a == 0) {         v3.push_back(a);       } else if (a > 0) {         v2.push_back(a);       } else {         v1.push_back(a);       }     }     if (v2.size() == 0) {       for (int i = 0; i < 2; i++) {         v2.push_back(v1.back());         v1.pop_back();       }     }     if (v1.size() % 2 == 0) {       v3.push_back(v1.back());       v1.pop_back();     }     cout << v1.size() <<    ;     for (int i = 0; i < v1.size(); i++) cout << v1[i] <<    ;     cout << endl;     cout << v2.size() <<    ;     for (int i = 0; i < v2.size(); i++) cout << v2[i] <<    ;     cout << endl;     cout << v3.size() <<    ;     for (int i = 0; i < v3.size(); i++) cout << v3[i] <<    ;     cout << endl;   }   int main() {     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int w, h;     cin >> w >> h;     int ans = 1;     for (int i = 0; i < w + h; i++) {       ans = (ans * 2) % 998244353;     }     cout << ans % 998244353 <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int sum = 0;     string s;     for (int i = 0; i < n; i++) {       cin >> s;       if (s ==  Icosahedron )         sum += 20;       else if (s ==  Dodecahedron )         sum += 12;       else if (s ==  Octahedron )         sum += 8;       else if (s ==  Cube )         sum += 6;       else if (s ==  Tetrahedron )         sum += 4;     }     cout << sum;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>(                   chrono::high_resolution_clock::now().time_since_epoch())                   .count());   const long long int N = 20005;   const long long int LG = 22;   long long int n, m;   long long int power(long long int x, long long int y, long long int m) {     if (y == 0) return 1;     long long int p = power(x, y / 2, m) % m;     p = (p * p) % m;     return (y % 2 == 0) ? p : (x * p) % m;   }   long long int fact[N], ifact[N];   void proecss() {     fact[0] = 1;     for (long long int i = 1; i < N; i++)       fact[i] = (fact[i - 1] * i) % 1000000007;     for (long long int i = 0; i < N; i++)       ifact[i] = power(fact[i], 1000000007 - 2, 1000000007);   }   long long int nCr(long long int n, long long int r) {     if (r > n) return 0;     if (r == n) return 1;     long long int ans = (ifact[n - r] * ifact[r]) % 1000000007;     ans = (ans * fact[n]) % 1000000007;     return ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     proecss();     cin >> n >> m;     long long int b[n + 5], a[n + 5];     for (long long int i = 1; i <= n; i++) {       long long int nn = n - i + 1;       long long int rr = m - 1;       b[i] = nCr(nn + rr - 1, rr);       a[i] = nCr(i + rr - 1, rr);     }     for (long long int i = n - 1; i >= 1; i--)       b[i] += b[i + 1], b[i] %= 1000000007;     long long int ans = 0;     for (long long int i = 1; i <= n; i++) {       ans = (ans + (a[i] * b[i]) % 1000000007) % 1000000007;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string out;   long long int T;   unsigned canDo1[5000 / 32 + 1], canDo2[5000 / 32 + 1];   unsigned *cd1 = canDo1, *cd2 = canDo2, *sw;   int A[5000];   list<int> P;   int N;   void process() {     cin >> N;     N *= 2;     P.clear();     for (int i = 0; i < N; i++) cin >> A[i];     int ps = 0, p = 0;     for (int i = 0; i < N; i++)       if (A[i] <= A[ps])         p++;       else         P.push_back(p), ps = i, p = 1;     P.push_back(p);     for (int i = 0; i <= N / 32 + 1; i++) cd1[i] = cd2[i] = 0;     cd1[0] = cd2[0] = 1;     for (int p : P) {       for (int i = 0; i <= N; i++)         if ((cd2[i / 32] & 1 << i % 32) ||             (i >= p && (cd2[(i - p) / 32] & 1 << (i - p) % 32)))           cd1[i / 32] |= 1 << i % 32;       sw = cd1, cd1 = cd2, cd2 = sw;     }     out += (cd2[N / 2 / 32] & 1 << N / 2 % 32) ?  YES n  :  NO n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> T;     for (int t = 1; t <= T; t++) process();     cout << out;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long n, k, bd, s, ar[6000], ans, calc[1200000];   long lst[1200000];   long del;   long q;   void check(long mod) {     del = 0;     for (int i = 1; i <= n; i++) {       q = ar[i] % mod;       if (lst[q] == mod)         ++del;       else         lst[q] = mod;       if (del > k) break;     }     if (del <= k) ans = mod;   }   int main() {     ios_base::sync_with_stdio(0);     cin >> n >> k;     if (k == 0) bd = 0;     if (k == 1) bd = 1;     if (k == 2) bd = 3;     if (k == 3) bd = 6;     if (k == 4) bd = 10;     for (int i = 1; i <= n; i++) cin >> ar[i];     sort(ar + 1, ar + n + 1);     for (int i = 1; i <= n; i++)       for (int j = i + 1; j <= n; j++) calc[ar[j] - ar[i]]++;     ans = 0;     for (int mod = 1; mod <= 1000001; mod++) {       s = 0;       if (ans > 0) break;       for (int p = mod; p <= 1000001; p += mod) {         s += calc[p];         if (s > bd) break;       }       if (s <= bd) check(mod);     }     cout << ans << endl;     cin.get();     cin.get();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline istream &operator>>(istream &s, vector<T> &v) {     for (T &t : v) {       s >> t;     }     return s;   }   template <typename T>   inline ostream &operator<<(ostream &s, const vector<T> &v) {     for (int i = 0; i < int(v.size()); ++i) {       s << (    + !i) << v[i];     }     return s;   }   template <typename T>   inline T fromString(const string &s) {     T res;     istringstream iss(s);     iss >> res;     return res;   };   template <typename T>   inline string toString(const T &a) {     ostringstream oss;     oss << a;     return oss.str();   };   const long long mod = 1000000007;   const long long INF = 1e18;   int main() {     long long t;     t = 1;     cin >> t;     while (t--) {       long long n;       cin >> n;       char s[2][n];       for (int i = (0); i < (2); i++) {         for (int j = (0); j < (n); j++) {           cin >> s[i][j];         }       }       long long f = 0;       for (int i = (0); i < (1); i++) {         for (int j = (0); j < (n); j++) {           if (s[i][j] ==  1  && s[i + 1][j] ==  1 ) {             f = 1;           }         }       }       if (f) {         cout <<  NO               <<   n ;       } else {         cout <<  YES               <<   n ;       }     }   }
#include <bits/stdc++.h>   using std::cerr;   const int N = 998244, M = 1001;   int n, m, d[N], las[N], seq[N], cnt[M][M], blo, x[N], y[N];   inline void add(int a, int b, int val) { seq[a] += val, seq[b + 1] -= val; }   signed main() {     std::ios::sync_with_stdio(0);     scanf( %d%d , &n, &m), blo = sqrt(m);     for (int i = 1; i <= n; i++) scanf( %d%d , &x[i], &y[i]);     int op, k;     for (int now = 1; now <= m; now++) {       scanf( %d%d , &op, &k);       if (op == 1) {         if (x[k] + y[k] <= blo) {           for (int i = x[k]; i < x[k] + y[k]; i++)             cnt[x[k] + y[k]][(now + i) % (x[k] + y[k])]++;         } else           for (int i = now + x[k]; i <= m; i += x[k] + y[k])             add(i, i + y[k] - 1, 1);         las[k] = now;       } else {         if (x[k] + y[k] <= blo) {           for (int i = x[k]; i < x[k] + y[k]; i++)             cnt[x[k] + y[k]][(las[k] + i) % (x[k] + y[k])]--;         } else {           for (int i = las[k] + x[k]; i <= m; i += x[k] + y[k]) {             if (i + y[k] - 1 < now) continue;             if (i <= now && i + y[k] - 1 >= now)               add(now, i + y[k] - 1, -1);             else               add(i, i + y[k] - 1, -1);           }         }       }       int ans = 0;       for (int i = 2; i <= blo; i++) {         ans += cnt[i][now % i];       }       seq[now] += seq[now - 1];       printf( %d n , ans + seq[now]);     }   }
#include<iostream>   #include<cstdio>   #include<algorithm>   #include<cmath>   #include<cstring>   #include<queue>   #define ll long long   using namespace std;   const int N=310,M=100005,mod=1e9+7;   int n,tot;   ll inv,ans;   int head[N],ver[M],Nxt[M],dep[N],fa[N][20];   ll f[N][N];   void add(int x,int y){    ver[++tot]=y;    Nxt[tot]=head[x];    head[x]=tot;   }   void dfs(int u,int now){    dep[u]=now;    for(int i=head[u];i;i=Nxt[i]){     int y=ver[i];     if(y==fa[u][0]) continue;     fa[y][0]=u;     for(int j=1;j<=18;j++){      fa[y][j]=fa[fa[y][j-1]][j-1];     }     dfs(y,now+1);    }   }   int LCA(int x,int y){    if(dep[x]<dep[y]) swap(x,y);    for(int j=18;j>=0;j--){     if(dep[fa[x][j]]>=dep[y]) x=fa[x][j];    }    if(x==y) return x;    for(int j=18;j>=0;j--){     if(fa[x][j]!=fa[y][j]){      x=fa[x][j];y=fa[y][j];     }    }    return fa[x][0];   }   ll ksm(ll x,ll p){    ll sum=1;    while(p){     if(p&1) sum=sum*x%mod;     x=x*x%mod;     p>>=1;    }    return sum;   }   int main()   {    scanf( %d ,&n);        inv=ksm(2,mod-2);        for(int i=1;i<=n;i++){     f[i][0]=1;     f[0][i]=0;    }        for(int i=1;i<=n;i++){     for(int j=1;j<=n;j++){      f[i][j]=(f[i-1][j]+f[i][j-1])*inv%mod;     }    }        for(int i=1;i<n;i++){     int x,y;     scanf( %d%d ,&x,&y);     add(x,y);add(y,x);    }        for(int i=1;i<=n;i++){     memset(fa,0,sizeof(fa));     memset(dep,0,sizeof(dep));     dfs(i,1);        //  for(int j=1;j<=n;j++){   //   printf( %d %d n ,j,dep[j]);   //  }           for(int j=1;j<=n;j++){      for(int k=j+1;k<=n;k++){       int lca=LCA(j,k);   //    printf( 以%d为根 %d 和 %d 的 LCA 是%d n ,i,j,k,lca);       ans=(ans+f[dep[j]-dep[lca]][dep[k]-dep[lca]])%mod;      }     }    }        printf( %lld n ,ans*ksm(n,mod-2)%mod);    return 0;   }
#include <bits/stdc++.h>   using namespace std;   int lcp[25][25];   int b[25];   string s[25];   int ans = 0;   void BT(int now, int n, int k) {     if (now == n) {       int have = 0;       for (int i = 0; i < n; i++)         for (int j = i + 1; j < n; j++)           if (b[i] && b[j]) have += lcp[i][j];       ans = max(ans, have);       return;     }     b[now] = 0;     if (n - now > k) BT(now + 1, n, k);     if (k) {       b[now] = 1;       BT(now + 1, n, k - 1);     }   }   int main() {     ios::sync_with_stdio(false);     int n, k;     cin >> n >> k;     for (int i = 0; i < n; i++) {       cin >> s[i];       for (int j = 0; j < i; j++) {         int k;         for (k = 0; k < s[i].length() && k < s[j].length() && s[i][k] == s[j][k];              k++)           ;         lcp[i][j] = lcp[j][i] = k;       }     }     BT(0, n, k);     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   pair<double, double> arr[1000];   int n;   double m, r;   void solve() {     vector<pair<int, int> > v;     double h = m;     int t = 0;     while (h > 0) {       int best_i = -1;       for (int i = 0; i < n; ++i) {         if (arr[i].first >= h) {           if (best_i == -1) {             best_i = i;           } else {             if (arr[i].second > arr[best_i].second) {               best_i = i;             }           }         }       }       if (best_i == -1 && r >= 0) {         printf( NO );         return;       }       if (best_i > -1) {         r -= arr[best_i].second;         arr[best_i].first = -10;         v.push_back(make_pair(t, best_i + 1));       }       h += r;       h = min(h, m);       t++;     }     printf( YES n );     printf( %d %d n , t, int(v.size()));     for (int i = 0; i < int(v.size()); ++i) {       printf( %d %d n , v[i].first, v[i].second);     }   }   int main() {     scanf( %d%lf%lf , &n, &m, &r);     for (int i = 0; i < n; ++i) {       double p, d;       scanf( %lf%lf , &p, &d);       arr[i].first = m / 100 * p;       arr[i].second = d;     }     solve();     return 0;   }