malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   template <typename T, size_t N>   long long SIZE(const T (&t)[N]) {     return N;   }   template <typename T>   long long SIZE(const T &t) {     return t.size();   }   string to_string(const string s, long long x1 = 0, long long x2 = 1e9) {     return     + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) :   ) +    ;   }   string to_string(const char *s) { return to_string((string)s); }   string to_string(const bool b) { return (b ?  true  :  false ); }   string to_string(const char c) { return string({c}); }   template <size_t N>   string to_string(const bitset<N> &b, long long x1 = 0, long long x2 = 1e9) {     string t =   ;     for (long long __iii__ = min(x1, SIZE(b)), __jjj__ = min(x2, SIZE(b) - 1);          __iii__ <= __jjj__; ++__iii__) {       t += b[__iii__] +  0 ;     }     return     + t +    ;   }   template <typename A, typename... C>   string to_string(const A(&v), long long x1 = 0, long long x2 = 1e9,                    C... coords);   long long l_v_l_v_l = 0, t_a_b_s = 0;   template <typename A, typename B>   string to_string(const pair<A, B> &p) {     l_v_l_v_l++;     string res =  (  + to_string(p.first) +  ,   + to_string(p.second) +  ) ;     l_v_l_v_l--;     return res;   }   template <typename A, typename... C>   string to_string(const A(&v), long long x1, long long x2, C... coords) {     long long rnk = rank<A>::value;     string tab(t_a_b_s,    );     string res =   ;     bool first = true;     if (l_v_l_v_l == 0) res +=   n ;     res += tab +  [ ;     x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));     auto l = begin(v);     advance(l, x1);     auto r = l;     advance(r, (x2 - x1) + (x2 < SIZE(v)));     for (auto e = l; e != r; e = next(e)) {       if (!first) {         res +=  ,  ;       }       first = false;       l_v_l_v_l++;       if (e != l) {         if (rnk > 1) {           res +=   n ;           t_a_b_s = l_v_l_v_l;         };       } else {         t_a_b_s = 0;       }       res += to_string(*e, coords...);       l_v_l_v_l--;     }     res +=  ] ;     if (l_v_l_v_l == 0) res +=   n ;     return res;   }   void dbgm() { ; }   template <typename Heads, typename... Tails>   void dbgm(Heads H, Tails... T) {     cerr << to_string(H) <<   |  ;     dbgm(T...);   }   void FIO() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);   }   const long long N = 2e5 + 6;   int32_t main() {     FIO();     long long tc;     cin >> tc;     while (tc--) {       long long x, y;       cin >> x >> y;       long long n = x;       if (x == y)         n = x;       else if (x > y) {         n = x * y + y;       } else {         long long r = y % x;         n = y - r / 2;       }       assert(n <= (long long)2e18 and (n % x == y % n));       cout << n <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   int k[1000010];   long long qpow(long long x, int n) {     long long ans = 1;     for (; n; n >>= 1, x = x * x % mod)       if (n & 1) ans = ans * x % mod;     return ans;   }   long long lpow(long long x, int n) {     long long ans = 1;     for (; n; n >>= 1, x *= x) {       if (n && x > mod) return mod;       if (n & 1) ans *= x;       if (ans > mod) return mod;     }     return ans;   }   int main() {     int t;     scanf( %d , &t);     while (t--) {       int n, p;       scanf( %d%d , &n, &p);       for (int i = 0; i < n; i++) scanf( %d , &k[i]);       sort(k, k + n);       long long d = 0;       long long sl = 0, sr = 0, q = k[n - 1];       for (int i = n - 1; i >= 0; i--) {         if (q > k[i]) {           sl = sl * qpow(p, q - k[i]) % mod;           sr = sr * qpow(p, q - k[i]) % mod;           d = min(d * lpow(p, q - k[i]), mod);           q = k[i];         }         if (d)           d--, sr++;         else           d++, sl++;       }       sl = sl * qpow(p, q) % mod;       sr = sr * qpow(p, q) % mod;       printf( %lld n , (sl - sr + mod) % mod);     }   }
#include <bits/stdc++.h>   using namespace std;   bool ps[1111111];   const int mod = 1e9 + 7;   int main() {     int p, k, c = 0;     long long ans = 1;     scanf( %d%d , &p, &k);     for (int i = 0; i < p; ++i) {       if (ps[i]) continue;       c++;       long long b = i;       while (!ps[b]) ps[b] = 1, b = (b * k) % p;     }     if (k != 1) c--;     while (c--) ans = (ans * p) % mod;     printf( %d n , int(ans));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     scanf( %d%d , &n, &m);     if (m == 3 && (n == 5 || n == 6)) {       printf( -1 n );       return 0;     }     for (int i = 0; i < m; ++i) printf( %d %d n , i, i * i + 10000000);     for (int i = 0; i < n - m; ++i) printf( %d %d n , i, -i * i - 10000000);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > vec[2102100];   pair<int, int> tr[2102100];   int lz[2102100];   int id[2102100];   int l[2102100];   int r[2102200];   int b[2102100];   int path[2102100];   int st[2102100];   void build(int p, int l, int r) {     tr[p] = {0, -1};     lz[p] = 0;     if (l == r) {       return;     }     int mid = l + r >> 1;     build(p << 1, l, mid);     build(p << 1 | 1, mid + 1, r);   }   void pushup(int p) { tr[p] = max(tr[p << 1], tr[p << 1 | 1]); }   void pushdown(int p) {     if (lz[p]) {       lz[p << 1] = lz[p << 1 | 1] = lz[p];       lz[p] = 0;       tr[p << 1] = tr[p << 1 | 1] = tr[p];     }   }   pair<int, int> query(int p, int l, int r, int ll, int rr) {     if (ll <= l && rr >= r) {       return tr[p];     }     pushdown(p);     int mid = l + r >> 1;     pair<int, int> res = {0, -1};     if (ll <= mid) res = max(query(p << 1, l, mid, ll, rr), res);     if (rr > mid) res = max(query(p << 1 | 1, mid + 1, r, ll, rr), res);     return res;   }   void update(int p, int l, int r, int ll, int rr, pair<int, int> res) {     if (ll <= l && rr >= r) {       tr[p] = res;       lz[p] = 1;       return;     }     pushdown(p);     int mid = l + r >> 1;     if (ll <= mid) update(p << 1, l, mid, ll, rr, res);     if (rr > mid) update(p << 1 | 1, mid + 1, r, ll, rr, res);     pushup(p);   }   int main() {     int n, t;     cin >> n >> t;     for (int i = 1; i <= t; i++) {       cin >> id[i] >> l[i] >> r[i];       b[i * 2 - 1] = l[i];       b[i * 2] = r[i];     }     sort(b + 1, b + 1 + t * 2);     int len = unique(b + 1, b + 1 + t * 2) - b - 1;     build(1, 1, len);     for (int i = 1; i <= t; i++) {       l[i] = lower_bound(b + 1, b + 1 + len, l[i]) - b;       r[i] = lower_bound(b + 1, b + 1 + len, r[i]) - b;       vec[id[i]].push_back({l[i], r[i]});     }     for (int i = 1; i <= n; i++) {       pair<int, int> mx = {0, -1};       for (auto tt : vec[i]) {         mx = max(mx, query(1, 1, len, tt.first, tt.second));       }       mx.first++;       path[i] = mx.second;       mx.second = i;       for (auto tt : vec[i]) {         update(1, 1, len, tt.first, tt.second, mx);       }     }     pair<int, int> ans = query(1, 1, len, 1, len);     int u = ans.second;     int aa = n;     while (u != -1) {       st[u] = 1;       aa--;       u = path[u];     }     cout << aa << endl;     for (int i = 1; i <= n; i++) {       if (!st[i]) cout << i <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   long long int MOD = 1000000007;   long long int MOD1 = 998244353;   mt19937 tw(chrono::high_resolution_clock::now().time_since_epoch().count());   unsigned long long power(unsigned long long x, int y, int p) {     unsigned long long res = 1;     x = x % p;     while (y > 0) {       if (y & 1) res = (res * x) % p;       y = y >> 1;       x = (x * x) % p;     }     return res;   }   void solve() {     long long int n;     cin >> n;     long long int res = 1;     for (int i = 1; i <= n; i++) {       res = (res * i) % MOD;     }     long long int p = power(2, n - 1, MOD);     res = (res - p + MOD) % MOD;     cout << res <<   n ;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     solve();   }
#include <bits/stdc++.h>   using namespace std;   long long qu(long long a, long long b) {     cout <<  ?   << a <<     << b << endl;     fflush(stdout);     string s;     cin >> s;     if (s[0] ==  x ) return 1;     return 2;   }   int main() {     string s;     while (1) {       cin >> s;       if (s !=  start ) return 0;       long long l = 1;       if (qu(0, 1) == 1) {         cout <<  ! 1 n ;         fflush(stdout);         continue;       }       while (qu(2 * l, l) == 1) l = l * 2LL;       long long r = min((l * 2LL), 1000000000LL);       l++;       long long x = l;       while (l < r) {         long long mid = (l + r) / 2;         if (qu(l - 1, mid) == 2)           l = mid + 1;         else           r = mid;       }       cout <<  !   << l <<   n ;       fflush(stdout);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MD = 1000000007;   inline void add(int &a, const int b) {     a += b;     if (a >= MD) a %= MD;   }   inline int mul(const int &a, const int &b) {     long long r = 1ll * a * b;     if (r >= MD) r %= MD;     return r;   }   int a[9], n, k;   bool vis[9];   bool ok(int x) {     if (x == 1) return 1;     vis[x] = 1;     if (!vis[a[x]] && ok(a[x])) return 1;     return 0;   }   bool check() {     for (int i = 1; i <= k; ++i) {       memset(vis, 0, sizeof vis);       if (!ok(a[i])) return 0;     }     return 1;   }   int dfs(int x) {     if (x == k + 1) {       if (check()) return 1;       return 0;     }     int ret = 0;     for (int i = 1; i <= k; ++i) a[x] = i, ret += dfs(x + 1);     return ret;   }   int main() {     scanf( %d%d , &n, &k);     int ans = 1;     for (int i = k + 1; i <= n; ++i) ans = mul(ans, n - k);     printf( %d n , mul(ans, dfs(1)));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int M = 1e5 + 10;   const int INF = 0x3f3f3f3f;   const int mod = 998244353;   vector<long long> v;   long long dfs(vector<long long> &v, int bit) {     vector<long long> v0, v1;     if (bit < 0 || v.size() == 0) return 0;     for (long long &j : v) {       if ((j >> bit) & 1)         v1.push_back(j);       else         v0.push_back(j);     }     if (v1.size() == 0) return dfs(v0, bit - 1);     if (v0.size() == 0) return dfs(v1, bit - 1);     return min(dfs(v0, bit - 1), dfs(v1, bit - 1)) + (1 << bit);   }   int main() {     int n;     v.clear();     scanf( %d , &n);     for (int i = 0; i < n; i++) {       long long x;       scanf( %lld , &x);       v.push_back(x);     }     long long ans = dfs(v, 30);     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void err(istream_iterator<string> it) {}   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cerr << *it <<   =   << a << endl;     err(++it, args...);   }   inline int add(int a, int b) {     a += b;     return a >= 1000000007 ? a - 1000000007 : a;   }   inline int sub(int a, int b) {     a -= b;     return a < 0 ? a + 1000000007 : a;   }   inline int mul(int a, int b) { return (long long int)a * b % 1000000007; }   int Set(int N, int pos) { return N = N | (1 << pos); }   int Reset(int N, int pos) { return N = N & ~(1 << pos); }   bool Cheek(int N, int pos) { return (bool)(N & (1 << pos)); }   int a[1000005], b[1000005], lft[1000005], rgt[1000005], addina[1000005];   void Solve(int t) {     int i, j, k, n, ans = 0;     scanf( %d , &(n));     for (__typeof(i) i = 1; i <= n; i++) {       scanf( %d , &(a[i]));       addina[a[i]] = i;     }     for (__typeof(i) i = 1; i <= n; i++) scanf( %d , &(b[i]));     for (i = 1; i <= n; i++) {       int address = addina[b[i]];       int needlft = (n - address + i) % n;       lft[needlft]++;       int needrgt = (address - i + n) % n;       rgt[needrgt]++;     }     for (i = 0; i <= n; i++) {       ans = max(ans, lft[i]);       ans = max(ans, rgt[i]);     }     cout << ans << endl;   }   int main() {     int t, T;     T = 1;     for (__typeof(t) t = 1; t <= T; t++) {       Solve(t);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long double EPS = 1e-9;   struct Point {     long long x, y;     Point() {}     Point(long long x, long long y) : x(x), y(y) {}     Point operator-(const Point& a) { return Point(x - a.x, y - a.y); }     long long operator*(Point a) { return x * a.x + y * a.y; }     long long operator%(const Point& a) { return x * a.y - y * a.x; }     long double norm() { return x * x + y * y; }     long double len() { return sqrt(norm()); }     void read() { scanf( %lld%lld , &x, &y); }   } A[5], B[5];   bool operator==(const Point& a, const Point& b) {     return a.x == b.x && a.y == b.y;   }   long long ccw(Point A, Point B, Point C) {     long long t = (B - A) % (C - A);     if (t == 0) return 0;     if (t < 0) return -1;     return 1;   }   const long double PI = acos((long double)-1.0);   long double angle(Point a, Point o, Point b) {     a = a - o;     b = b - o;     long double res = acos((a * b) / sqrt(a.norm()) / sqrt(b.norm()));     while (res < -EPS) res += 2 * PI;     while (res >= 2 * PI) res -= 2 * PI;     return res;   }   bool order(Point A, Point B, Point C) {     return min(A.x, C.x) <= B.x && B.x <= max(A.x, C.x) && min(A.y, C.y) <= B.y &&            B.y <= max(A.y, C.y);   }   bool good(Point A, Point B, Point C) {     if (ccw(A, B, C)) return false;     if (!order(A, B, C)) return false;     long double x = (B - A).len();     long double y = (C - B).len();     if (x * 4 < y - EPS) return false;     if (y * 4 < x - EPS) return false;     return true;   }   bool check() {     long long t[5];     for (long long i = (1), _b = (3); i <= _b; ++i) t[i] = i;     do {       for (long long r1 = 0, _a = (2); r1 < _a; ++r1) {         for (long long r2 = 0, _a = (2); r2 < _a; ++r2) {           for (long long r3 = 0, _a = (2); r3 < _a; ++r3) {             if (A[t[1]] == A[t[2]] && ccw(A[t[1]], B[t[1]], B[t[2]]) &&                 angle(B[t[1]], A[t[1]], B[t[2]]) < PI / 2.0 + EPS &&                 good(A[t[1]], A[t[3]], B[t[1]]) &&                 good(A[t[2]], B[t[3]], B[t[2]])) {               return true;             }             swap(A[3], B[3]);           }           swap(A[2], B[2]);         }         swap(A[1], B[1]);       }     } while (next_permutation(t + 1, t + 4));     return false;   }   int main() {     long long ntest;     scanf( %lld , &ntest);     while (ntest--) {       for (long long i = (1), _b = (3); i <= _b; ++i) {         A[i].read();         B[i].read();       }       puts(check() ?  YES  :  NO );     }   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 100000007;   const double eps = 1e-6;   const long long Inf = 1LL << 62;   const long long mod = 1000000007;   const long long pnum = 5761460;   void err(istream_iterator<string> it) {}   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cout << *it <<   =   << a <<   n ;     ;     err(++it, args...);   }   void solve_with_case(int cas) {}   long long maxCalories(vector<vector<long long>> arr, int n, int m) {     vector<vector<long long>> dp1(1005, vector<long long>(1005, 0));     vector<vector<long long>> dp2(1005, vector<long long>(1005, 0));     vector<vector<long long>> dp3(1005, vector<long long>(1005, 0));     vector<vector<long long>> dp4(1005, vector<long long>(1005, 0));     for (int i = (1); i <= (n); i++) {       for (int j = (1); j <= (m); j++) {         dp1[i][j] = arr[i][j] + max(dp1[i - 1][j], dp1[i][j - 1]);       }     }     for (int i = (n); i >= (1); i--) {       for (int j = (m); j >= (1); j--) {         dp2[i][j] = arr[i][j] + max(dp2[i + 1][j], dp2[i][j + 1]);       }     }     for (int i = (n); i >= (1); i--) {       for (int j = (1); j <= (m); j++) {         dp3[i][j] = arr[i][j] + max(dp3[i + 1][j], dp3[i][j - 1]);       }     }     for (int i = (1); i <= (n); i++) {       for (int j = (m); j >= (1); j--) {         dp4[i][j] = arr[i][j] + max(dp4[i - 1][j], dp4[i][j + 1]);       }     }     long long ans = 0;     for (int i = (2); i <= (n - 1); i++) {       for (int j = (2); j <= (m - 1); j++) {         long long ans1 =             dp1[i - 1][j] + dp2[i + 1][j] + dp3[i][j - 1] + dp4[i][j + 1];         long long ans2 =             dp1[i][j - 1] + dp2[i][j + 1] + dp3[i + 1][j] + dp4[i - 1][j];         ans = max({ans, ans1, ans2});       }     }     return ans;   }   void solve_without_case() {     int n, m;     cin >> n >> m;     vector<vector<long long>> arr(1005, vector<long long>(1005, 0));     for (int i = (1); i <= (n); i++) {       for (int j = (1); j <= (m); j++) {         cin >> arr[i][j];       }     }     cout << maxCalories(arr, n, m) <<   n ;     ;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0), cout.tie(0);     solve_without_case();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long M = 1e9 + 7;   double pi = acos(-1.0);   long long powerm(long long x, long long y) {     long long res = 1;     while (y) {       if (y & 1) res = (res * x) % M;       y = y >> 1;       x = (x * x) % M;     }     return res % M;   }   long long power(long long x, long long y) {     long long res = 1;     while (y) {       if (y & 1) res = (res * x);       y = y >> 1;       x = (x * x);     }     return res;   }   long long gcd(long long a, long long b) {     if (b > a) return gcd(b, a);     if (b == 0) return a;     return gcd(b, a % b);   }   const int N = 2e5 + 5;   vector<int> adj[N];   long long a[N];   bool b[N], c[N];   vector<pair<int, int> > pp(N);   long long ans;   void dfs(int u, int par, long long mn) {     if (b[u] == 1 && c[u] == 0)       pp[u].first++;     else if (b[u] == 0 && c[u] == 1)       pp[u].second++;     a[u] = min(a[u], mn);     for (auto it : adj[u]) {       if (it == par) continue;       dfs(it, u, a[u]);       pp[u].first += pp[it].first;       pp[u].second += pp[it].second;     }     long long jj = min(pp[u].first, pp[u].second);     ans += jj * 2 * a[u];     pp[u].first -= jj;     pp[u].second -= jj;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     int n;     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i] >> b[i] >> c[i];     }     for (int i = 0; i < n - 1; i++) {       int u, v;       cin >> u >> v;       adj[u].push_back(v);       adj[v].push_back(u);     }     dfs(1, -1, M);     if (pp[1].first > 0 || pp[1].second > 0)       cout << -1;     else       cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 7e5 + 10;   const int inf = 0x3f3f3f3f;   int n, m, p, q, nx, ny;   long long sum[300][300];   int dis[300][300];   int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};   char maze[300][300];   void bfs(int sx, int sy, long long k) {     dis[sx][sy] = 0, sum[sx][sy] += k;     queue<pair<pair<int, int>, int> > q;     q.push(make_pair(make_pair(sx, sy), k));     while (q.empty() == 0) {       pair<pair<int, int>, int> tmp = q.front();       q.pop();       for (int i = 0; i < 4; i++) {         nx = tmp.first.first + dx[i], ny = tmp.first.second + dy[i];         if (nx >= 1 && nx <= n && ny >= 1 && ny <= m && maze[nx][ny] !=  *  &&             dis[nx][ny] == inf) {           dis[nx][ny] = dis[tmp.first.first][tmp.first.second] + 1;           int res = tmp.second / 2;           if (res <= 0) {             break;           }           sum[nx][ny] += res;           q.push(make_pair(make_pair(nx, ny), res));         }       }     }   }   int main() {     ios_base::sync_with_stdio(false);     cin >> n >> m >> q >> p;     memset(sum, 0, sizeof(sum));     int cnt = 0;     for (int i = 1; i <= n; i++) {       cin >> maze[i] + 1;     }     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (maze[i][j] >=  A  && maze[i][j] <=  Z ) {           memset(dis, inf, sizeof(dis));           bfs(i, j, (maze[i][j] -  A  + 1) * q);         }       }     }     int ans = 0;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (sum[i][j] > p && maze[i][j] !=  * ) {           ans++;         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   bool uin(T &a, T b) {     return a > b ? (a = b, true) : false;   }   template <class T>   bool uax(T &a, T b) {     return a < b ? (a = b, true) : false;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     cout.precision(10);     cout << fixed;     int q;     cin >> q;     while (q--) {       int n;       cin >> n;       vector<vector<int> > occs(n);       for (int i = 0; i < (int)(n); ++i) {         int x;         cin >> x;         --x;         occs[x].push_back(i);       }       int dif = 0;       for (int i = 0; i < (int)(n); ++i)         if (!occs[i].empty()) ++dif;       int ch = 0, maxch = 0, R = -1;       for (int i = 0; i < (int)(n); ++i) {         if (occs[i].empty()) continue;         if (occs[i][0] > R)           ++ch, uax(maxch, ch);         else           ch = 1;         R = occs[i].back();       }       cout << dif - maxch <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1000 * 100 + 50;   vector<long long> nb[MAXN];   long long n, m, k, cmp, sz[MAXN];   bool mrk[MAXN];   long long pw(long long x, long long y) {     if (!y) return 1;     if (y == 1) return x % k;     long long tmp = pw(x, y / 2);     if (y % 2)       return ((tmp * tmp) % k * x) % k;     else       return (tmp * tmp) % k;   }   void dfs(int x) {     if (mrk[x]) return;     mrk[x] = 1;     sz[cmp]++;     for (int i = 0; i < nb[x].size(); i++) dfs(nb[x][i]);   }   int main() {     cin >> n >> m >> k;     for (int i = 0; i < m; i++) {       int tmp1, tmp2;       cin >> tmp1 >> tmp2;       nb[tmp1 - 1].push_back(tmp2 - 1);       nb[tmp2 - 1].push_back(tmp1 - 1);     }     for (int i = 0; i < n; i++) {       if (!mrk[i]) {         dfs(i);         cmp++;       }     }     if (cmp == 1) {       cout << 1 % k << endl;       return 0;     }     long long ans = pw(n, cmp - 2) % k;     for (int i = 0; i < cmp; i++) {       ans *= sz[i];       ans %= k;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   template <class T>   inline void read(T &x) {     x = 0;     int f = 0;     char ch = getchar();     while (!isdigit(ch)) {       f |= ch ==  - ;       ch = getchar();     }     while (isdigit(ch)) {       x = (x << 1) + (x << 3) + (ch ^ 48);       ch = getchar();     }     x = f ? -x : x;     return;   }   int p[100010], siz[100010], find[100010];   int t, n;   bool flag;   int main() {     read(t);     while (t--) {       read(n);       flag = true;       for (int i = 1; i <= n; ++i) read(p[i]);       for (int i = 2; i <= n; ++i) {         if (p[i] - p[i - 1] > 1) {           flag = false;           break;         }       }       puts(flag ?  Yes  :  No );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7, INF = 1e9;   const int mx = 1e5 + 5;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     int n, s, k;     cin >> n >> s;     if (2 * n > s)       cout <<  NO  << endl;     else {       cout <<  YES  << endl;       for (int i = 1; i < n; i++) cout << s / n <<    ;       cout << (s - (s / n) * (n - 1)) << endl;       cout << 1 << endl;     }     return 0;   }