akhauriyash/Code-Regression huggingface dataset:
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes, T no) { cout << (val ? yes : no) << "\n"; }

void say(bool val, string yes = "Yes", string no = "No") { say<string>(val, yes, no); }

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// C++ 17に完全移行したら消す
// 最大公約数を求める
template <class T> T gcd(T n, T m) { return n ? gcd(m % n, n) : m; }

// 最小公倍数を求める
template <class T> T lcm(T n, T m) {
  int g = gcd(n, m);
  return n * m / g;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}


#line 2 "abc170_c.cpp"

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x, n;
  cin >> x >> n;
  vi a(n);
  REP(i, n) { cin >> a[i]; }

  map<int, bool> used;
  REP(i, n) { used[a[i]] = true; }

  int itr = 0;
  while (true) {
    if (used.find(x - itr) == used.end()) {
      cout << x - itr << endl;
      return 0;
    }
    if (used.find(x + itr) == used.end()) {
      cout << x + itr << endl;
      return 0;
    }
    itr++;
  }
}


Measured memory_bytes: 3660
#include <iostream>
using namespace std;
int X, Y, E, x, y;
int PY[1100];
bool V[1100];
bool D[1100][1100] = {};
bool match(int x) {
 if (x<0) return true;
 if (V[x]) return false;
 V[x] = true;
 for (int y=0; y<Y; ++y) {
  if (!D[x][y]) continue;
  if (match(PY[y])) {
   PY[y] = x;
   return true;
  }
 }
 return false;
}

int main() {
 cin >> X >> Y >> E;
 for (int i=0; i<E; ++i) {
  cin >> x >> y;
  D[x][y] = true;
 }
 fill(PY, PY+Y, -1);
 int count = 0;
 for (int x=0; x<X; ++x) {
  fill(V, V+X, false);
  if (match(x)) ++count;
 }
 cout << count << endl;
}


Measured memory_bytes: 1276
#include<iostream>
#include<bitset>
#include<vector>
#include<algorithm>
using namespace std;
int N,H,W,h[10],w[10];
string t[20];
bitset<400>R[10][4];
bool used[10];
int cnt[10];
vector<int>id;
bool dfs(const bitset<400>&F,int I,int rest)
{
	if(rest==0)return true;
	bool flag=true;
	int p;
	while(flag)
	{
		for(int j=0;j<W;j++)if(!F[I*W+j])
		{
			p=j;
			flag=false;
			break;
		}
		I+=flag;
	}
	bitset<400>test=F;
	for(int ii=0;ii<N;ii++)
	{
		int i=id[ii];
		if(used[i])continue;
		for(int r=0;r<4;r++)
		{
			for(int I=0;I<H;I++)
			{
				if(r%2==0&&I+h[i]>H||r%2==1&&I+w[i]>H)break;
				for(int J=0;J<W;J++)
				{
					if(r%2==0&&J+w[i]>W||r%2==1&&J+h[i]>W)break;
					if(!(F&(R[i][r]<<I*W+J)).any())test|=R[i][r]<<I*W+J;
				}
			}
		}
	}
	if(test.count()!=H*W)return false;
	for(int ii=0;ii<N;ii++)
	{
		int i=id[ii];
		if(used[i])continue;
		used[i]=true;
		for(int r=0;r<4;r++)
		{
			if(r%2==0&&I+h[i]>H||r%2==1&&I+w[i]>H)continue;
			for(int J=0;J<=p;J++)
			{
				if(r%2==0&&J+w[i]>W||r%2==1&&J+h[i]>W)break;
				if(!R[i][r][p-J])continue;
				if((F&(R[i][r]<<I*W+J)).any())continue;
				if(dfs(F|(R[i][r]<<I*W+J),I,rest-cnt[i]))return true;
			}
		}
		used[i]=false;
	}
	return false;
}
main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	while(cin>>H>>W,H)
	{
		bitset<400>F;
		for(int i=0;i<H;i++)
		{
			string s;cin>>s;
			for(int j=0;j<W;j++)
			{
				if(s[j]=='#')F[i*W+j]=1;
			}
		}
		cin>>N;
		id.clear();
		for(int i=0;i<N;i++)
		{
			id.push_back(i);
			cin>>h[i]>>w[i];
			for(int r=0;r<4;r++)R[i][r].reset();
			cnt[i]=0;
			for(int j=0;j<h[i];j++)cin>>t[j];
			for(int I=0;I<h[i];I++)for(int J=0;J<w[i];J++)if(t[I][J]=='#')
			{
				cnt[i]+=1;
				R[i][0][I*W+J]=1;
				R[i][1][J*W+(h[i]-I-1)]=1;
				R[i][2][(h[i]-I-1)*W+(w[i]-J-1)]=1;
				R[i][3][(w[i]-J-1)*W+I]=1;
			}
		}
		sort(id.begin(),id.end(),[](int a,int b){return cnt[a]>cnt[b];});
		int p;cin>>p;
		int T=H*W-F.count();
		for(;p--;)
		{
			int k;cin>>k;
			for(int i=0;i<N;i++)used[i]=true;
			int left=T;
			for(;k--;)
			{
				int a;cin>>a;a--;
				used[a]=false;
				left-=cnt[a];
			}
			cout<<(left==0&&dfs(F,0,T)?"YES":"NO")<<endl;
		}
	}
}


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

using namespace std;

int bad[10];
int n,k;

int isbad(int x)
{
	while(x)
	{
		if(bad[x%10]) return 1;
		x/=10;
	}
	return 0;
}

