akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define FI(i, a, b) for (int i = (a); i <= (b); ++i)
#define FD(i, b, a) for (int i = (b); i >= (a); --i)
#define DEBUG(x) cerr << #x << ": " << (x) << endl;

namespace Combine {
using LL = long long;
int inv(LL x, int m) { return x > m ? inv(x % m, m) : x > 1 ? inv(m % x, m) * (m - m / x) % m : x; }
int comod(LL n, LL k, int m = 1e9 + 7) {
  if (k > n) return 0;
  if (k + k > n) return comod(n, n - k, m);
  int num = 1, den = 1;
  for (int i = 1; i <= k; i++) num = num * ((n - i + 1) % m) % m, den = 1LL * den * i % m;
  return 1LL * num * inv(den, m) % m;
}
int lucas(LL n, LL k, int m = 10007) {
  assert(m < 1e5);
  return n || k ? 1LL * lucas(n / m, k / m, m) * comod(n % m, k % m, m) % m : 1;
}
};  // namespace Combine

int solve(const vector<int> &a) {
  int sum = 0, hasone = 0, hastwo = 0;
  for (int i = 0; i < a.size(); ++i) {
    int d = a[i];
    if (d == 1) hasone = 1;
    if (d == 2) hastwo = 1;
    sum += d * Combine::lucas(a.size() - 1, i, 2);
    sum %= 2;
  }
  if (sum == 1) return 1;
  if (hasone || !hastwo) return 0;
  vector<int> b;
  for (auto x: a) b.push_back(x / 2);
  return solve(b) * 2;
}

int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> a;
  for (auto c: s) a.push_back(c - '1');
  cout << solve(a) << endl;
}

Measured memory_bytes: 13048
// Created by Manmeet Singh Parmar
// name of snippet-> temp.sublime-snippet
// path -> sublime text 3/packages/user/temp.sublime-snippet

#include <cmath>
#include <iostream>
using namespace std;

int32_t main()
{
   	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a; 
    cin >> a;
    cout << 2*M_PI*a << '\n';
    return 0;
}

Measured memory_bytes: 3260
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int l,r,a,b,c,d;
	cin>>a>>b>>c>>d;
	l=a+b;
	r=c+d;
	if(l>r)
	cout<<"Left"<<endl;
	else if(l<r)
	cout<<"Right"<<endl;
	else
	cout<<"Balanced"<<endl;
	return 0;
}

