akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int N;
std::string S;

int main()
{
	in >> N >> S;
	std::string ans(N, '\0');
	char tmp[] = { 'S','W' };
	rep(f, 2)
	{
		rep(s, 2)
		{
			ans[0] = tmp[f];
			ans[N - 1] = tmp[s];
			rep(i, N - 1)
			{
				if (ans[i] == 'S')
				{
					if (S[i] == 'o') ans[i + 1] = ans[(i - 1 + N) % N];
					else ans[i + 1] = (ans[(i - 1 + N) % N] == 'S' ? 'W' : 'S');
				}
				else
				{
					if (S[i] == 'x') ans[i + 1] = ans[(i - 1 + N) % N];
					else ans[i + 1] = (ans[(i - 1 + N) % N] == 'S' ? 'W' : 'S');
				}
			}
			bool flag = true;
			rep(i, N)
			{
				if (ans[i] == 'S')
				{
					if (S[i] == 'o' && ans[(i - 1 + N) % N] != ans[(i + 1) % N]) flag = false;
					if (S[i] == 'x' && ans[(i - 1 + N) % N] == ans[(i + 1) % N]) flag = false;
				}
				else
				{
					if (S[i] == 'o' && ans[(i - 1 + N) % N] == ans[(i + 1) % N]) flag = false;
					if (S[i] == 'x' && ans[(i - 1 + N) % N] != ans[(i + 1) % N]) flag = false;
				}
				if (!flag) break;
			}
			if (flag)
			{
				out << ans << std::endl;
				return 0;
			}
		}
	}
	out << -1 << std::endl;
	return 0;
}


Measured memory_bytes: 512
// AOJ ITP2_1_D: Vector II
// 2018.6.24 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { char id; int t; char x[13]; } BUF;
BUF buf[500005];
int qend[1002];
int *Q[1002];
char a[30];

int main()
{
	int n, q, i, j, t;
	char *p, *r;
	
	fgets(a, 30, stdin);
	n = atoi(a);
	p = a; while (*p >= '0') p++; q = atoi(p+1);
	for (i = 0; i < q; i++) {
		fgets(a, 30, stdin);
		buf[i].id = a[0];
		t = 0, p = a+2;
		while (*p >= '0') t = 10*t + (*p++ & 0xf);
		buf[i].t = t;
		if (a[0] == '0') {
			qend[t]++;
			p++, r = p+1;
			while (*r >= '0') r++; *r = 0;
			strcpy(buf[i].x, p);
		}
	}
	for (i = 0; i < n; i++) if (qend[i] > 0) {
		Q[i] = malloc((qend[i]+3)*sizeof(int)), qend[i] = 0;
	}
	for (i = 0; i < q; i++) {
		t = buf[i].t;
		if (buf[i].id == '0') Q[t][qend[t]++] = i; // pushBack
		else if (buf[i].id == '1') {
			if (qend[t] > 0) {    // dump
				printf(buf[Q[t][0]].x);
				for (j = 1; j < qend[t]; j++)
					putchar(' '), printf(buf[Q[t][j]].x);
			}
			putchar('\n');
		}
		else qend[t] = 0;         // clear
	}
	return 0;
}


Measured memory_bytes: 15368
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def main():
    n, m = na()
    if n <= 1 and m <= 1:
        print(0)
    elif n <= 1:
        print(cmb(m, 2))
    elif m <= 1:
        print(cmb(n, 2))
    else:
        print(cmb(n, 2) + cmb(m, 2))

if __name__ == '__main__':
    main()

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

int i, j, k, it, a, b, c, d, e, f, ansx, ansy;