int main()
{
	cin >> n >> k;
	for(int i=0;i<k;i++)
	{
		int x;
		cin >> x;
		bad[x]=1;
	}
	while(isbad(n)) n++;
	cout <<n << endl;
}

Measured memory_bytes: 3568
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

#define DEBUG(x) cout << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<pair<T, T> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

const double PI = 3.14159265358979323846;

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;

	cout << 2 * PI * n << "\n";

	return 0;

}

Measured memory_bytes: 3804
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <set>
#include <cstdio>
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
//#define P pair<int, int>
#define P pair<ll, ll>

#define MOD 1000000007
#define INF 1012345678
#define NINF (-2147483647-1)
#define LLINF 9012337203685477580
using ll = long long;
using namespace std;

//ワーシャルフロイド法
const int MAX_V = 200;
int V; //頂点数
ll d[MAX_V][MAX_V]; //最短距離(INFで初期化,d[i][i]=0,d[i][j]=辺ijのコスト)
void warshall_floyd() {
    for (int k = 0; k < V; k++) {
        for (int i = 0; i < V; i++) {
            for (int j = 0; j < V; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M, R;
    cin >> N >> M >> R;
    V = N;
    vector<int> r(R);
    for (int i = 0; i < R; i++)
    {
        cin >> r[i];
        r[i]--;
    }
    sort(ALL(r));
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (i == j) d[i][j] = 0;
            else d[i][j] = INF;
        }
    }
    for (int i = 0; i < M; i++)
    {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        d[a][b] = d[b][a] = c;
    }
    warshall_floyd();
    ll ans = LLINF;
    do {
        ll tmp = 0;
        for (int i = 0; i < R-1; i++)
        {
            tmp += d[r[i]][r[i + 1]];
        }
        ans = min(ans, tmp);
    } while (next_permutation(ALL(r)));
    cout << ans << endl;
    getchar(); getchar();
}

Measured memory_bytes: 640
#include "bits/stdc++.h"

using namespace std;

constexpr char endl('\n');


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

    size_t x;
    cin >> x;

    size_t n1, n2;
    n1 = x / 500;
    n2 = (x % 500) / 5;

    cout << n1 * 1000 + n2 * 5 << ::endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
const ll maxn = 4.1e3;
ll R_pre[maxn];
ll G_pre[maxn];
ll B_pre[maxn];
int main(){
    ll n;
    cin >> n;
    string s;
    cin >> s;
    s = '0' + s;
    R_pre[0] = G_pre[0] = B_pre[0] = 0;
    for(ll i = 1; i <= n; ++i){
        R_pre[i] = R_pre[i - 1];
        G_pre[i] = G_pre[i - 1];
        B_pre[i] = B_pre[i - 1];
        char c = s[i];
        if(c == 'R'){
            R_pre[i]++;
        }
        else if(c == 'G'){
            G_pre[i]++;
        }
        else{
            B_pre[i]++;
        }
    }
    ll ans = 0;
    for(ll i = 1; i <= n; ++i){
        char c = s[i];
        ll r_sum = R_pre[n] - R_pre[i];
        ll g_sum = G_pre[n] - G_pre[i];
        ll b_sum = B_pre[n] - B_pre[i];
        ll cur_sum;
        if(c == 'R'){
            cur_sum = g_sum * b_sum;
        }
        else if(c == 'G'){
            cur_sum = r_sum * b_sum;
        }
        else{
            cur_sum = r_sum * g_sum;
        }
        ans += cur_sum;
    }
    ll seg_sum = 0;
    for(ll i = 1; i <= n; ++i){
        for(ll j = 1; i + 2 * j <= n; ++j){
            char a, b, c;
            a = s[i], b = s[i + j], c = s[i + 2 * j];
            if(a != b && a != c && b != c){
                seg_sum++;
            }
        }
    }
    cout << ans - seg_sum << endl;
    return 0;
}

Measured memory_bytes: 3704
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main()
{
    string a, b;
    cin >> a >> b;
    a += b;

    int t = stoi(a);

    for (int i = 1; i * i <= t; i++) if (i * i == t) return cout << "Yes" << endl, 0;

    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
// بِسمِ اللہِ  الرَّحم?نِ  الرَّ حِیم
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define MOD 1000000007
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define INF 1e18
#define N 100100
#define PI 3.141592653589793238
typedef pair<ll,ll> pll;
ll power(ll a,ll b)
{
    if(b==1)return a;
    if(b==0)return 1;
    ll temp=power(a,b/2);
    ll ans=temp*temp;
    if(b&1)
        ans*=a;
    return ans;
}
ll power(ll a,ll b,ll p)
{
    a=a%p;
    if(b==1)return a;
    if(b==0)return 1;

    ll temp=power(a,b/2,p);
    ll ans=(temp*temp)%p;
    if(b&1)
        ans=(a*ans)%p;
    return ans%p;
}
ll inv(ll a,ll m)
{
    return power(a,m-2,m);
}
//code begins
void solve(){
    ll n;cin>>n;
    cout<<n+n*n+n*n*n<<endl;
}
signed main()
{
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

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

//    ll t;cin>>t;while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3684
/*   The fool didn't know it was impossible. So he did it.
                    maskman_lucifer                         */
                    
#include <bits/stdc++.h>   
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long 
#define pll pair<ll,ll>
#define pb push_back
#define M 1000000007
#define lc '\n'
using namespace std;
ll a[10000000];
ll dp[10000000];
int main()
{
    IO
    ll k;
    cin>>k;
    if(k%7==0)
    {
        k/=7;
    }
    
    for(ll i=0;i<10000000;i++)
    {
        a[i]=1;
    }
    
    dp[0]=a[0]%k;
    for(ll i=1;i<10000000;i++)
    {
        dp[i]=((10*dp[i-1])+a[i])%k;
    }
    ll ans=-2;
    for(ll i=0;i<10000000;i++)
    {
        if(dp[i]==0)
        {
            ans=i;
            break;
        }
    }
    cout<<ans+1<<lc;
    return 0;
}

Measured memory_bytes: 159824
#include <stdio.h>
#include <stdlib.h>

int main(){
	int N, i, j;
	scanf("%d", &N);
	if(N == 2){
		printf("-1\n");
	}
	else if(N % 2 == 1){
		for(i = 0; i < N; i++){
			for(j = 1; j < N; j++){
				printf("%d ", (i + j) % N + 1);
			}
			printf("\n");
		}
	}
	else{
		int **a = (int **)malloc(sizeof(int *) * N);
		for(i = 0; i < N; i++){
			a[i] = (int *)malloc(sizeof(int) * (N - 1));
		}
		for(i = 0; i < N - 1; i++){
			for(j = 1; j < N - 1; j++){
				a[i][j - 1] = (i + j) % (N - 1) + 1;
			}
			a[i][N - 2] = N;
		}
		a[N - 2][N - 3] = N;
		a[N - 2][N - 2] = N - 2;
		for(j = 0; j < N - 1; j++){
			a[N - 1][j] = j + 1;
		}
		for(i = 0; i < N; i++){
			for(j = 0; j < N - 1; j++){
				printf("%d ", a[i][j]);
			}
			printf("\n");
		}
	}
	return 0;
}

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

#define mod 1000000007
#define ten5 100005
#define ten52 200005
#define ten6 1000005
#define PI 3.1415926

typedef long long int ll;

ll num[ten52];
//ll num[10][10];
//set<ll> sll;

int main(void)
{
    long long int sum=0,range=0,ceiling;
    double ans=0.0,d;
    long long int m,n,o,i,j,k=0,money;
    long long int a,a1=0,a2=0,a3=0,ar,as,at1;
    char c;
    a=a1=a2=a3=0;
    //vector <int> v;
    //float f,g,h;
    //int c,d,big=0;
    string s,s1,s2;
    cin>>n>>k;
    for(i=0;i<n;i++) cin>>num[i];
    for(i=0;i<k;i++)
    {
        sum+=num[i];
    }
    sum+=k;
    a=sum;
    for(i=1;i<=n-k;i++)
    {
        sum+=num[i+k-1]-num[i-1];
        a=max(a,sum);
    }
    if(a%2==0) cout<<a/2;
    else
    {
        cout<<a/2<<".5";
    }
    return 0;
}





Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define inf 1145141919364364
#define double long double
using namespace std;
typedef pair<ll, ll>P;
ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
ll lcm(ll x, ll y) {
	return x * y / gcd(x, y);
}
ll a[114514];
signed main() {
	ll n, ans = 0;
	cin >> n;
	rep(i, n)cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i <= 114514; i++) {
		if (lower_bound(a, a + n, i) - a == n / 2)ans++;
	}
	if (n % 2 == 1)ans = 0;
	cout << ans << endl;
	ggr
}



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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FFOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,b) FOR(i,0,b)
#define RREP(i,b) FFOR(i,1,b)
#define PB push_back
#define F first
#define S second
#define BE(c) c.begin(),c.end()
using namespace std;
typedef long long LL;
typedef LL ut;
typedef long double ld;
typedef pair<ut,ut> pr;
typedef vector<pr> Vpr;
typedef vector<ut> VI;
typedef pair<ut,pr> ppr;
typedef priority_queue<pr,Vpr, greater<pr> > PQ;
const int SIZE=5+3*1e+4;
const ut INF=1<<30;
const ld eps=1e-6;
const LL p=7+1e+9;

int main(){
  int t, n;
  REP(i,4){
    cin >> t >> n;
    if(t == 1){
      cout << n * 6000 << endl;
    }
    else if(t == 2){
      cout << n * 4000 << endl;
    }
    else if(t == 3){
      cout << n * 3000 << endl;
    }
    else{
      cout << n * 2000 << endl;
    }
  }
}

Measured memory_bytes: 1160
import pprint
from itertools import product

N, M = [int(n) for n in input().split()]

A = []
for _ in range(N):
    A.append(list(input()))

B = []
for _ in range(M):
    B.append(list(input()))

found = False
for dx, dy in product(range(N - M + 1), repeat=2):
    found = True
    for x, y in product(range(M), repeat=2):
        if A[dx + x][dy + y] != B[x][y]:
            found = False
            break
    if found:
        break
    
print('Yes' if found else 'No')

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

#include <algorithm>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;

long long mod = 1000000007;

long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t * t;
    } else {
        return modpow(m, n - 1) * m;
    }
}
typedef long long ll;
typedef pair<ll, ll> P;