Measured memory_bytes: 256
//https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_c
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
const ll LINF = 0x1fffffffffffffff;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}
int main(){ 
  using ld = long double;
  ld eps=1e-14;
  ld a,b,c; cin>>a>>b>>c;
  if (sqrtl(a)+sqrtl(b)-sqrtl(c)<-eps) {
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}
int main_() {
  constexpr double e = std::numeric_limits<double>::epsilon();
#if LOCAL&01
  std::ifstream in("./test/sample-1.in");
  //std::ifstream in("./input.txt");
  std::cin.rdbuf(in.rdbuf());
#else
  cin.tie(0);
  ios::sync_with_stdio(false);
#endif
  ll a,b,c; cin>>a>>b>>c;
  ll tmp=a+b-c;
  long double ld=(long double)tmp+2*sqrtl(a*b); 
  dump(tmp,ld);
  if(ld<0){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int count(const char *s, const char c) {
	int cnt = 0;
	for (; *s != '\0'; s++) {
		if (*s == c) {
			cnt++;
		}
	}
	return cnt;
}

void rm(char *s, const char c) {
	int i;
	for (i = 0; s[i] != '\0'; i++) {
		if (s[i] == c)
			break;
	}
	for (; s[i] != '\0'; i++) {
		s[i] = s[i + 1];
	}
}

int solve(char *data) {
	int i, cnt;
	char m;

	m = '9';
	for (i = 0; data[i] != '\0'; i++) {
		if (data[i] < m) {
			m = data[i];
		}
	}

	cnt = count(data, m);
	if (cnt > 4) {
		return 0;
	}
	for (i = 0; i < cnt; i++) {
		rm(data, m);
	}
	if (cnt == 1 || cnt == 4) {
		if (count(data, m+1) < 1 || count(data, m+2) < 1) {
			return 0;
		}
		rm(data, m+1);
		rm(data, m+2);
	}
	else if (cnt == 2) {
		if (count(data, m+1) < 2 || count(data, m+2) < 2) {
			return 0;
		}
		rm(data, m+1);
		rm(data, m+1);
		rm(data, m+2);
		rm(data, m+2);
	}
	return strlen(data) < 1 ? 1 : solve(data);
}

int main() {
	char data[16], buf[16];
	int n, cnt, pair;
	char answer[19];
	char *p;

	while (scanf("%s ", data) != EOF) {
		data[14] = '\0';
		memset(answer, 0, sizeof(char)*19);
		p = answer;

		for (n = 1; n < 10; n++) {
			data[13] = '0' + n;
			cnt = count(data, data[13]);

			if (cnt > 4) {
				continue;
			}
			for (pair = 1; pair < 10; pair++) {
				if (count(data, '0' + pair) < 2) {
					continue;
				}
				strncpy(buf, data, 16);
				rm(buf, '0' + pair);
				rm(buf, '0' + pair);
				if (solve(buf)) {
					*p = '0' + n;
					++p;
					*p = ' ';
					++p;
					break;
				}
			}
		}
		if (strlen(answer)) {
			*(p - 1) = '\0';
			puts(answer);
		}
		else {
			puts("0");
		}
	}
	return 0;
}

Measured memory_bytes: 532
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

int main(void) {
    int K, X;
    cin >> K >> X;

    cout << (K * 500 >= X ? "Yes" : "No") << endl;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	string s;
	cin >> s;
	bool flag = true;
	for (int i = 0; i < s.size(); ++i)
	{
		if (s[i] == 'C' && flag == true) {
			flag = false;
		}
		if (s[i] == 'F' && flag == false) {
			cout << "Yes" << endl;
			return 0;
		}  
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        if(a<b){
            System.out.println("a < b");
        }else if(a>b){
            System.out.println("a > b");
        }else{
            System.out.println("a == b");
        }
        scanner.close();
    }
}


Measured memory_bytes: 26412
/* まあまあ綺麗に書けた気がする */
#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

#define swap(a, b)    do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while(0)
#define repd(i, a, b) for(typeof(b) i = a; i < (b); ++i)
#define rep(i, n)     repd(i, 0, n)
#define dump(x)       cerr << #x << " = " << (x) << endl
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define YesNo(x)      cout << ((x) ? "Yes" : "No") << endl
#define YESNO(x)      cout << ((x) ? "YES" : "NO") << endl
#define absi(x)       ( ((x) >= 0) ? (x) : (-(x)) )

ll n, m;
vector<vector<ll>> g;
vector<ll> lp;

ll dfs(ll index) {
	if(lp[index] >= 0) return lp[index];
	if(g.at(index).size() == 0) return lp[index] = 0;

	lp[index] = 0;
	rep(i, g.at(index).size()) {
		lp[index] = max(dfs(g[index][i]) + 1, lp[index]);
	}
	return lp[index];
}

int main(int argc, const char* argv[]) {
	cin >> n >> m;
	g = vector<vector<ll>>(n, vector<ll>(0));
	lp = vector<ll>(n, -1);
	rep(i, m) {
		ll x, y;
		cin >> x >> y;
		g.at(x-1).push_back(y-1);
	}

	ll ret = 0;
	rep(i, n) {
		ll tmp = dfs(i);
		ret = max(ret, tmp);
	}

	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 9216
#include <iostream>
#include <cstring>
using namespace std;

#define REP(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

int n,x;
int t[1000000];
bool dp[32][1000002];

bool p[1000002];

void solve(){
  memset(dp,0,sizeof(dp));
  dp[0][0] = true;

  rep(i,n){
    rep(j,x+1){
      if(j < t[i]){
        dp[i+1][j] = dp[i][j];
      }
      else{
        dp[i+1][j] = dp[i][j] || dp[i+1][j-t[i]];
      }
    }
  }

  int i;
  for(i=x;i>0;i--){
    if(p[i] && dp[n][i]){
      break;
    }
  }

  if(i != 0){
    cout<<i<<endl;
  }
  else{
    cout<<"NA\n";
  }
}

int main(){
  memset(p,true,sizeof(p));
  p[0] = p[1] = false;

  for(int i=2;i*i<=1000000;i++){
    if(p[i]){
      for(int j=i+i;j<=1000000;j+=i){
        p[j] = false;
      }
    }
  }

  while(cin>>n>>x,n||x){
    rep(i,n){
      cin>>t[i];
    }
    solve();
  }
}

Measured memory_bytes: 32000
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void pr(A a){cout << a << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for(int j=0;j<N;++j) {}

int main(void) {
  int a;cin>>a;
  string s;cin>>s;
  if(a>=3200) {
    pr(s);
  } else {
    pr("red");
  }
  return 0;
}


Measured memory_bytes: 256
import collections

n=int(input())
a=list(map(int, input().split()))

c = collections.Counter(a)

r = 0
for j in c:
    if c[j] > 1:
        r = int(r + (c[j] * (c[j] - 1) / 2))

tmp = r 
for i in range(n):
    r = int(r - ((c[a[i]] * (c[a[i]] - 1) / 2)) + (((c[a[i]] - 1) * (c[a[i]] - 2) / 2)))
    print(r)
    r = tmp

Measured memory_bytes: 26780
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int n, c[30], s[400][30];
int d[30];
int ans[400];

int score() {
	int res = 0;
	int dd[30];
	for (int i = 1; i <= n; i++) {
		res += s[i][ans[i]];
		d[ans[i]] = i;
		for (int j = 1; j <= 26; j++)res -= c[j] * (i - d[j]);
	}
	return res;
}

signed main() {
	std::random_device rnd;
	cin >> n;
	for (int i = 1; i <= 26; i++)cin >> c[i];
	for (int i = 1; i <= n; i++)for (int j = 1; j <= 26; j++)cin >> s[i][j];
	for (int i = 1; i <= n; i++) {
		int ma = -1000000000, p = 0;
		for (int j = 1; j <= 26; j++) {
			int cnt = 0;
			for (int k = 1; k <= 26; k++)if (j != k)cnt -= c[k] * (i - d[k]);
			cnt += s[i][j];
			if (ma < cnt) {
				ma = cnt;
				p = j;
			}
		}
		ans[i] = p;
		d[p] = i;
	}
	int q = 140000;
	while (q) {
		int x = rnd() % 365 + 1, y = rnd() % 26 + 1;
		int g = ans[x];
		int f = score();
		ans[x] = y;
		if (score() < f) ans[x] = g;
        q--;
	}
	for (int i = 1; i <= n; i++)cout << ans[i] << endl;
    //cout << score() << endl;
}

Measured memory_bytes: 3640
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


def main():
    S = input().strip()
    T = input().strip()
    for i in range(len(S) + 1):
        temp=""
        for j in range(len(S)):
            temp += S[(j+1) % len(S)]
        S=temp
        if T==temp:
            print("Yes")
            return
    print("No")
    return


if __name__ == '__main__':
    main()

Measured memory_bytes: 61164
N=int(input())
S=input()
r=S.count('R')
g=S.count('G')
b=S.count('B')
c=0
for i in range(N):
  for j in range(i+1,N):
    h=2*j-i
    if h>=N:
      break
    if S[i]!=S[j] and S[i]!=S[h] and S[j]!=S[h]:
      c+=1
ans=r*g*b-c
print(ans)

Measured memory_bytes: 9160
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 998244353;
const int N = 1200000;
vector < int > v[N];
int used[N], l[N], t[N], p[N];
int ask(int x){
    cout << "? " << x << endl;
    fflush(stdout);
    string s;
    cin >> s;
    return (s == "Y");
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int res = 0;
    while(1){
        int l = 1;
        if (res != 0) l = 0;
        int r = 10;
        while(r - l > 1){
            int mid = (r + l) / 2;
            if (ask(10 * res + mid)) l = mid; else r = mid;
        }
        if (l == 9){
            int z = 1;
            if (res != 0) z = 0;
            if (ask(100 * res + 10 * z) == 0){
                for (int i = z; i <= 9; i++){
                    if (ask(100 * res + i * 10)){
                        cout << "!" << 10 * res + i;
                        fflush(stdout);
                        return 0;
                    }
                }
            } else{
                if (z == 0){
                    int x = res;
                    while(x < 1e15) x = x * 10;
                    if (ask(x)){
                        cout << "! " << 10 * res;
                        return 0;
                    }
                } else{
                    if (ask(100000000000000000)){
                        cout << "! 1";
                        return 0;
                    }

                }
            }
        }
        res = res * 10 + l;
    }
}


Measured memory_bytes: 29396
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
    if(y % x == 0 && (y / x == 2 || y / x == 4)){
      System.out.println("Yes");
      return;
    }
    while(x > 0){
      if( 4 * x == y){
        System.out.println("Yes");
        return;
      }
      y -= 2;
      x--;
    }
    System.out.println("No");
  }
}

Measured memory_bytes: 35804
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define INF 1000000000

void solve_abc_a() {
	ll x, y, n, k, a, b;
	string s, t;
	// ans = 0;
	string ans = "NG";

	cin >> s >> t;

	rep(i, s.size()) {
		if (s[i] != t[i]) {
			cout << "No\n";
			return;
		}
	}

	if (s.size() + 1 == t.size()) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}

	return;
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed;
	//cout << setprecision(7);

	solve_abc_a();

	return 0;
}

Measured memory_bytes: 3652
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define vi vector<int>
#define printv(v) for(int i = 0;i < v.size();i++)P(v[i]);
#define printt(a,b) cout << a << " " << b << endl; 
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 1, -1 , 0 , 0};
int dy[] = { 0,  0,  1, -1};
int MOD = 1e9 + 7;

void solve() {
    int n;
    cin >> n;
    vi v;
    rep(i,n){
        int a;
        cin >> a;
        v.push_back(a);
    }
    int count = 0;
    while(1){
        bool f = true;
        int streak = 0;
        for(int i = 0;i < n;i++){
            if(v[i] > 0){
                f = false;
                v[i]--;
                streak = 1;
            }else{
                if(streak == 1){
                    count++;
                    streak = 0;
                }
            }
        }
        if(streak == 1)count++;
        if(f)break;
    }
    P(count);
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cmath>

using namespace std;

int main(){
	string S, T;
	cin >> S >> T;
	int lenS = S.size();
	int lenT = T.size();
	queue<string> anslist;
	for(int i = 0; i < lenS-lenT+1; i++){
		string now = S.substr(i, lenT);
		int flag = 1;
		for(int j = 0; j < lenT; j++){
			if(now[j] != '?' && now[j] != T[j]){
				flag = 0;
				break;
			}
		}
		if(flag == 1){
			string ans = S.substr(0, i) + T + S.substr(i+lenT);
			anslist.push(ans);
		}
	}
	int M = anslist.size();
	if(M == 0){
		cout << "UNRESTORABLE" << "\n";
	}
	else{
		string answers[M];
		for(int i = 0; i < M; i++){
			string now = anslist.front();
			anslist.pop();
			for(int j = 0; j < lenS; j++){
				if(now[j] == '?'){
					now.replace(j, 1, "a");
				}
			}
			answers[i] = now;
		}
		sort(answers, answers+M);
		cout << answers[0] << "\n";
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
const ll mod = 1e9 + 7;
ll inv[1000000];
ll FactorialInv[1000000];
ll Factorial[1000000];
ll beki(ll a, ll b){
    if(b == 0){
        return 1;
    }
    ll ans = beki(a, b / 2);
    ans = ans * ans % mod;
    if(b % 2 == 1){
        ans = ans * a % mod;
    }
    return ans;
}
void init_combination(){
    inv[1] = 1;
    FactorialInv[1] = 1;
    Factorial[1] = 1;
    Factorial[0] = 1;
    FactorialInv[0] = 1;
    inv[0] = 1;
    for(int i = 2; i < 1000000; i++){
        inv[i] = beki(i, mod - 2);
        Factorial[i] = Factorial[i - 1] * i % mod;
        FactorialInv[i] = FactorialInv[i - 1] * inv[i] % mod;
    }
}
ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    ll ans = Factorial[a] * FactorialInv[b] % mod;
    ans = ans * FactorialInv[a - b] % mod;
    return ans;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    init_combination();
    ll N, K;
    cin >> N >> K;
    for(ll k = 1; k <= K; k++) {
        ll nowb = K - k;
        ll nowr = N - K - k + 1;
        cerr << nowb << " " << nowr << endl;
        if(min(nowb, nowr) < 0) {
            cout << 0 << endl;
            continue;
        }
        cout << combination(k - 1 + nowb , nowb) * combination(k + nowr , nowr) % mod << endl;
    }
    return 0;
}


Measured memory_bytes: 23680
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		string s=sc.S;
		int n=s.Length;
		var dp=new long[n+1,13];
		dp[0,0]=1;
		for(int i=0;i<n;i++){
			for(int l=0;l<13;l++){
				int lm=(s[i]!='?')?s[i]-'0':9;
					for(int d=s[i]!='?'?lm:0;d<=lm;d++){
						dp[i+1,(l*10+d)%13]+=dp[i,l];
						dp[i+1,(l*10+d)%13]%=mod;
					}
				}
		}
		Console.WriteLine("{0}",dp[n,5]);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}


Measured memory_bytes: 23520
#include <cstdio>

char s[100005];
bool e[26];

int main() {
    scanf("%s", s);
    for (auto c : s) {
        if (c == '\0') break;
        e[c - 'a'] = true;
    }
    for (int i = 0; i < 26; ++ i) {
        if (!e[i]) {
            printf("%c", 'a' + i);
            return 0;
        }
    }
    printf("None");
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int h1, m1, h2, m2, k;
	
	scanf("%d %d %d %d %d", &h1, &m1, &h2, &m2, &k);
	
	int d;
	d = (h2  - h1) * 60;
	
	int e;
	e = m2 - m1;
	
	printf("%d", (d + e) - k);

	return 0;
	
	}


Measured memory_bytes: 3180
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {
			int n = sc.nextInt();
			int x = sc.nextInt();

			if(n == 0 && x == 0) break;

			int count = 0;
			// 重複リスト
			ArrayList<ArrayList<Integer>> duplications = new ArrayList<>();

			for(int i=1; i<=n; i++) {
				// 条件に合う組み合わせを数える
				for(int j=1; j<=n; j++) {
//					if(duplications.indexOf(j) != -1) continue;
					if(j==i) continue;
					for(int y=1; y<=n; y++) {
//						if(duplications.indexOf(y) != -1) continue;
						if(y == j || y == i) continue;
//						System.out.println(i + ", " + j + ", " + y);
						if((i+j+y) == x) {
							// 重複チェック
							Boolean breakFlag = false;
							for(ArrayList<Integer> dup : duplications) {
								if(dup.indexOf(i) != -1 && dup.indexOf(j) != -1 && dup.indexOf(y) != -1) {
//									System.out.println("重複!! : " + i + ", " + j + ", " + y);
									breakFlag = true;
									break;
								}
								if(breakFlag) break;
							}
							if(!breakFlag) {
//								System.out.println(i + ", " + j + ", " + y);
								count++;
								ArrayList<Integer> dup = new ArrayList<>();
								dup.add(i);
								dup.add(j);
								dup.add(y);
								duplications.add(dup);
							}
						}
					}
				}
			}

			System.out.println(count);
		}

		sc.close();

	}

}