int main() {
  ios_base::sync_with_stdio(0);

  cin >> a >> b >> c >> d >> e >> f;

  for(i = 0; i <= f / (100 * a); ++i)
    for(j = 0; j <= f / (100 * b); ++j) {
      if(i * 100 * a + j * 100 * b > f) break;
      for(k = 0; k <= f / c; ++k) {
        if(i * 100 * a + j * 100 * b + k * c > f) break;
        for(it = 0; it <= f / d; ++it) {
          if(i * 100 * a + j * 100 * b + k * c + it * d > f) break;

          int currWater = i * 100 * a + j * 100 * b;
          int currSugar = k * c + it * d;
          if((100.0 / e) * currSugar > currWater) continue;
          if(ansx + ansy == 0 || 100.0 * currSugar / (0.0 + currWater + currSugar) > (ansx * 100.0) / (0.0 + ansx + ansy)) {
            ansx = currSugar; ansy = currWater;
          }
        }
      }
    }

  cout << ansy + ansx << ' ' << ansx << '\n';

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;

int main()
{
    int rate, grade;
    cin >> rate;

    if((rate >= 400) && (rate <= 599))
    {
        grade = 8;
    }
    else if ((rate >= 600) && (rate <= 799))
    {
        grade = 7;
    }
    else if ((rate >= 800) && (rate <= 999))
    {
        grade = 6;
    }
    else if ((rate >= 1000) && (rate <= 1199))
    {
        grade = 5;
    }
    else if ((rate >= 1200) && (rate <= 1399))
    {
        grade = 4;
    }
    else if ((rate >= 1400) && (rate <= 1599))
    {
        grade = 3;
    }
    else if ((rate >= 1600) && (rate <= 1799))
    {
        grade = 2;
    }
    else if ((rate >= 1800) && (rate <= 1999))
    {
        grade = 1;
    }

    cout << grade << endl;
}

Measured memory_bytes: 3180
h,w = map(int,input().split())
s = [input() for _ in range(h)]
count = [[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if j>0   and s[i][j-1] == '#': count[i][j] = 1
        if j<w-1 and s[i][j+1] == '#': count[i][j] = 1
        if i>0   and s[i-1][j] == '#': count[i][j] = 1
        if i<h-1 and s[i+1][j] == '#': count[i][j] = 1

ans='Yes'
for row1,row2 in zip(s,count):
    for c1,c2 in zip(row1,row2):
        if c1 == '#' and c2 == 0:
            ans = 'No'
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define INF 999999999
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define Vecpr vector<pair<lli,lli>>
int main() {
  lli A,B,C,D;
  string a,b,c;
  cin >>A>>B;
  Out((A-1)*(B-1));
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
#include <numeric>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i=(a); i<(n); ++i)
#define rrep(i,a,n) for(ll i=(a); i>(n); --i)
#define erep(i,a,n) for(ll i=(a); i<=(n); ++i)
#define rerep(i,a,n) for(ll i=(a); i>=(n); --i)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define sz(x) ((int) x.size())
#define print(X) cout << (X) << endl
#define _ << " " <<
static const ll INF = 1e+9+7;
ll n,m;
str s,t;

int main(){
  while(true){
    int A[1010] = {0};
    cin >> n >> m;
    if (n == 0 && m == 0) break;
    rep(i,0,n) cin >> A[i];

    ll max = 0;
    bool flag = false;
    rep(i,0,n){
      rep(j,i+1,n){
        if(A[i]+A[j] > max && A[i]+A[j] <= m){
          max = A[i]+A[j];
          flag = true;
        }
      }
    }
    if(flag) print(max);
    else print("NONE");
  }




  return 0;
}



Measured memory_bytes: 3004
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <map>
#include <queue>
#define rep(i,n) for (int i=0;i<(n);i++)

using namespace std;


int main() {
	int n;
	cin >> n;
	map<string,int> m;
	for (int i = 0;i < n;i++) {
		string tmp;
		cin >> tmp;
		m[tmp]++;
	}

	//sort(m.rbegin(), m.rend());
	int max = -1;

	for (auto x : m) {
		if (max < m[x.first]) {
			max = x.second;
		}
	}

	for (auto x : m) {
		if (max == x.second) {
			cout << x.first << endl;
		}
	}

	return 0;
}

//BBBBBBBBBBBB
//int main() {
//	int n;
//	cin >> n;
//	vector<int> a(n);
//	for (int i = 0;i < n;i++) {
//		cin >> a[i];
//	}
//
//	for (int i = 0;i < n;i++) {
//		if (a[i] % 2 == 0) {
//			if (a[i] % 3 == 0 || a[i] % 5 == 0) {
//			}
//			else {
//				cout << "DENIED" << endl;
//				return 0;
//			}
//		}
//	}
//
//	cout << "APPROVED" << endl;
//	return 0;
//}

//AAAAAAAAAAAAAAAA
//int main() {
//	int a, b, c;
//	cin >> a >> b >> c;
//
//	if (a != b && b != c && c != a) {
//		cout << "No" << endl;
//	}
//	else if (a == b && b == c) {
//		cout << "No" << endl;
//	}
//	else cout << "Yes" << endl;
//
//	return 0;
//}

Measured memory_bytes: 19176
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(ll i=0;i<n;i++)
const ll INF=1e15;
const ll MOD=1000000007;

int main(){
    ll A,B,C,X,Y;cin>>A>>B>>C>>X>>Y;
    ll ans=INF;
    for(ll i=0;i<=2*max(X,Y);i+=2)ans=min(ans,C*i+max((ll)0,X-i/2)*A+max((ll)0,Y-i/2)*B);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::VecDeque;

fn main() {
    input! {
        N: usize,
        Ps: [i64; N],
    }

    let mut ans = 0;
    for i in 2..N {
        if (Ps[i - 2] < Ps[i - 1] && Ps[i - 1] < Ps[i])
            || (Ps[i] < Ps[i - 1] && Ps[i - 1] < Ps[i - 2])
        {
            ans += 1;
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 2116
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pii = pair<int, int>;
using vi = vector<int>;
using vii = vector<vi>;
using ll = long long;

int main() {
    string s, t;
    cin >> s >> t;

    int ans = 0;
    int cnt = s.size();

    rep (i, cnt) {
        if (s[i] != t[i]) ans++; 
    }

    cout << ans << endl;
}

Measured memory_bytes: 3900
#include<stdio.h>
#define MAX_V 1000000
int prime[MAX_V + 1];
int sum[MAX_V + 1];
int main(){
  int n, i, k;
  prime[0]=prime[1]=0;
  for(i = 2;i <= MAX_V;i++){
    prime[i] = 1;
  }
  for(i=2;i*i<=MAX_V;i++){
    if(prime[i]){
      for(k = 2*i;k <= MAX_V;k += i){
        prime[k] = 0;
      }
    }
  }
  sum[0] = 0;
  for(i = 0;i < MAX_V;i++){
    sum[i+1] = sum[i]+prime[i+1];
  }
  while(scanf("%d", &n) == 1){
    printf("%d\n", sum[n]);
  }
  return 0;
}

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

int main() {

	int n; cin >> n;
	vector<ll> a(n + 1, -1);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	ll ans1 = a[n];
	ll ans2;
	if (ans1 % 2 == 0) {
		ll dist = 10000000000;
		ll tmp;
		tmp = ans1 / 2;
		for (int i = 0; i <= n ; i++) {
			if (chmin(dist, abs(tmp - a[i]))) {
				ans2 = a[i];
			}
		}
	}
	else {
		ll dist1 = 10000000000;
		ll dist2 = 10000000000;
		ll tmp1, tmp2;
		tmp1 = ans1 / 2;
		tmp2 = ans1 / 2 + 1;
		ll res1;
		ll res2;
		for (int i = 0; i <= n; i++) {
			if (chmin(dist1, abs(tmp1 - a[i]))) {
				res1 = a[i];
			}
		}
		for (int i = 0; i <= n; i++) {
			if (chmin(dist2, abs(tmp2 - a[i]))) {
				res2 = a[i];
			}
		}
		if (dist1 < dist2) ans2 = res1;
		else ans2 = res2;
	}
	cout << ans1 << " " << ans2 << endl;
	return 0;
}

Measured memory_bytes: 4060
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const int maxn = 400050;
int n,m;
struct edge{int nxt,v;}e[maxn];
int h[maxn],tot;
inline void add(int x,int y){++tot,e[tot].v=y,e[tot].nxt=h[x],h[x]=tot;}
int siz[maxn],f[maxn],son[maxn],dep[maxn],top[maxn],id[maxn]; 
ll w[maxn],wt[maxn];
int idx=0;
/*------------------------线段树-------------------------*/
#define lson (rt<<1)
#define rson (rt<<1|1)
#define mid ((l+r)>>1)
ll tsum[maxn*4];
ll tadd[maxn*4],len[maxn*4];
inline void pushup(int rt){tsum[rt]=tsum[lson]+tsum[rson];}
inline void updatetag(int rt,ll val){tadd[rt]+=val,tsum[rt]+=(ll)val*len[rt];}//tadd标记表示这里下面两个区间还需要加这么多，但是自己已经加过了 
inline void pushdown(int rt)
{
	if(tadd[rt]==0) return;
	updatetag(lson,tadd[rt]);
	updatetag(rson,tadd[rt]);
	tadd[rt]=0;
}
inline void build(int rt,int l,int r)
{
	if(l==r)
	{
		tsum[rt]=wt[l];
		len[rt]=1;
		return;
	}
	len[rt]=r-l+1;
	build(lson,l,mid);
	build(rson,mid+1,r);
	pushup(rt);
}
inline void modify(int rt,int l,int r,int L,int R,ll value)
{
	if(L<=l && r<=R)
	{
		updatetag(rt,value);
		return;
	}
	pushdown(rt);
	if(L<=mid) modify(lson,l,mid,L,R,value);
	if(R> mid) modify(rson,mid+1,r,L,R,value);
	pushup(rt);
}
inline ll querysum(int rt,int l,int r,int L,int R)
{
	if(L<=l && r<=R) return tsum[rt];
	ll ret=0;
	pushdown(rt);
	if(L<=mid) ret += querysum(lson,l,mid,L,R);
	if(R> mid) ret += querysum(rson,mid+1,r,L,R);
	return ret;
}
/*-------------------------------------------------------*/ 

inline void dfs1(int x,int fa)
{
	siz[x]=1,f[x]=fa,dep[x]=dep[fa]+1;
	for(int i=h[x];i;i=e[i].nxt)
	{
		int v=e[i].v;
		if(v==fa) continue;
		dfs1(v,x);
		siz[x]+=siz[v];
		if(!son[x] || siz[v]>siz[son[x]]) son[x]=v;//求重儿子 
	}
}
inline void dfs2(int x,int topx)
{
	id[x]=++idx;
	wt[idx]=w[x];//按新编号置点权 
	top[x]=topx;//置链头 
	if(!son[x])  return;
	dfs2(son[x],topx);
	for(int i=h[x];i;i=e[i].nxt)
	{
		int v=e[i].v;
		if(v==son[x] || v==f[x]) continue;
		dfs2(v,v);
	}
}
int a,b,c;
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<n;i++)
	{
		scanf("%d%d",&a,&b);
		add(a,b),add(b,a);
	}
	dfs1(1,0);
	dfs2(1,0);
	build(1,1,idx);
	while(m--)
	{
		scanf("%d%d",&b,&c);
		modify(1,1,idx,id[b],id[b]+siz[b]-1,c);
	}
	for(int i=1;i<=n;i++) printf("%d ",querysum(1,1,idx,id[i],id[i]));
}

Measured memory_bytes: 70912
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  if (n == 1)
    cout << "Hello World" << endl;
  else {
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
  }
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
using namespace std;
#define DEBUG(x) cout<<#x<<"="<<x<<endl
#define DEBUG2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl
typedef long long ll;
class Solver{
public:
    void solve(){
        ios::sync_with_stdio(false);
        int N,M;
        cin>>N>>M;
        ll sum=0,ans=0;
        map<ll,ll>preSum;
        for(int u=1;u<=N;u++){
            ll A;
            cin>>A;
            sum+=A;
            ans+=preSum[sum%M];
            if(sum%M==0)ans++;
            preSum[sum%M]++;
        }
        cout<<ans;
    }
};
int main()
{
    // freopen("in.txt","r",stdin);
    (new Solver())->solve();
}

Measured memory_bytes: 4224
/*Author
   SaJiB */

#include<bits/stdc++.h>
using namespace std;


#define pb   push_back
#define fi   first
#define se   second
#define all(x)    x.begin(),x.end()

#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))

typedef long long int ll;
typedef unsigned long long int ull;
const double pi = 2.0*acos(0.0);

ll big_mod(ll BASE, ll POWER, ll MOD){

    if(POWER == 0) return 1;
    else if(POWER %2 ==0){
        ll RESULT = big_mod(BASE,POWER/2,MOD);
        return ((RESULT % MOD)*(RESULT % MOD))% MOD;
    }
    else return ((BASE % MOD)*(big_mod(BASE,POWER-1,MOD)% MOD))% MOD;

}

int main(){

int n,k;
cin>>n>>k;

int a[n];

for(int i = 0 ; i<n;i++) cin>>a[i];

sort(a,a+n);
ll sum = 0;
for(int i = 0 ; i < k ;i++) sum+=a[i];

cout<<sum<<endl;
}



Measured memory_bytes: 3588
#include<stdio.h>
#include<math.h>
int main(){
	int n;
	int q;
	int a[100000];
	long long int y[100000][2];
	for(int i=0;i<100000;i++){
		a[i]=0;
		y[i][1]=0;//x>= notoki
		y[i][0]=0;//ga ans
	}
	scanf("%d %d\n",&n,&q);
	for(int i=0;i<n;i++){
		scanf("%d\n", &a[i]);

	}
	for(int i=n-1; i>=0;i=i-2){
		y[n-1][0]+=a[i];
	}
	y[n-1][1]=(a[n-2]+a[n-3]+2)/2;
	for(int i=1; n-2*i-1>=0;i++){
		y[n-i-1][0]=y[n-i][0]+a[n-i-1]-a[n-2*i-1];
	}
	for(int i=1; n-2*i-3>=0;i++){
		y[n-i-1][1]=(a[n-i-2]+a[n-2*i-3]+2)/2;
	}
	int x=0;
//	int ord=0;
//	int nn=0;
//	while(nn<<=n)
	for(int i=0;i<q;i++){
		scanf("%d\n",&x);
		int min=0;
		int max=n-1;
		int mid=0;
		int count=0;
		while(min!=max&&count<20){
			mid=(min+max)/2;
			if(x>=y[mid][1]){
				min=mid;
			}else{
				max=mid;
			}
			count++;
		}
		if(x>=y[max][1]){
    		printf("%lld\n", y[max][0]);
		}else{
		    printf("%lld\n", y[min][0]);
		}
	}
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int a, b; cin >> a >> b;
  cout << max({a + b, a - b, a * b}) << '\n';
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
using namespace std;
using ll=long long;
#define double long double
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
// using llset=tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,b,a) for(i=b-1;i>=(ll)a;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define eb emplace_back
#define print(v) cout<<v<<endl
#define printyes cout<<"Yes"<<endl
#define printno cout<<"No"<<endl
#define printYES cout<<"YES"<<endl
#define printNO cout<<"NO"<<endl
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
// const ll mod=1000000007;
const ll mod=998244353;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas x,ddatas y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n>0){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

int main(){
  // startupcpp();
  // ll test;cin>>test;while(test--){
  ll i,j,N,S,a,ans=0;
  cin>>N>>S;
  vec v(S+1,0);
  rep(j,N){
    cin>>a;
    ++v[0];
    if(S>=a)(ans+=v[S-a]*(N-j))%=mod;
    bFor(i,S+1,a)(v[i]+=v[i-a])%=mod;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 1000000

int main(){
  int n,i,j,c,count;
  int era[MAX]={1,1};

  for (i=2;i<1000;i++){
    if(!era[i]){
      for (j=i*i;j<MAX;j+=i){
        era[j]=1;
      }
    }
  }

  while(scanf("%d",&n)!=EOF){
    c=0;
    for(i=0;i<=n;i++){
      if(!era[i]){
        c++;
      }
    }
    printf("%d\n",c);
  }
  return 0;
}

Measured memory_bytes: 4508
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		System.out.print(n);
		if( n.charAt(n.length()-1) == 's' ){
			System.out.print('e');
		}
		System.out.println('s');
	}
}

Measured memory_bytes: 26932
from fractions import gcd

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

Measured memory_bytes: 5048
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
    int K;
    cin >> K;
    vector<int> min(K, K);
    min[1] = 1;
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
    pq.push({1, 1});
    while(!pq.empty()) {
        int sum = pq.top().first;
        int now = pq.top().second;
        if (now == 0) break;
        pq.pop();
        if (sum < min[now*10%K]) {
            pq.push({sum, now*10%K});
            min[now*10%K] = sum;
        }
        if (sum + 1 < min[(now+1)%K]) {
            pq.push({sum+1, (now+1)%K});
            min[(now+1)%K] = sum+1;
        }
        
    }
    cout << min[0] << endl;
    
    return 0;
}

Measured memory_bytes: 1276
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
const long long Mod=1e9+7;
int a,b;
long long c[4010][4010];
int main()
{
	for (int i=0;i<=4000;i++)
	{
		c[i][0]=1;
		for (int j=1;j<=i;j++)
		{
			c[i][j]=(c[i-1][j-1]+c[i-1][j])%Mod;
		}
	}
	scanf("%d%d",&a,&b);
	long long ans=a+1;
	for (int i=1;i<b;i++)
	{
		if ((b-i)>a)
		{
			continue;
		}
		for (int j=1;j<=b-i;j++)
		{
			if ((b-i)+(b-i-j)>a)
			{
				continue;
			}
			ans=(ans+c[b-1][i-1]*c[b-i-1][j-1]%Mod*c[a-(b-i+b-i-j)+2][2]%Mod)%Mod;
		}
	}
	printf("%lld\n",ans);
    return 0;
}
//衣带渐宽终不悔。为伊消得人憔悴。
//——柳永《蝶恋花·伫倚危楼风细细》

Measured memory_bytes: 123776
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
using namespace std;
typedef long long ll;

#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 out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

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; }

string S;
bool flag=true;

int main(){
    cin>>S;
    for(int i=0;i<S.size();i+=2){
        if(S[i]=='L')flag=false;
    }
    for(int i=1;i<S.size();i+=2){
        if(S[i]=='R')flag=false;
    }
    if(flag)out("Yes");
    else out("No");
    
}


Measured memory_bytes: 256
#define pie 3.14159265358979323846
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
  long double a,b,h,m;
  cin>>a>>b>>h>>m;
  long double hr = 30*h;
  long double min = 6*m;
  hr+=min/12;
  long double deg = abs(hr-min);
  deg = (deg*pie)/180;
  long double angle = cos(deg);
  long double sqra = a*a;
  long double sqrb = b*b;
  long double ans = sqrt(sqra+sqrb-2*a*b*angle);
  cout<<fixed<<showpoint;
  cout<<setprecision(20);
  cout<<ans<<endl;
  
  
  
  
  
  
  
  
  
return 0;  
}


Measured memory_bytes: 4088
# A  以上 B 以下の整数のうち、回文数となるものの個数を求めてください。
# ただし、回文数とは、先頭に 0 をつけない 10 進表記を文字列として見たとき、
# 前から読んでも後ろから読んでも同じ文字列となるような正の整数のことを指します。

input = gets.chomp.split
a = input[0].to_i
b = input[1].to_i

count = 0
i = a
while i <= b
  i = i.to_s

  if i == i.reverse
    count += 1
  end

  i = i.to_i
  i += 1
end

puts count


Measured memory_bytes: 1788
#include<iostream>
#include<algorithm>
using namespace std;

long long gcd(long long n, long long m)
{
    if(n % m == 0) return m;
    return gcd(m, n % m);
}

long long lcm(long long n, long long m)
{
    long long k = min(n, m);
    n = max(n, m);
    m = k;
    return n / gcd(n, m) * m;
}

int main()
{
    int n;
    long long t, ans;
    cin >> n >> t;
    ans = t;
    for(int i = 1; i < n; i++){
        cin >> t;
        ans = lcm(ans, t);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// NK
#include <bits/stdc++.h>
using namespace std;
#define ii pair<int,int>
#define ll long long
#define vi vector<int>
#define vii vector<ii>
#define vll vector<ll>
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define psf push_front
#define pof pop_front
#define mkp make_pair
#define mkt make_tuple
#define all(x) x.begin(), x.end()

int main(){
	ios::sync_with_stdio(false), cin.tie(nullptr);
	ll n; cin>>n;
	vll g[n];
	
	for (ll i=0; i<n; i++){
		for (ll j=0; j<3; j++){
			ll hp; cin>>hp;
			g[i].eb(hp);
		}
	}

	ll dp[n][3];
	memset(dp, -1, sizeof dp);
	for (ll i=0; i<3; i++)
		dp[0][i] = g[0][i];

	for (ll i=1; i<n; i++){
		for (ll j=0; j<3; j++){
			for (ll bef=0; bef<3; bef++){
				if (bef==j) continue;
				dp[i][j] = max(dp[i][j], g[i][j] + dp[i-1][bef]);
			}
		}
	}

	ll ans=-1;
	for (ll i=0; i<3; i++)
		ans=max(ans, dp[n-1][i]);

	cout<<ans<<endl;
	
	return 0;
}


Measured memory_bytes: 9600
N = int(input())
S = [input() for _ in range(N)]

M = len([S[i] for i in range(N) if S[i][0] == "M"])
A = len([S[i] for i in range(N) if S[i][0] == "A"])
R = len([S[i] for i in range(N) if S[i][0] == "R"])
C = len([S[i] for i in range(N) if S[i][0] == "C"])
H = len([S[i] for i in range(N) if S[i][0] == "H"])

print(M*A*R + M*A*C + M*A*H + M*R*C + M*R*H + M*C*H + A*R*C + A*R*H + A*C*H + R*C*H)

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  ll N, M;
  cin >> N >> M;
  vector<vector<pair<ll, ll>>> G(N);

  ll L, R, D;
  for(ll i = 0; i < M; i++){
    cin >> L >> R >> D;
    L--;
    R--;
    G[L].push_back(make_pair(R, D));
    G[R].push_back(make_pair(L, -D));
  }

  bool ans = true;

  vector<ll> d(N);
  vector<bool> visit(N);
  for(int i = 0; i < N; i++){
    d[i] = -1;
    visit[i] = false;
  }

  for(ll i = 0; i < N; i++){

    if(visit[i] == false){
      queue<ll> que;      
      que.push(i);
      d[i] = 0;

      while(!que.empty()){
        ll cur = que.front();
        que.pop();

        for(ll j = 0; j < G[cur].size(); j++){
          
          if(visit[G[cur][j].first] == true){
            if(d[G[cur][j].first] != d[cur] + G[cur][j].second){
              ans = false;
              break;
            }
          }else{
            d[G[cur][j].first] = d[cur] + G[cur][j].second;
            visit[G[cur][j].first] = true;
            que.push(G[cur][j].first);
          }
        }
      }
    }
  }

  if(ans){
    cout << "Yes" << endl;
  }else{
    cout <<"No" << endl;
  }

  return 0;
}


Measured memory_bytes: 14080
#include <iostream>
#include <cstdio>
using namespace std;

int n;
int a[1000000];

long long insertionSort(int a[], int n, int g, long long cnt) {
	for (int i = g;i < n;i++) {
		int v = a[i];
		int j = i - g;
		while (j >= 0 && v < a[j])
		{
			a[j + g] = a[j];
			j -= g;
			cnt++;
		}

		a[j + g] = v;
	}

	return cnt;
}


void shellSort(int a[], int n) {
	int idx = 0, m;
	long long cnt = 0;
	int g[20];

	g[0] = 1;
	while (g[idx] <= n) {
		g[++idx] = 3 * g[idx - 1] + 1;
	}

	m = idx;
	cout << m << endl;

	for (int i = idx - 1;0 <= i;i--) {
		cnt = insertionSort(a, n, g[i], cnt);
		cout << g[i];
		if (i == 0) cout << endl;
		else cout << " ";
	}

	cout << cnt << endl;
	for (int i = 0;i < n;i++) {
		cout << a[i] << endl;
	}
}


int main()
{
	cin >> n;

	for (int i = 0;i < n;i++) scanf("%d", &a[i]);

	shellSort(a, n);
    return 0;
}



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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

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

const ll INF = 1e15;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

class UnionFind{
private:
  vector<ll> Parent; 
 public:
  UnionFind(ll N){
    Parent = vector<ll>(N, -1);
  }
  
  ll root(ll A){
    if(Parent[A] < 0) return A;
    return Parent[A] = root(Parent[A]);
  }
  
  ll size(ll A){
    return -Parent[root(A)]; 
  }
  
  bool connect(ll A, ll B){
    A = root(A);
    B = root(B);
    if(A == B){
      return false;
    }
    if(size(A) < size(B)) swap(A, B);
    Parent[A] += Parent[B];
    Parent[B] = A;
    return true;
  }
  
  bool isSame(ll A, ll B){
    return root(A) == root(B);
  }
};

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n,m; cin>>n>>m;
  vll a(n);
  rep(i,n) cin>>a[i], a[i]--;
  UnionFind uf(n);
  rep(i,m){
    ll x,y; cin>>x>>y; x--,y--;
    uf.connect(x,y);
  }
  ll ans=0;
  rep(i,n){
    if(uf.isSame(i,a[i])) ans++;
  }
  cout<<ans<<endl;
}

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

short bits[200005][34];
int bitSum[34];
short bits2[200005][34];

void fillBits(int pos, int Ai)
{
	for(int i = 0; i < 34; i++)
	{
		int lastBit = Ai & 1;
		bits[pos][i] = lastBit;
		bitSum[i] += lastBit;
		Ai >>= 1;
	}
}

int main()
{
	int N;
	scanf("%d", &N);
	
	for(int i = 0; i < N; i++)
	{
		int Ai;
		scanf("%d", &Ai);
		fillBits(i, Ai);
	}
	
	for(int i = 0; i < N; i++)
	{
		long long int values = 0, power = 1;
		for(int j = 0; j < 34; j++)
		{
			int numOnes = bitSum[j] - bits[i][j];
			bits2[i][j] = numOnes % 2;
			
			values += power * bits2[i][j];
			power *= 2;
		}
		
		printf("%lld ", values);
	}
}


Measured memory_bytes: 30316
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

int n,m,q;
vvi a;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m>>q;
	n--;
	a=vvi(m,vi(n,-1));
	for(int i=0;i<q;i++){
		int A,B,C;
		cin>>A>>B>>C;
		a[A-1][B-1]=C;
	}
	int S=1<<n;
	vi dp(S),c(S);
	vvp b(S);
	dp[0]++;
	int sum=0;
	for(int i=1;i<S;i++){
		vi b_;
		if(i&1) b_.push_back(0);
		for(int j=0;j<n-1;j++) if(i&1<<(j+1)&&!(i&1<<j)) b_.push_back(j);
		c[i]=b_.size();
		b[i]=vp(1<<c[i]);
		for(int j=0;j<1<<c[i];j++){
			int T=i,t=-1;
			for(int k=0;k<c[i];k++) if(j&1<<k) T-=1<<b_[k],t*=-1;
			b[i][j]={T,t};
		}
	}
	for(int i=0;i<m;i++){
		vi DP(S);
		for(int j=0;j<S;j++){
			DP[j]=dp[j];
			for(int k=1;k<1<<c[j];k++){
				int T=b[j][k].first,t=b[j][k].second;
				if(t==1) (DP[j]+=DP[T])%=mod;
				else DP[j]=(DP[j]-DP[T]+mod)%mod;
			}
		}
		for(int j=0;j<S;j++) for(int k=0;k<n;k++) if(a[i][k]!=-1&&(j>>(n-k-1))%2!=a[i][k]) DP[j]=0;
		dp=DP;
	}
	int res=0;
	for(int i=0;i<S;i++) (res+=dp[i])%=mod;
	cout<<res<<endl;
}

Measured memory_bytes: 205692
#include<iostream>
using namespace std;
int main()
{
    long long a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a>b) swap(a,b);
    if(c>d) swap(c,d);
    cout<<max(a*c,max(b*d,max(a*d,b*c)));
}


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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout << #x" = " << x << endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define INF INT_MAX/3

int main(){
    cin.sync_with_stdio(false);
    ll x, y;
    cin >> x >> y;
    if (abs(x - y) <= 1) cout << "Brown" << endl;
    else cout << "Alice" << endl;
    return 0;
}

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

int main(void){
    int x,n_500,n_5;
    cin >> x;

    n_500 = x / 500;
    n_5 = ( x - 500 * n_500 ) /5;

    cout << 1000 * n_500 + 5 * n_5 << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
	int k, s,ans=0;
	cin >> k >> s;
	for (int i = 0; i <= k; i++) {
		for (int j = 0; j <= k; j++) {
			if ((i + j) >= (s-k) && (i + j) <= s) {
				ans++;
			}
		}
	}
	cout << ans << endl;
}


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

#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll IINF = INT_MAX;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll a, b;
    cin >> a;
    double tb;
    cin >> tb;
    b = round(tb * 100);
    a *= b;
    a /= 100;
    cout << a << '\n';
    return 0;
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S,T;
  cin >> S >> T;
  bool a = true;
  
  for(int i = 0; i < S.size(); i++){
    if(S.at(i) != T.at(i)) a = false;
  }
  
  if(a) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include<ctype.h>

int main(int argc, char const *argv[])
{
	char ch;
	int counter[26];
	int i;
	for(i = 0; i < 26; i++) {
		counter[i] = 0;
	}

	while(scanf("%c", &ch) != EOF) {

		if (isalpha(ch)) {
			int num = tolower(ch) - 'a';
			counter[num]++;
		}
	}

	for (i = 0; i < 26; i++) {
		printf("%c : %d\n", i + 'a', counter[i]);
	}

	return 0;
}


Measured memory_bytes: 2124
#include <bits/stdc++.h>
using namespace std ;
///CHECKING @Tanvir
#define ft first
#define sd second
#define pb push_back
#define all(x) x.begin(),x.end()

#define ll long long int
#define vi vector<int>
#define vii vector<pair<int,int> >
#define pii pair<int,int>
#define piii pair<int, pii>
#define mp make_pair


#define f_in(st) freopen(st,"r",stdin)
#define f_out(st) freopen(st,"w",stdout)

#define fr(i, a, b) for(int i=a; i<=b; i++)
#define fb(i, a, b) for(int i=a; i>=b; i--)
#define ASST(x, l, r) assert( x <= r && x >= l )

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define IO ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0)


const int mod = 1e9 + 7;

int ADD(int a, int b, int m = mod) {
    int s = a;
    s += b;
    if( s >= m )
      s -= m;
    return s;
}

int MUL(int a, int b, int m = mod) {
    return (1LL * a * b % m);
}

int power(int a, int b, int m = mod) {
    int res = 1;
    while( b ) {
        if( b & 1 ) {
            res = 1LL * res * a % m;
        }
        a = 1LL * a * a % m;
        b /= 2;
    }
    return res;
}


const int maxn = 1e5 + 5;

bool isPrime(int n)
{
    // Corner case
    if (n <= 3)
        return true;


    for (int i = 2; i*i <= n; i++)
        if (n % i == 0)
            return false;

    return true;
}


int main()
{
    IO;
    int x;
    cin>>x;
    while(x){
        if(isPrime(x)){
            cout<<x<<"\n";
            break;
        }
        x++;
    }


    return 0;
}

/*********************************************






********************************************/


Measured memory_bytes: 256
#!/usr/bin/env python3
#ABC111 C

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
v = LI()
s,t = [],[]
for i in range(n):
    if i % 2:
        t.append(v[i])
    else:
        s.append(v[i])
s = list(Counter(s).items())
s.sort(key = itemgetter(1),reverse = True)
t = list(Counter(t).items())
t.sort(key = itemgetter(1),reverse = True)
m = min(len(s),len(t))
for i in range(m):
    a,b = s[i]
    c,d = t[i]
    if a != c:
        print((n//2 - b)+(n//2 - d))
        quit()
    elif a == c:
        if i + 1 < len(s) - 1:
            tmp1 = s[i+1][1]
        else:
            tmp1 = 0
        if i + 1 < len(t) - 1:
            tmp2 = t[i+1][1]
        else:
            tmp2 = 0
        print(min(((n//2 - b) + (n//2 - tmp2),((n//2 - d) + (n//2 - tmp1)))))
        quit()


Measured memory_bytes: 64272
import sys
sys.setrecursionlimit(100000)
n,m=map(int,input().split())
class UnionFind(object):
    def __init__(self, N):
        self.parent = [i for i in range(N)]
 
    def merge(self, a, b):
        pa = self.root(a)
        pb = self.root(b)
        self.parent[pa] = pb
    
    def root(self, x):
        p = self.parent[x]
        if p == x:
            return x
        else:
            r = self.root(p)
            self.parent[x] = r
            return r
u=UnionFind(n)
for i in range(m):
  a,b,c=map(int,input().split())
  if a>b:
    a=g
    g=b
    b=a
  u.merge(a-1,b-1)
a=[0]*n
for i in range(n):
  a[i]=u.root(i)
print(len(set(a)))


Measured memory_bytes: 32424
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
typedef pair<int,int> pii;

int stoi(string s){
	int num=0;
	rep(i,s.size()){
		num+=(int)(s[i]-'0')*pow(10,s.size()-1-i);
	}
	return num;
}

pii make(string s){
	string temp="";
	int num,cnt=1;
	rep(i,s.size()){
		if(s[i]==','){num=stoi(temp);break;}
		temp+=s[i];
	}
	return pii(num,cnt);
}

int main(){
	string s;
	int num=0,cnt,now=0;
	bool check=false;
	vector<pii> vec[2];
	while(getline(cin,s)){
		if(s==""){now=1;continue;}
		pii data=make(s);
		vec[now].push_back(data);
		num=0;
	}
	map<int,int> mp;
	rep(i,vec[0].size()){
		if(mp.find(vec[0][i].first)!=mp.end())mp[vec[0][i].first]+=vec[0][i].second;
		else mp[vec[0][i].first]=vec[0][i].second;
	}
	set<int> st;
	vector<int> kokyaku;
	rep(i,vec[1].size()){
		if(mp.find(vec[1][i].first)!=mp.end()){
			st.insert(vec[1][i].first);
			mp[vec[1][i].first]+=vec[1][i].second;
		}
	}
	for(set<int>::iterator ite=st.begin();ite!=st.end();ite++){
		kokyaku.push_back(*ite);
	}
	sort(kokyaku.begin(),kokyaku.end());
	rep(i,kokyaku.size()){
		cout<<kokyaku[i]<<" "<<mp[kokyaku[i]]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1252
#include <bits/stdc++.h>
/**
*   author: j o s e m a g o
*   date:
**/
using namespace std;
#pragma GCC optimize ("Ofast")
#define f first
#define s second
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define mset(a,v) memset(a,v,sizeof(a))
#define pb push_back
#define sz(x) ((int)(x).size())
#define rsz resize
#define ln "\n"

typedef double db;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
const ld PI = 2*acos(0.0);
const int MOD = 1000000007;







int main(){

  //freopen("input.in","r",stdin);
  //freopen("input.out","w",stdout);

    ios_base::sync_with_stdio(0); cin.tie(0);


    ld L;
    cin >> L;
    ld u = L/3;

    cout<<fixed<<setprecision(12)<<u*u*u;









    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
    int N,f,n;
    string hex,nona;
    cin>>N;
    int min=N;
    f=N/9;
    for(int i=0;i<=f;i++){
        int sum=0;
        n=i*9;
        while(n>0){
            sum+=n%9;
            n/=9;
        }
        n=N-i*9;
        while(n>0){
            sum+=n%6;
            n/=6;
        }
        if(sum<min){
            min=sum;
        }
    }
    cout<<min<<endl;
    return 0;
}


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

#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

#define int long long
using namespace std;
const int INF = 2e16;
const int MOD = 1e9 + 7;
const int MB = 20;
const int K = 500;
const int maxN = 50;

int goX[] = { 1, 0, -1, 0 };
int goY[] = { 0, -1, 0, 1 };

int get(int x, int y, vector<string>& a, int n, int m) {
	vector<vector<int>> dp(n, vector<int>(m, -1));
	queue<pair<int, int>> q;
	q.push({x, y} );
	dp[x][y] = 0;
	while (!q.empty()) {
		auto p = q.front();
		q.pop();
		x = p.first;
		y = p.second;
		for (int i = 0; i < 4; i++) {
			int one = x + goX[i];
			int two = y + goY[i];
			if (one >= 0 && two >= 0 && one < n && two < m && a[one][two] == '.' && dp[one][two] == -1) {
				dp[one][two] = dp[x][y] + 1;
				q.push({one, two} );
			}
		}
	}

	int mx = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			mx = max(dp[i][j], mx);
		}
	}
	return mx;
}

void solve() {
	int n, m;
	cin >> n >> m;
	vector<string> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	int ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (a[i][j] == '.') ans = max(ans, get(i, j, a, n, m));
		}
	}
	cout << ans;
}

signed main() {
	/*
	freopen("search.in", "r", stdin);
	freopen("search.out", "w", stdout);
	*/
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout << fixed;
	cout.precision(12);
	solve();
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
typedef long long ll;
typedef unsigned long long ull;

int hikaku(char s[],char t[],int i)
{
    int ret=0;
    for(int j=0;j<strlen(t);j++)
    {
        if(s[i+j]!=t[j])
        {
            ret=ret+1;
        }
    }
    return ret;
}


int main()
{
    char s[5000],t[5000];
    scanf("%s %s",s,t);

    int ans=5000;
    
    for(int i=0;i<strlen(s)-strlen(t)+1;i++)
{
        if(ans>hikaku(s,t,i))
        {
            ans=hikaku(s,t,i);
        }
    }

    printf("%d\n",ans);

    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-7;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

ll w, h, v, t, x, y, p, q, r;

bool check(ll a, ll b)
{
	ld dist = pow((x - a), 2) + pow((y - b), 2);
	return r*r - dist > -EPS;
}

ll bsu(ll d, ll i)
{
	ll ub = 1111111, lb = -1;
	while (ub - lb > 1)
	{
		ll mid = (ub + lb) / 2;
		ll ty = 2 * mid * h + d;
		if (check(i, ty)) lb = mid;
		else ub = mid;
	}
	return lb + 1;
}

ll bsd(ll d, ll i)
{
	ll ub = 1111111, lb = -1;
	while (ub - lb > 1)
	{
		ll mid = (ub + lb) / 2;
		ll ty = - 2 * mid * h + d;
		if (check(i, ty)) lb = mid;
		else ub = mid;
	}
	return lb + 1;
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	cin >> w >> h >> v >> t >> x >> y >> p >> q;
	r = v * t;
	ll ans = 0;
	FOR(i, x - r, x + r + 1)
	{
		if ((i - p) % (2 * w) && (i + p) % (2 * w)) continue;
		ll tmp = (bsu(q, i) + bsd(q - 2 * h, i)) + (bsu(2 * h - q, i) + bsd(-q, i));
		ans += tmp;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3184
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;

int main(){

    int n; cin >> n;

    long long cnt = 0;
    vector<pair<int, int>> v;
    if(n%2 == 1){
        for(int i=1; i<=n-1; i++){
            for(int j=i+1; j<=n; j++){
                if(i + j != n){
                    cnt++;
                    v.push_back(make_pair(i, j));
                }
            }
        }
    }
    else{
        for(int i=1; i<=n-1; i++){
            for(int j=i+1; j<=n; j++){
                if(i + j != n + 1){
                    cnt++;
                    v.push_back(make_pair(i, j));
                }
            }
        }
    }

    cout << cnt << endl;
    for(int i=0; i<v.size(); i++){
        cout << v[i].first << " " << v[i].second << endl;
    }

    return 0;
}

Measured memory_bytes: 384