void yes() {
    cout << "Yes" << endl;
    exit(0);
}
void no() {
    cout << "No" << endl;
    exit(0);
}
#define REP(i, n) for (long long i = 0; i < (n); i++)
vector<long long> dijkstra(vector<vector<pair<long long, long long>>> graph, long long s) {
    vector<long long> ans(graph.size(), -1);
    priority_queue<pair<long long, long long>, vector<pair<long long, long long>>, greater<pair<long long, long long>>>
        pq;
    pq.push({0, s});
    while (pq.size() > 0) {
        ll cur1 = 0;
        ll cur2 = 0;
        if (ans[pq.top().second] != -1) {
            pq.pop();
        } else {
            cur1 = pq.top().first;
            cur2 = pq.top().second;
            pq.pop();
            ans[cur2] = cur1;
            for (long long i = 0; i < graph[cur2].size(); i++) {
                pq.push({cur1 + graph[cur2][i].second, graph[cur2][i].first});
            }
        }
    }
    return ans;
}
signed main() {
    long long n;
    cin >> n;
    vector<int> as(n);
    vector<int> cnt(1e6 + 23);
    REP(i, n) {
        cin >> as[i];
        cnt[as[i]]++;
    }
    sort(as.begin(), as.end());
    int ans = 0;
    REP(i, n) {
        if (cnt[as[i]] > 1) {
            // cout << as[i] << endl;
            continue;
        }
        bool div = false;
        for (int j = 1; (long long)j * j <= as[i]; j++) {
            // cout << as[j] << endl;
            if (as[i] % j == 0 && j != as[i]) {
                if (cnt[j] > 0) {
                    div = true;
                }
                if (cnt[(as[i] / j)] > 0 && as[i] / j != as[i]) {
                    div = true;
                }
            }
        }
        if (div == false) {
            // cout << endl;
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 7940
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

void ABC171C()
{
	ll N;
	cin >> N;
	string x;

	while (N >= 1)
	{
		int d = N % 26;
		--d;
		if (d < 0)
			d += 26;
		x.push_back('a' + d);
		N -= d;
		N /= 26;
	}
	string y(x.rbegin(), x.rend());
	cout << y << endl;
}

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


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
//#include <stack>
#include <climits>
#include <map>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
#define all(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> P;

int n,T;

int main() {
    cin >> n >> T;
    vector<int> c(n);
    vector<int> t(n);
    REP(i,n){
        cin >> c[i] >> t[i];
    }
    int res = INT_MAX;
    REP(i,n){
        if(t[i]<=T){
            res = min(res,c[i]);
        }
    }
    if(res==INT_MAX){
        put("TLE");
    }else{
        put(res);
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

#define N 80

// Longint <- String
int init(int a[], char s[]);
// a <- b + c
int add(int a[], int b[], int c[]);
// print Longint
void print(int a[]);

int main(void){
	int n;
	int a[N], b[N], sum[N];
	char s[101], t[101];
	
	scanf("%d", &n);
	for (int i=0; i<n; i++){
		scanf("%s", s);
		scanf("%s", t);
		if (init(a, s)==-1 || init(b, t)==-1){
			puts("overflow");
			continue;
		}
		if (add(sum, a, b)==-1){
			puts("overflow");
		} else {
			print(sum);
		}
	}
	return 0;
}

// Longint <- String
int init(int a[], char s[]){
	int len=0;
	
	for (int i=0; i<N; i++) a[i] = 0;
	for (char *p=s; *p!='\0'; p++) len++;
	if (len>N) return -1;
	for (int i=0; s[i]!='\0'; i++){
		a[N-len+i] = s[i] - '0';
	}
	return 0;
}
// a <- b + c
int add(int a[], int b[], int c[]){
	int cry=0;
	for (int i=N-1; i>=0; i--){
		a[i] = b[i]+c[i]+cry;
		cry = a[i]/10;
		a[i] %= 10;
	}
	return cry ? -1 : 0;
}

// print Longint
void print(int a[]){
	int i;
	for (i=0; i<N && a[i]==0; i++)
	;
	if (i==N){
		puts("0");
		return;
	} else {
		for (; i<N; i++){
			printf("%d", a[i]);
		}
		puts("");
	}
}

Measured memory_bytes: 1036
/*
 * Author:heroming
 * File:heroming.cpp
 * Time:2017/01/15 07:49:48
 */
#include <vector>
#include <list>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <string>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;

#define px first
#define py second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define clr(v, e) memset(v, e, sizeof(v))
#define rep(it, v) for (auto it : v)
#define forn(i, n) for (int i = 0; i < (n); ++ i)
#define rforn(i, n) for (int i = (n) - 1; i >= 0; -- i)
#define form(i, a, b) for (int i = (a); i <= (b); ++ i)
#define rform(i, a, b) for (int i = (b); i >= (a); -- i)
#define forv(i, v) for (int i = 0; i < sz(v); ++ i)
#define iter(it, v) for (auto it = v.begin(); it != v.end(); ++ it)

typedef long long lint;
typedef vector<int> vint;
typedef vector<string> vstring;
typedef pair<int, int> pint;
typedef vector<lint> vlint;
typedef vector<pint> vpint;

const int maxn = 1000;
const lint mod = 1e9 + 7;

int n;
vint v;

bool prime(const int m) {
    for (int x = 2; x * x <= m; ++ x) {
        if (m % x == 0) return 0;
    }
    return 1;
}

int main() {
    form (i, 2, maxn) {
        if (prime(i)) {
            v.pb(i);
        }
    }
    while (cin >> n) {
        vint s;
        rep (it, v) {
            int m = 1;
            form (i, it, n) {
                int x = i;
                while (x % it == 0) {
                    ++ m;
                    x /= it;
                }
            }
            s.pb(m);
        }
        lint ans = 1;
        rep (it, s) {
            ans = ans * it % mod;
        }
        printf("%lld\n", ans);
    }
    return 0;
}


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

int main() {
  int n;
  cin >> n;

  int tmp = n;
  int s = tmp % 60;
  tmp -= s;
  tmp /= 60;
  int m = tmp % 60;
  tmp /= 60;
  int h = tmp;

  cout << h << ":" << m << ":" << s << endl;
}


Measured memory_bytes: 3104
#include <algorithm>
#include <bitset>
#include <complex>
#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 <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using ll = long long;
#define MAX_N 1000001
#define MAX_M 100010
const long long mod = 1e9 + 7;
#define vec vector<int>
#define vecll vector<ll>
#define vecllvec vector<vector<ll>>
#define vecb vector<bool>
#define vecBvec vector<vector<bool>>
#define vecst vector<string>
#define veche vector<char>
#define vecd vector<double>
#define vecvec vector<vector<int>>
#define vecDvec vector<vector<double>>
#define vecHvec vector<vector<char>>
#define all(x) (x).begin(),(x).end()
#define ent cout<<endl
#define printvec(vec) for(int aqw=0;aqw<vec.size();aqw++){cout<<vec[aqw]<<" ";}ent;
#define rep1(n) for(ll i = 0; i < (n); ++i)
#define rep2(i, n) for(ll i = 0; i < (n); ++i)
#define rep3(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep4(i, a, b, c) for(ll i = (a); i < (b); i += (c))
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; }
#define INF 1e+9
#define print(x) cout<<x<<endl;
using P = pair<int, int>;
#define PLL pair<ll, ll>;
#define MAX_V 1000
#define PI 3.141592653589793
#define vecP vector<P>
// cout << setprecision(15) << std::fixed;


int main() {
	int n,b;
	cin >> n >> b;
	for (int i = 1;i < 4;i++) {
		if (i == n || i == b) continue;
		cout << i << endl;
	}
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
#define two(a) (1<<(a))
#define LINF (1ll<<61)
#define EPS (1e-14)
#define Lshift(a,b) (a<<b)
#define Rshift(a,b) (a>>b)
#define rep(a,b) for(a=0 ; a<b ; a++)
#define xrep(a,b,c) for(a=b ; a<c ; a++)
#define INF (1<<29)
#define swap(a,b) ( (a^=b) , (b^=a) , (a^=b) )
#define GET(x) (mark[x>>5]>>(x&31)&1)
#define SET(x) (mark[x>>5]|=1<<(x&31))
#define maxL (10000000>>5)+1
#define mod 1000000007
#define vi vector<int>
#define pii pair<int, int>
#define mii map<int, int>
#define si set<int>
#define pb push_back
typedef long long ll;
using namespace std;


int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    ll n, k;
    cin >> n >> k;
    ll ans(abs(n - k));
    ans = min(ans, abs(k - abs(k - n)));
    ll nn = n % k;
    ans = min(ans, abs(nn - k));
    if (nn + k <= n) {
        ans = min(ans, nn);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
int main() {
	int n = 0;

	float s=0,x;
	cin >> n;
	vector<int>a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		//cout << (float)1 / a[i] << endl;
		s +=(float) 1 / a[i];
		//cout <<s<< endl;
	}
	x =(float) 1 / s;
	//cout << x << endl;
	printf("%.5f", x);

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

int INF = 1000000001;

int main() {
    int n;
    scanf("%d", &n);
    vector<int> h(n);
    rep(i, n) {
        scanf("%d", &h[i]);
    }
    // int len = 1;
    // vector<int> l(n+1, INF);
    // rep(i, n) {
    //     if (i == 0) {
    //         l[len] = h[i];
    //         continue;
    //     }
    //     if (h[i] <= l[len]) {
    //         len++;
    //         l[len] = h[i];
    //     } else {
    //         int ng = 0, ok = len;
    //         while (ng + 1 < ok) {
    //             int mid = (ng + ok) / 2;
    //             if (h[i] > l[mid]) {
    //                 ok = mid;
    //             } else {
    //                 ng = mid;
    //             }
    //         }
    //         l[ok] = h[i];
    //     }
    // }
    // printf("%d\n", len);
    int cnt = 0, max_c = 0;
    rep(i, n-1) {
        if (h[i] >= h[i+1]) {
            cnt++;
            max_c = max(max_c, cnt);
        } else {
            cnt = 0;
        }
    }
    printf("%d\n", max_c);
}

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

#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define int long long 
#define f(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define ss second
#define ff first
#define ll long long
#define pii pair<int,int>
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define vii vector<pii>
typedef long double ld;
const int N = 1e3+5;
const int INF = 1e9+7;

int32_t main()
{
  IOS;
  int n,t,a;
  cin >> n >> t >> a;
  int h[n+1],ans;
  ld temp;
  for(int i=1;i<=n;i++)
  {
    cin >> h[i];
    ld val = (ld)t -  (ld)h[i]*(0.006);
    if(i==1)
    {
      ans=1;
      temp = abs((ld)a-val);
    }
    else
    {
      if(abs((ld)a-val)<temp)
      {
        temp = abs((ld)a-val);
        ans=i;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include<vector>

using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	int a, i = 1;
	while (1)
	{
		cin >> a;
		if (a == 0)break;
		cout << "Case " << i << ": " << a << endl;
		i++;
	}
	return 0;
}

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

int main(){
  int count = 0, A, B, C, X;
  cin >> A >> B >> C >> X;
  for(int i = 0; i<= A; i++){
    for(int m= 0; m<=B; m++){
      for(int nm= 0; nm<=C; nm++){
        if(500*i + 100*m + 50*nm == X) count+=1;
      }
    }
  }
  cout << count;
  return 0;
}

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

#define int             long long int
#define ld              long double
#define ff              first
#define ss              second
#define mp              make_pair
#define pb              push_back
#define si              set <int>
#define vi              vector <int>
#define pii             pair <int, int>
#define vpii            vector <pii>
#define vpp             vector <pair<int, pii>>
#define mii             map <int, int>
#define mpi             map <pii, int>
#define msi             map < string, int >
#define loop(i,s,e)     for(int i=s;i<e;i++)
#define rloop(i,e,s)    for(int i=e;i>=s;i--)
#define mset(a,f)       memset(a,f,sizeof(a))
#define spi             set <pii>
#define endl            "\n"
#define M               1000000007
#define sz(x)           ((int) x.size())
#define all(p)          p.begin(), p.end()
#define que_max         priority_queue <int>
#define que_min         priority_queue <int, vi, greater<int>>
#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)        for (auto x : a) cout << x << endl;// cout << endl
#define Print(a,x,y)    for (int i=x; i<y; i++) cout<< a[i]<< " "; cout << endl

inline int power(int a, int b)
{
	int x = 1;
	while (b)
	{
		if (b & 1) x *= a;
		a *= a;
		b >>= 1;
	}
	return x;
}

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr (names + 1, ',');
	cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 2e5 + 3;
int cnt[N];



void solve()
{
	int n;
	cin >> n;
	int a[n];
	//mset(cnt,0);
	mii mp;
	loop(i, 0, n)
	{
		int x; cin >> x;
		a[i] = x;
		mp[x]++;
	}
	vi ans;

	int sum = 0;
	for (auto x : mp)
	{
		int num = x.ff;
		int freq = x.ss;

		int add;
		if (freq < 2) add = 0;
		else add = (freq * (freq - 1)) / 2;
		sum += add;
	}
	//bug(sum);
	loop(i, 0, n)
	{
		int temp = sum;
		int freq = mp[a[i]];
		int add;
		if (freq < 2) add = 0;
		else add = (freq * (freq - 1)) / 2;
		temp -= add;
		//bug(temp);
		freq--;
		if (freq < 2) add = 0;
		else add = (freq * (freq - 1)) / 2;
		temp += add;
		ans.pb(temp);


	}

	print(ans);
	return;


}

int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);



	//cout << setprecision(9) << fixed;
	clock_t z = clock();
	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}
	cerr << "Total Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);

	return 0;
}

Measured memory_bytes: 12784
require 'prime'

def factorial(n)
  return 1 if n == 0
  (1..n).inject(1,:*)
end

def nCk(n, k)
  factorial(n) / (factorial(k) * factorial(n - k))
end

n = gets.to_i
factors = factorial(n).prime_division
ans = 0
n1 = factors.size
n3, n5, n15, n25, n75 = 0, 0, 0, 0, 0
factors.each do |f|
  n3 += 1 if f[1] >= 2
  n5 += 1 if f[1] >= 4
  n15 += 1 if f[1] >= 14
  n25 += 1 if f[1] >= 24
  n75 += 1 if f[1] >= 74
end
ans += nCk(n1, (n1 - 75)) if n1 >= 75
ans += (n3 - n5) * ((n5 * (n5 - 1)) / 2) + ((n5 * (n5 - 1) * (n5 - 2)) / 6) * 3 if n3 >= 3 && n5 >= 2
ans += (n5 - n15) * n15 + (n15 * (n15 - 1)) if n5 >= 2 && n15 >= 1
ans += (n3 - n25) * n25 + (n25 * (n25 - 1)) if n3 >= 2 && n25 >= 1
ans += n75
puts ans


Measured memory_bytes: 2044
#include <iostream> 
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
	long long int n,ans=1;
	while(cin>>n){
	for(int i=1;i<=n;i++){
		ans*=i;
	}
	cout<<ans<<endl;
	}
    return 0;
}

Measured memory_bytes: 1156
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <limits>
#include <utility>
#include <vector>

template <typename T> class RadixHeap32 {
public:
	using key_type = std::uint_fast32_t;
	using value_type = std::pair<key_type, T>;
	using reference = value_type &;
	using const_reference = const value_type &;
	using size_type = std::uint_fast32_t;

private:
	static size_type bsr(const key_type x) {
		if (!x)
			return 0;
#ifdef __GNUC__
		return 32 - __builtin_clz(x);
#else
		size_type t = 16;
		for (size_type i = 3; ~i; --i) {
			if (x & ~(((key_type)1 << t) - 1))
				t += (size_type)1 << i;
			else
				t -= (size_type)1 << i;
		}
		if (x & ~(((key_type)1 << t) - 1))
			++t;
		return t;
#endif
	}
	std::vector<value_type> v[33];
	key_type last;
	size_type size_;

public:
	RadixHeap32() : last(0), size_(0) {}
	value_type pop() {
		assert(size_);
		--size_;
		if (v[0].empty()) {
			size_type i = 1;
			while (v[i].empty())
				++i;
			last = std::numeric_limits<key_type>::max();
			for (const auto &d : v[i])
				last = std::min(last, d.first);
			for (const auto &d : v[i])
				v[bsr(last ^ d.first)].push_back(d);
			v[i].clear();
		}
		value_type ret = v[0].back();
		v[0].pop_back();
		return ret;
	}
	void push(const_reference x) {
		assert(last <= x.first);
		++size_;
		v[bsr(x.first ^ last)].push_back(x);
	}
	bool empty() const { return !size_; }
	size_type size() const { return size_; }
};


struct edge {
	int to;
	int cost;
};
#include<iostream>
#include<vector>
#include<limits>
#include<tuple>
int main(void) {
	int k;
	std::cin >> k;
	std::vector<std::vector<edge>> G(k);
	for (int i = 0;i < k;++i) {
		G[i].push_back({ i * 10 % k,0 });
		G[i].push_back({ (i + 1) % k,1 });
	}
	RadixHeap32<int> Q;
	static constexpr int INF = std::numeric_limits<int>::max();
	std::vector<int> d(k, INF);
	Q.push({ 1,1 });
	d[1] = 1;
	int v, c;
	while (!Q.empty()) {
		std::tie(c, v) = Q.pop();
		if (d[v] < c) continue;
		for (const auto &e : G[v]) {
			if (c + e.cost < d[e.to]) {
				d[e.to] = c + e.cost;
				Q.push({ d[e.to],e.to });
			}
		}
	}
	std::cout << d[0] << std::endl;
	return 0;
}

Measured memory_bytes: 8436
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
    using namespace std;
     
    int main(){
      int N,M,X,Y;
      cin >> N >> M >> X >> Y;
      int x[N];
      int y[M];
      for(int i=0;i<N;i++){
       cin >> x[i]; 
      }
      for(int j=0;j<M;j++){
       cin >> y[j]; 
      }
      sort(x,x+N);
      sort(y,y+M);
      if(x[N-1]<y[0] && X<Y && X<y[0] && Y>x[N-1]){
       cout << "No War" << endl; 
      }else{
       cout << "War" << endl; 
      }
      
      
      
      return 0;}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void put(int x){
	if(x<0) {
		putchar('-');
		x*=-1;
	}
	if(x==0) {
		putchar('0');
	}
	int num=0;
	char c[15];
	while(x) {
		c[++num]=(x%10)+48;
		x/=10;
	}
	while(num) {
		putchar(c[num--]);
	}
	putchar('\n');
}
inline void in(int &x){
	char ch=getchar();
	int flag=1;
	while(!(ch>='0'&&ch<='9')) {
		if(ch=='-')
			flag*=-1;
		ch=getchar();
	}
	x=ch-'0';
	ch=getchar();
	while(ch>='0'&&ch<='9') {
		x=((x<<3)+(x<<1))+ch-'0';
		ch=getchar();
	}
	x*=flag;
}
int main(){
    int n,sum;
    in(n);
    if(n%2)sum=n/2+1;else sum=n/2;
    double ans=1.0*sum/n;
    printf("%.10lf\n",ans);
    return 0;
}

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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)


#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////

int main()
{
    FASTIO;

    int H , W , h , w;

    cin >> H >> W;

    cin >>h >> w;


    cout <<(H*W)-((h*W)+((H*w)-(h*w))) << endl;





    return 0;
}



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

using namespace std;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define reppe(i,a,b) for(int i = (int)(a) ; i <= (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repme(i,a,b) for(int i = (int)(a) ; i >= (int)(b) ; --i)

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    const ll MOD = 1e9+7;
    int N; cin >> N;
    vector<ll> T(N); repp(i,0,N) cin >> T[i];
    vector<ll> A(N); repp(i,0,N) cin >> A[i];

    vector<ll> res(N);
    bool can = true;

    res[0] = -T[0];
    repp(i,1,N) {
        can &= T[i] >= T[i-1];
        if (T[i] > T[i-1]) res[i] = -T[i];
        else res[i] = T[i];
    }

    can &= res[N-1] == -A[N-1] || A[N-1] <= res[N-1];
    res[N-1] = -A[0];
    repm(i,N-2,-1) {
        can &= A[i] >= A[i+1];
        if (A[i] > A[i+1]) {
            can &= res[i] == -A[i] || A[i] <= res[i];
            res[i] = -A[i];
        } else res[i] = min(res[i], A[i]);
    }

    ll count = 1;
    repp(i,0,N) {
        if (res[i] < 0) continue;
        count *= res[i];
        count %= MOD;
    }
    if (can) cout << count << endl;
    else cout << 0 << endl;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <functional>

using namespace std;

int main() {
	int n;
	while (cin >> n) {
		if (n == 0) {
			break;
		}
		vector<long long int> p(n);
		vector<long long int> jo(n-1);
		long long int cc = 0;
		long long int ss = 0;
		long long int nn = n;
		for (int i = 0; i < n; i++) {
			cin >> p[i];
			ss += p[i];
		}
		for (int i = 0; i < n-1; i++) {
			cin >> jo[i];
		}
		cc = ss * nn;
		sort(jo.begin(), jo.end(), greater<long long int>());
		for (int i = 0; i < n-1; i++) {
			ss += jo[i];
			nn--;
			cc = max(cc, ss*nn);
		}
		cout << cc << endl;
	}
	return 0;
}

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

long long gcd(long long a,long long b){
  return b ? gcd(b,a%b):a;
}

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

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <queue>
#include <stack>
#include <map>

#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define all(v) (v).begin(), (v).end()
#define MP make_pair

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;
typedef vector<P> vp;

void pp(vi v){
	rep(i, v.size()){
		cout << v[i] << ' ';
	}
	cout << endl;
}

void pp(vector<string> v){
	rep(i, v.size()){
		cout << v[i] << endl;
	}
}

void pp(int (*v)[20], int size = 20){
	rep(i, size){
		rep(j, size){
			cout << v[i][j] << ' ';
		}
		cout << endl;
	}
}

void pp(char (*v)[80], int size = 30){
	rep(i, size){
		rep(j, size){
			cout << v[i][j];
		}
		cout << endl;
	}
}

int day[] = {0, 20, 19, 20, 19, 20, 19, 20, 19, 20, 19};

// 1000年まで
int getyears(int y){
	int cnt = 0;
	FOR(i, y+1, 1000){
		if(i%3 == 0){
			cnt += 20*10;
		}else{
			cnt += 20*10-5;
		}
	}
	return cnt;
}

// 年末まで
int getmonths(int y, int m){
	if(y%3==0){
		return (10-m)*20;
	}else{
		int cnt = 0;
		FOR(i, m+1, 11){
			cnt += day[i];
		}
		return cnt;
	}
}

// 月末まで
int getdays(int y, int m, int d){
	if(y%3 == 0){
		return 20 - d + 1;
	}
	else{
		return day[m] - d + 1;
	}
}

int solve(int y, int m, int d){
	int daycnt = 0;

	daycnt += getyears(y);
	daycnt += getmonths(y, m);
	daycnt += getdays(y, m, d);

	return daycnt;
}

int main(){
//	freopen( "a.out", "w", stdout);
	
	int n;
	cin >> n;
	rep(i, n){
		int y, m, d;
		cin >> y >> m >> d;
		cout << solve(y, m, d) << endl;
	}



	return 0;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
using namespace std;
// my implementation
class dsu{
	private:
	public:
	vector<int> arr;
	vector<int> rank;		
	dsu(int n){
		arr.resize(n+1);
		rank.resize(n+1);
		init();
	}
	void init(){
		for(int i=0;i<arr.size();i++)
		arr[i]=i,rank[i]=1;
	}
	int root(int a){
		while(a!=arr[a]){
			arr[a]=arr[arr[a]];
			a=arr[a];
		}
		return a;
	}
	void unin(int a,int b){
		int x=root(a);
		int y=root(b);
		if(x==y)
		return ;
		if(rank[x]<rank[y]){
			arr[x]=y;
			rank[y]+=rank[x];
		}
		else {
			arr[y]=x;
			rank[x]+=rank[y];
		}
	}
	bool find(int a,int b){
		if(root(a)==root(b))
		return true;
		else return false;
	}
};
int main(){
  	//my new code
	int n,m,a,b;
	cin>>n>>m;
	dsu d(n);
	while(m--){
		cin>>a>>b;
		d.unin(a-1,b-1);
	}
	cout<<*max_element(d.rank.begin(),d.rank.end())<<endl;
}

Measured memory_bytes: 4760
K = int(input())
N = [
    1,
    1,
    1,
    2,
    1,
    2,
    1,
    5,
    2,
    2,
    1,
    5,
    1,
    2,
    1,
    14,
    1,
    5,
    1,
    5,
    2,
    2,
    1,
    15,
    2,
    2,
    5,
    4,
    1,
    4,
    1,
    51,
]
print(N[K - 1])


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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

ll A[200005];
ll B[200005];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    REP(i, N) {
        cin >> A[i];
    }
    ll M;
    cin >> M;
    REP(i, M) {
        cin >> B[i];
    }

    vector<ll> v;
    REP(i, N) {
        auto it = lower_bound(B, B + M, A[i]);
        if (A[i] == *it)
            v.push_back(A[i]);
    }
    REP(i, v.size()) {
        cout << v[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 6568
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
struct node{
    unsigned int key;
    struct node *next;
    struct node *prev;
};
 
typedef struct node * NodePointer;
 
NodePointer nil;
 
NodePointer listSearch(int key){
    NodePointer cur = nil->next;
    while (cur != nil){
        if (key == cur->key){ return cur; }
        cur = cur->next;
    }
    return NULL;
}
 
void init(){
    nil = (NodePointer)malloc(sizeof(struct node));
    nil->next = nil;
    nil->prev = nil;
}
 
void printList(){
    NodePointer cur = nil->next;
    int isf = 1;
    while (1){
        if (cur == nil) break;
        if (isf == 0)  printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
        isf = 0;
    }
    printf("\n");
}
 
void deleteNode(NodePointer t){
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}
 
void deleteFirst(){
    NodePointer t = nil->next;
    if (t == nil) return;
    deleteNode(t);
}
 
void deleteLast(){
    NodePointer t = nil->prev;
    if (t == nil) return;
    deleteNode(t);
}
 
void delete(int key){
    NodePointer t = listSearch(key);
    if (t == NULL)return;
    deleteNode(t);
}
 
 
void insert(int key){
    NodePointer x;
    x = (NodePointer)malloc(sizeof(struct node));
    x->key = key;
 
    x->next=nil->next;
    nil->next->prev = x;
    x->prev = nil;
    nil->next = x;
}
 
int main(){
    int key, n, i;
    int size = 0;
    char com[20];
    int np = 0, nd = 0;
    scanf("%d", &n);
    init();
    for (i = 0; i < n; i++){
        scanf("%s%d", com, &key);
        if (com[0] == 'i') { insert(key); np++; size++; }
        else if (com[0] == 'd') {
            if (strlen(com) > 6){
                if (com[6] == 'F') deleteFirst();
                else if (com[6] == 'L') deleteLast();
            }
            else {
                delete(key); nd++;
            }
            size--;
        }
    }
 
    printList();
    return 0;
}

Measured memory_bytes: 31788
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int a,b,c;

	cin >> a >> b >> c;

	for (int i = min(a,b); i < max(a,b); i++) {
		if (i == c) {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;


}


Measured memory_bytes: 256
#include<bits/stdc++.h>
const double PI=3.14159265358979323846;
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "

int main(void){
    char c;cin.get(c);
    if(c=='C'){co("Rainy");}
    else if(c=='R'){co("Sunny");}
    else if(c=='S'){co("Cloudy");}
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
    int n;
    double H,a;
    int p[1000]={0};
    while(1){
    cin>>n;
    if(n==0) break;
    for(int i=0;i<n;i++){
        cin>>p[i];
        H+=p[i]+0;
    }
    H=H/n;
    for(int i=0;i<n;i++){
        a+=pow(p[i]-H,2)/n;
    }
    cout<<fixed<<setprecision(8)<<sqrt(a)<<endl;
    H=0;
    a=0;
    }
}


Measured memory_bytes: 3272