Measured memory_bytes: 36036
#include <cstdio>
#include <algorithm>
using namespace std;

typedef long long ll;
int n,a[200000];
ll ps[200000];
const ll INF=1000000000000000000;

int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        ps[i]=i==0?a[0]:ps[i-1]+a[i];
    }
    ll ans=INF;
    for(int x2=1;x2<n-2;x2++){
        int x1=lower_bound(ps,ps+x2,ps[x2]/2)-ps,
            x3=lower_bound(ps+x2+1,ps+n-1,(ps[n-1]+ps[x2])/2)-ps;
        ll diff1=INF,diff3=INF;
        for(int i=x1-1;i<=x1+1;i++)
            if(i>=0&&i<x2)
                diff1=min(diff1,abs(ps[x2]-ps[i]*2));
        for(int i=x3-1;i<=x3+1;i++)
            if(i>x2&&i<n-1)
                diff3=min(diff3,abs(ps[n-1]+ps[x2]-ps[i]*2));
        ll mn=min((ps[x2]-diff1)/2,(ps[n-1]-ps[x2]-diff3)/2),
           mx=max((ps[x2]+diff1)/2,(ps[n-1]-ps[x2]+diff3)/2);
        ans=min(ans,mx-mn);
    }
    printf("%lld\n",ans);
}

Measured memory_bytes: 2560
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
 
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

int main() {
    
    string s;
    cin >> s;
    if(s == "ABC"){
        cout << "ARC";
    } else{
        cout << "ABC";
    }
    return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;    //ボタンの数

  cin >> N;
  vector <int> Botton(N+1);  //次に光るボタンのi(番号)
  for (int i=1; i<=N; i++){
    cin >> Botton.at(i);
  }

  int Ok = -1;   //-1は不可能　正の数はボタンを押した回数
  int I = 1;    //光っているボタンの番号    
  for (int i=1; i<=N; i++){
    if ( Botton.at(I) == 2){
      Ok = i;
      break;
    }
    I = Botton.at(I);
  }
  cout << Ok << endl;    
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;

namespace _164_c
{
    internal class Gacha
    {
        private static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine() ?? throw new InvalidOperationException());

            var dict = new Dictionary<string, int>();

            for (var i = 0; i < n; i++)
            {
                var item = Console.ReadLine();
                if (item == null) return;
                dict[item] = 1;
            }

            Console.WriteLine(dict.Count);
        }
    }
}

Measured memory_bytes: 49700
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 1000000007;

#define M 1000000007

std::vector<ll> fac(400003); //n!(mod M)
std::vector<ll> ifac(400003); //k!^{M-2} (mod M)

//x^n(mod M)d
ll
mpow(ll x, ll n)
{
    ll ans = 1;
    while (n > 0){
        if (n & 1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}

void
cominit()
{
    fac[0] = 1;
    ifac[0] = 1;
    for (ll i = 0; i < 400003; i++){
        fac[i+1] = fac[i] * (i+1) % M; // n! mod M
        ifac[i+1] = ifac[i] * mpow(i+1, M-2) % M; // k!^{M-2} mod M
    }
}


ll
comb(ll a, ll b)  // aCb mod M
{
    if (a == 0 && b == 0) return 1;
    if (a < b || a < 0) return 0;
    ll tmp = ifac[a-b] * ifac[b] % M;
    return tmp * fac[a] % M;
}

inline ll Mcomb(ll n, ll r){ return comb(n + r - 1, n - 1); } // r個をn部屋に分ける

int main() {
    cominit();
    ll n, k;
    cin >> n >> k;
    ll res;
    k = min(n-1, k);
    res = 0;
    for (ll i = 0; i <= k ; ++i) {
        //if (i == 0 && k == 1) continue;
        res += (Mcomb(n-i, i) * comb(n, i)) % M;
        res %= M;
    }
    res = (res + M)%M;
    cout << res << endl;
}


Measured memory_bytes: 6528
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;
use std::iter::FromIterator;

fn main() {
    let cin = stdin();
    let mut scan = Scanner::new(cin.lock());
    let t = scan.read::<usize>();
    for _ in 0..t {
        let a = scan.read::<i64>();
        let b = scan.read::<i64>();
        let c = scan.read::<i64>();
        let d = scan.read::<i64>();
        if a < b {
            println!("No");
        } else if b > d {
            println!("No");
        } else if c >= b {
            println!("Yes");
        } else {
            let g = gcd(b, d);
            println!("{}", if b - g + a % g > c {"No"} else {"Yes"});
        }
    }
}

#[allow(dead_code)]
pub fn gcd(a: i64, b: i64) -> i64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

// region template
#[allow(dead_code)]
fn iu(i: i64) -> usize { i as usize }

#[allow(dead_code)]
fn ui(i: usize) -> i64 { i as i64 }

#[allow(dead_code, deprecated)]
fn join<T: std::fmt::Display>(slice: &[T], sep: &str) -> String {
    let strings = slice.iter().map(|t| format!("{}", t)).collect::<Vec<_>>();
    strings.connect(sep)
}

#[allow(dead_code)]
fn arr<'a, S, T>(n: usize, mut f: S) -> Vec<T> where S: FnMut(usize) -> T + 'a {
    (0..n).map(|i| f(i)).collect::<Vec<T>>()
}

#[allow(dead_code)]
fn alt<S, T>(v: Vec<S>) -> T where T: FromIterator<S> {
    v.into_iter().collect::<T>()
}

#[allow(dead_code)]
fn dup<S, T>(v: &[S]) -> T where T: FromIterator<S>, S: Clone {
    v.iter().cloned().collect::<T>()
}

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }

    fn readn<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect()
    }

    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
// endregion

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define INF 9000000000000000000  //  9.0 * 10^18
#define MOD 1000000007  //  10^9 + 7
#define PAI 3.14159265358979
// ver1.7
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm

signed main() {
  cout << fixed << setprecision(14);
  int s,c;
  cin >> s >> c;
  if(2*s >= c) {
    cout << c/2 << endl;
    return 0;
  }
  int ans = s;
  c -= 2*s;
  ans += c/4;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second
	#define int long long 
	//using namespace std;
	signed main()
	{
		std::ios::sync_with_stdio(false);
		int n;
		cin>>n;
		int sum = 0 ; 
		for(int i=1;i<=n;++i)
		{
			if(i%3!=0 and i%5!=0)
				sum += i ;
		}
		cout<<sum ; 
		return 0;
	}


Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lf long double
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <ll,ll> ii;
typedef vector <ll> vi;
typedef vector <ii> vii;
typedef vector <bool> vb;
typedef vector <vector <ll> > vv;
typedef vector <string> vs;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    cin>>n;
    vs a(n,"");
    for(ll i=0;i<n;i++)
    {
        string s;
        cin>>s;
        sort(s.begin(),s.end());
        a[i]=s;
    }
    sort(a.begin(),a.end());
    ll index=0;
    ll count=0;
    while(index<n)
    {
        ll low=index;
        while(low<n && a[low]==a[index])
        {
            low++;
        }
        ll num=low-index;
        count+=(num)*(num-1)/2;
        index=low;
    }
    cout<<count<<endl;
}


Measured memory_bytes: 5760
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<queue>
using namespace std;

#define maxn 600010
int n,a[maxn];

void maxHeapify(int x){
    int l=2*x;
    int r=2*x+1;
    int largest;

    if(l<=n&&a[l]>a[x])
        largest=l;
    else largest=x;

    if(r<=n&&a[r]>a[largest])
        largest=r;

    if(largest!=x){
        int y=a[largest];
        a[largest]=a[x];
        a[x]=y;
        maxHeapify(largest);
    }
}
void build(){
    for(int i=n/2;i>=1;i--)
        maxHeapify(i);
}

void add(){
    int i,j;
}

int getMin(){
    int i,j;
    return a[1];
}
int main(){
    int i;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>a[i];
    build();
    for(i=1;i<=n;i++)
        cout<<" "<<a[i];
    cout<<endl;
    return 0;
}



Measured memory_bytes: 4964
// 文字列のソート
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
  string s,t; cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end(), greater<char>());
  if(s<t) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin>>n>>s;
  map<char,int>ma;
  rep(i,n)ma[s[i]]++;
  ll res=1;
  ll mod=1e9+7;
  for(auto ci:ma)
  {
    res*=ci.second+1;
    res%=mod;
  }
  cout<<res-1<<endl;
  return 0;

}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
typedef long long int lli;
lli inf = 1e18;

lli gcd(lli a, lli b){
	if(a%b==0) return b;
	return gcd(b,a%b);
}

lli lcm(lli a, lli b){
	return a /gcd(a,b) *b;
}

int main(){
	lli n,m;
	cin >> n >> m;
	vector<lli> a(n);
	for(int i=0; i<n; i++){
		cin >> a[i];
		a[i] /= 2;
	}
	
	lli l = 1;
	for(int i=0; i<n; i++){
		l = lcm(l, a[i]);
		if(l > m){
			cout << 0 << endl;
			return 0;
		}
	}
	for(int i=0; i<n; i++){
		if((l/a[i])%2 == 0){
			cout << 0 << endl;
			return 0;
		}
	}
	lli ans = m/l -m/(2*l);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define pb push_back
#define It set<node>::iterator
#define endl '\n'
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const int maxn=110;


int n,m,cnt,s;
int arr[maxn];

int main(){
	cin>>n>>m;
	for(int i=1;i<=n;++i) cin>>arr[i];
	for(int i=1;i<=n;++i) s+=arr[i];
	double a=(1.0/(4.0*(double)m))*(double)s;
	for(int i=1;i<=n;++i){
		if((double)arr[i]>=a) ++cnt;
	}
	if(cnt>=m) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;


template<int M>
class ModInt {
    int val;

public:
//    constexpr MonInt() : val(0) {}
    constexpr ModInt(long long v) : val(v % M < 0 ? v + M : v) {}

    constexpr explicit operator int() const { return val; }
    constexpr ModInt &operator+=(const ModInt &rhs) {
        if ((val += rhs.val) >= M) val -= M;
        return *this;
    }
    constexpr ModInt &operator-=(const ModInt &rhs) {
        if ((val += M - rhs.val) >= M) val -= M;
        return *this;
    }
    constexpr ModInt &operator*=(const ModInt &rhs) {
        val = (int)(1LL * val * rhs.val % M);
        return *this;
    }
    constexpr ModInt &operator/=(const ModInt &rhs) {
        *this *= rhs.inverse();
        return *this;
    }

    friend constexpr ModInt operator+(ModInt lhs, const ModInt &rhs) { return lhs += rhs; }
    friend constexpr ModInt operator-(ModInt lhs, const ModInt &rhs) { return lhs -= rhs; }
    friend constexpr ModInt operator*(ModInt lhs, const ModInt &rhs) { return lhs *= rhs; }
    friend constexpr ModInt operator/(ModInt lhs, const ModInt &rhs) { return lhs /= rhs; }

    constexpr bool operator==(const ModInt &rhs) const { return val == rhs.val; }
    constexpr bool operator!=(const ModInt &rhs) const { return val != rhs.val; }

    constexpr ModInt inverse() const{
        int a = val, b = M, u = 1, v = 0, t;
        while(b > 0) {
            t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        return ModInt(u);
    }

    constexpr ModInt pow(long long e) const {
        long long a = 1, p = val;
        while (e > 0) {
            if (e & 1) { a = (a * p) % M; e--;}
            else { p = (p * p) % M; e >>= 1;}
        }
        return ModInt(a);
    }

    friend std::ostream &operator<<(std::ostream &os, const ModInt &v) { return os << v.val; }
    friend std::istream &operator>>(std::istream &is, ModInt &v) {
        int x;
        is >> x;
        v = ModInt(x);
        return is;
    }
};


#define int long long
const int INF = 1LL<<60;
const int MOD = 998244353;
using modint = ModInt<MOD>;

signed main() {
    int n;
    cin >> n;
    vector<int> d(n, 0);
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        d[x]++;
        if ((i == 0 && x != 0) || (i != 0 && x == 0)) {
            cout << 0 << "\n";
            return 0;
        }
    }
    modint ans(1);
    for (int i = 1; i < n; i++) {
        for (int j = 0; j < d[i]; j++)
            ans *= d[i - 1];
    }
    cout << ans << "\n";
}


Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <memory.h>
#include <list>
#include <numeric>
#include <functional>
#include <complex>
#include <cassert>
#include <regex>
#include <random>

#define ll long long
#define ld long double
#define ull unsigned ll
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pii pair<int,int> 
#define vi vector<int>
#define vpii vector<pii>
#define vvi vector<vector<int>>
#define forn(it,from,to) for(int (it)=from; (it)<to; (it)++)
const int  Inf = 2 * 1000 * 1000 * 1000;
ll LINF = (ll)4e18;
using namespace std;
#define M_PI       3.14159265358979323846   // pi


int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("sum.in", "r", stdin);
	//freopen("sum.out", "w", stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	string s;
	cin >> s;
	int k;
	cin >> k;
	char x = s[k - 1];
	for (auto &c : s) {
		if (c != x) c = '*';
	}
	cout << s;
 	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if( A == B ){
    if( A == C ){
      cout << "No" << endl;
    } else if( A != C ){
      cout << "Yes" << endl;
    }
  } else if( A != B ){
    if( A == C ){
      cout << "Yes" << endl;
    } else if( A != C ){
      if( B == C ) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } 
  }
  
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define f first
#define s second
int k[31];
int a[31][31];
signed main(){
	ic(n) ic(m)
	rep(0,i,n){
		cin>>k[i];
		rep(0,j,k[i]){
			cin>>a[i][j];
		}
	}
	int ans=0;
	rep(1,i,m+1){
		int sum=0;
		rep(0,j,n){
			rep(0,l,k[j]){
				if(a[j][l]==i)sum++;
			}
		}
		if(sum==n){
			ans++;
		}
	}
	c(ans)
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdint>

int main() {
  intmax_t N;
  scanf("%jd", &N);

  int fN = 0;
  for (intmax_t M = N; M; M /= 10)
    fN += M % 10;

  puts((N % fN > 0)? "No":"Yes");
}

Measured memory_bytes: 256
#include <string>
#include <algorithm>
#include <vector> 
#include <math.h>
#include <iostream>
using namespace std;

int main()
{
	string a;
	cin >> a;
	
	int size = a.size();
	int ma = 0;
	int ans = 0;
	bool flag = false;
	for (int i = 0; i < size; i++) {
		if (a[i] == 'A' || a[i] == 'T' || a[i] == 'C' || a[i] == 'G') {
			ma++;
			if (!flag) {
				flag = true;
			}
		}
		else {
			if (flag) {
				ans = max(ans, ma);
			}
			flag = false;
			ma = 0;
		}

	}
	ans = max(ans, ma);
	
	cout << ans << endl;
	return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define rep(N) for(int i=0;i<N;i++)
#define repj(N) for(int j=0;j<N;j++)
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define For(I,N) for(int I=0;I<N;I++)
#define cinone(N) int N;cin>>N;
#define scanfone(N) int N;cin>>N;
#define cinng(N,M) int N[M];for(int yiuytvnm=0;yiuytvnm<M;yiuytvnm++) cin>>N[yiuytvnm];
#define scanfng(N,M) int N[M];for(int qrwuoiq=0;qrwuoiq<M;qrwuoiq++) scanf("%d",&N[qrwuoiq]);
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
typedef unsigned long long ull;
const int inf=1039074182;
using namespace std;
int dp[100005];
int n;
int a[100005];

int main()
{
//	freopen("input.txt","r",stdin);
	memset(dp,0x3f,sizeof(dp));
	ios_base::sync_with_stdio(false);
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	dp[0]=0;
	for(int i=0;i<n-1;i++)
	{
		dp[i+1]=min(dp[i+1],dp[i]+abs(a[i+1]-a[i]));
		dp[i+2]=min(dp[i+2],dp[i]+abs(a[i+2]-a[i]));
	}
	cout<<dp[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 1024
//
//  main.cpp
//  CompetitiveProgramming
//
//  Created by Yuma Kikuchi on 2018/03/02.
//  Copyright © 2018年 yumarimo. All rights reserved.
//

#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <random>
#include <string>
#include <bitset>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <cstring>
#include <cstdlib>
#include <cctype>

#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPR(i, n) for(int i = n; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define FORR(i, m, n) for(int i = m; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define INF 999999999

using namespace std;

typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

llong pow(int x, int n) {
    llong ans = x;
    if (n == 0) return 1;

    for(int i = 0; i < n - 1; i++) {
        ans *= x;
    }

    return ans;
}

void swap(int *X, int *Y){
    int t = *X; *X = *Y; *Y = t;
}

string toUpper(string s) {
    string t = s;
    REP(i, s.size()) {
        t[i] = toupper(s[i]);
    }
    return t;
}

string toLower(string s) {
    string t = s;
    REP(i, s.size()) {
        t[i] = tolower(s[i]);
    }
    return t;
}

int main() {
    llong n; cin >> n;
    llong N[5] = {0};
    string name;

    bool check[5] = {false};
    int cnt = 0;
    REP(i, n) {
        cin >> name;
        if (name[0] == 'M') {
            N[0]++;
            check[0] = true;
            cnt++;
        } else if (name[0] == 'A') {
            N[1]++;
            check[1] = true;
            cnt++;
        } else if (name[0] == 'R') {
            N[2]++;
            check[2] = true;
            cnt++;
        } else if (name[0] == 'C') {
            N[3]++;
            check[3] = true;
            cnt++;
        } else if (name[0] == 'H') {
            N[4]++;
            check[4] = true;
            cnt++;
        }
    }

    llong ans = 0;

    for (int i = 0; i < 5; ++i) {
        for (int j = i + 1; j < 5; ++j) {
            for (int k = j + 1; k < 5; ++k) {
                ans += N[i] * N[j] * N[k];
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
	int a;
	double ans;
	cin>>a;
	ans=a*2*3.141592;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3788