akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;
using ll = long long;
const int MX = 100010;
ll f[MX],inv[MX],fi[MX],mod,inv2[MX],inv3[MX];
void inverse(){
    inv[1] = 1;
    for(int i=2;i<MX;i++){
        inv[i] = mod - (mod/i)*inv[mod%i]%mod;
    }
   f[0] = 1; f[1] = 1; fi[0] = 1;fi[1] = 1;
    for(int i=2;i<MX;i++){
        f[i] = f[i-1]*i%mod;
        fi[i] = fi[i-1]*inv[i]%mod;
    }
    inv2[0] = 1; inv3[0] = 1;
    for(int i=1;i<MX;i++){
        inv2[i] = inv2[i - 1]*inv[2]%mod;
        inv3[i] = inv3[i - 1]*inv[3]%mod;
    }
}

ll nck(ll n, ll k){
    if(n<k) return 0;
    if(k==0) return 1;
    return f[n]*fi[k]%mod*fi[n-k]%mod;
}

ll solve2(ll n){
    return f[2*n]*fi[n]%mod*inv2[n]%mod;
}
ll solve3(ll n){
    return f[3*n]*fi[n]%mod*inv3[n]%mod;
}
int main(){
    int i,j,n;
    cin >> n >> mod;
    inverse();
    ll ans = 0;
    for(i=0;i<=n;i++){
        for(j=0;j<=n - i;j++){
            (ans += nck(3*n,3*i)*nck(3*n - 3*i,2*j)%mod*solve3(i)%mod*solve2(j)%mod) %= mod;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 4096
#include <stdio.h>

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

	scanf("%d %d %d",&a,&b,&c);

	if (a < b)
		if (b < c)
			printf("Yes\n");
		else
			printf("No\n");
	else
		printf("No\n");

	return 0;
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	int ans=0;
	for(int i=1;i<=2;i++){
		if(a>b){
			ans+=a;
			a--;
		}
		else {
		ans+=b;
		b--;
		}
		
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
import static java.lang.Math.*;
import static java.util.Arrays.*;

import java.util.*;
import java.io.*;

public class Main {
	
	String[] key = {" ", ".,!? ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int T = sc.nextInt();
		for(int t=0;t<T;t++) {
			String str = sc.next();
			int n = str.length();
			int k = str.charAt(0) - '0', p = 0;
			for(int i=1;i<n;i++) {
				if( str.charAt(i-1) == str.charAt(i) ) p = (p+1)%key[k].length();
				else {
					if( str.charAt(i) - '0' == 0 ) System.out.print(key[k].charAt(p)); 
					k = str.charAt(i) - '0';
					p = 0;
				}
			}
			System.out.println();
		}
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

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

int main(){
	int i, a, b;
	int a_times_b=0, b_times_a=0, forward_string;
	cin >> a >> b;
	
	// 整数作成
	for(i=0;i<b;i++){
		a_times_b += a*pow(10,i);
	}
	for(i=0;i<a;i++){
		b_times_a += b*pow(10,i);
	}
	
	// 辞書順に比べる．
	if(a == b){
		forward_string = a_times_b;
	}else if(a<b){
		forward_string = a_times_b;
	}else{
		forward_string = b_times_a;
	}
	 cout << forward_string << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
map<pair<string, string>, int>M;
vector<pair<string, string>>vec;
int n, m;
int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		vector<string>W; int a; cin >> a;
		for (int j = 0; j < a; j++) {
			string WW; cin >> WW; W.push_back(WW);
		}
		sort(W.begin(), W.end());
		for (int j = 0; j < W.size(); j++) {
			for (int k = j + 1; k < W.size(); k++) {
				if (M[make_pair(W[j], W[k])] == 0)vec.push_back(make_pair(W[j], W[k]));
				M[make_pair(W[j], W[k])]++;
			}
		}
	}
	sort(vec.begin(), vec.end());
	int cnt = 0;
	for (int i = 0; i < vec.size(); i++) {
		if (M[make_pair(vec[i].first, vec[i].second)] >= m)cnt++;
	}
	cout << cnt << endl;
	for (int i = 0; i < vec.size(); i++) {
		if (M[make_pair(vec[i].first, vec[i].second)] >= m) {
			cout << vec[i].first << ' ' << vec[i].second << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3536
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    s = int(input())

    for i in range(1,10):
        a = s % i
        b = s // i

        if a == 0 and b < 10:
            print("Yes")
            break
        if i ==9:
            print("No")
            break



Measured memory_bytes: 3956
#include <bits/stdc++.h>
#include <stack>
using namespace std;
int main(void){
    int A,B,K;
    cin >> A >> B >> K;
    stack<int> P;
    for(int i = 1; i <= 123; i++){
        if(A%i==0 && B%i == 0) P.push(i);
    }
    while(K != 1){
        P.pop();
        K--;
    }
    cout << P.top() << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cmath>

#define repd(i,a,b); for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define ll long long int
 
 
using namespace std;
int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if (c<(a-b)){
    cout << 0;
  } else {
  cout << c-(a-b);
  }
 
 return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
	int i, j = 0, a, r[2];
	bool s[30] = {false};
	for (i = 0; i < 28; i++)
	{
		cin >> a;
		s[a-1] = true;
	}
	for (i = 0; i < 30; i++)
	{
		if (!s[i])
		{
			r[j] = i+1;
			j++;
		}
	}
	if (r[0] > r[1])
		cout << r[1] << endl << r[0] << endl;
	else
		cout << r[0] << endl << r[1] << endl;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
//#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
//#include <stdlib.h>
//#include <cctype>

using namespace std;

const int MAX_N = 1000000;
#define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define prec std::cout << std::fixed << std::setprecision(15);
#define endl "\n"
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define rep(i,n) for (int i=0; i < int(n); i++)
#define ssort(z) sort(z.begin(),z.end())
#define rsort(z) sort(z.rbegin(),z.rend())
#define eerase(z) z.erase(unique(z.begin(),z.end()),z.end())
#define ccnt(z,w) count(z.begin(),z.end(),w)


void printVec(std::vector<int> & vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	cout << '\n';
}
void printVec1(std::vector<string>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	cout << '\n';
}
void printVec2(std::vector<Int>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	cout << '\n';
}

Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a / gcd(a, b) * b;
	//a*bは64bit integer overflow
}

bool integer(double num) {
	return floor(num) == num;
}

Int fact(int num) {
	if (num == 0) return 1;
	else return num * fact(num - 1);
}


int main() {
	IOS;
	int h, w; cin >> h;
	cout << 3 * h * h << endl;

	cout << endl;
	return 0;
}

/*
テレビも無ェ ラジオも無ェ
自動車もそれほど走って無ェ
ピアノも無ェ バーも無ェ
巡査 毎日ぐーるぐる
朝起ぎで 牛連れで
二時間ちょっとの散歩道
電話も無ェ 瓦斯も無ェ
バスは一日一度来る
俺らこんな村いやだ 俺らこんな村いやだ
東京へ出るだ 東京へ出だなら
銭コァ貯めで 東京でベコ(牛)飼うだ
*/


Measured memory_bytes: 256
from sys import stdin
import sys
import numpy as np
import collections
from functools import cmp_to_key
import heapq

##  input functions for me
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def rip(sep = ''):
    if sep == '' :
        return map(int, input().split()) 
    else: return map(int, input().split(sep))
def ria(sep = ''): 
    return list(rip(sep))
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##

def inv(v, mod):
    return pow(v, mod-2, mod)
def main():
    r1, c1, r2, c2 = rip()

    MM = int(2e6+10)
    fact = [0] * MM
    finv = [0] * MM
    fact[0] = 1
    finv[0] = 1
    mod = int(1e9) + 7
    for i in range(1,MM): fact[i] = (fact[i-1] * i % mod)
    finv[MM-1] = inv(fact[MM-1], mod)
    for i in reversed(range(1,MM-1)):
        finv[i] = finv[i + 1] * (i + 1) % mod
    def sum_naive(r, c):
        #[0, r) * [0, c)
        ret = 0
        for i in range(r):
            ret += fact[i + 1 + c - 1] * finv[i + 1] * finv[c - 1] % mod
        return ret
    def sum(r, c):
        #[0, r) * [0, c)
        ret = fact[r + c] * finv[r] * finv[c] % mod
        ret += -1 + mod
        ret %= mod
        return ret

    ans = 0
    ans += sum(r2 + 1, c2 + 1)
    ans -= sum(r2 + 1, c1)
    ans -= sum(r1, c2 + 1)
    ans += sum(r1, c1)
    ans %= mod
    print(ans)



if __name__ == "__main__":
    main()


Measured memory_bytes: 170280
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;

int N, A, B, C;
int l[10] = {0};

//uを4進数で見たときの右からn桁目の値 (nは0から)
int getDigit4(int u, int n){
	int v = u;
	int ret = v % 4;
	for(int i = 0; i < n; i++){
		v = v / 4;
		ret = v % 4;
	}
	return ret;
}

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N >> A >> B >> C;
	for(int i = 0; i < N; i++){
		int u;
		cin >> u ;
		l[i] = u;
	}

	int ans = 1000000000;
	for(int e = 0; e < 65536; e++){ // 4**8 = 65536
		int a = 0, b = 0, c = 0, d = 0;
		int s = 0, t = 0, u = 0;
		for(int i = 0; i < N; i++){
			int k = getDigit4(e, i);
			if(k == 0){ //Aを構成する竹にする
				a++;
				s += l[i];
			}
			else if(k == 1){ //Bを構成する竹にする
				b++;
				t += l[i];
			}
			else if(k == 2){ //Cを構成する竹にする
				c++;
				u += l[i];
			}
			else if(k == 3){ //それ以外
				d++;
			}
		}
		if(s == 0 || t == 0 || u == 0){ continue; }
		int mp2 = max(a - 1, 0) * 10 ; //合成魔法のmpは10
		mp2 += max(b - 1, 0) * 10;
		mp2 += max(c - 1, 0) * 10;
		mp2 = mp2 + abs(s - A) + abs(t - B) + abs(u - C);
		if(mp2 < ans){ ans = mp2; }
	}
	cout << ans << endl ;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep
#define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for
#define rfor(i,a,b) for(int (i) = (b) - 1; (i) >= (a); --(i)) //Reversi for
#define ll long long
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define yes cout << "yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;
#define no cout << "no" << endl;

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int desc(const void *a, const void *b) {
    return *(int *)b - *(int *)a;
}

int main()
{
    ll s,a[1000001];
    cin >> s;
    a[0] = s;
    for (int i = 1;; ++i) {
        if (a[i - 1] % 2 == 0) {
            a[i] = a[i - 1] / 2;
        }else{
            a[i] = a[i - 1] * 3 + 1;
        }
        rep(j, i){
            if (a[i] == a[j]) {
                cout << i + 1 << endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.next();
		//String t = sc.next();
		//String g = sc.next();
		long n = sc.nextLong();
		long m = sc.nextLong();
		//long k = sc.nextLong();
		//long l = sc.nextLong();
		//long count=0;

		/*for(int i=1;i<=n;i++) {

		}*/
		if(n+m>=n-m && n+m>=n*m) {
			System.out.println(n+m);
		}else if(n-m>=n+m && n-m>=n*m){
			System.out.println(n-m);
		}else {
			System.out.println(n*m);
		}
		//System.out.println((int)Math.ceil((n+m)/2.0));
		//System.out.println(s.substring(0,1)+t.substring(1,2)+g.substring(2,3));
	}
}




Measured memory_bytes: 22608
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP1(i, n) for (int i = 1; i < n + 1; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
using p = pair<int, int>;
using P = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;

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;
}
// 入力
int n;
long long h[100010];

// DP テーブル
long long dp[100010][3];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    long long a[100010][3];
    REP(i, n)
    {
        REP(j, 3)
        {
            cin >> a[i][j];
        }
    }
    REP(i, 100010)
    {
        REP(j, 3)
        {
            REP(k, 3)
            {
                if (j == k)
                    continue;

                chmax(dp[i + 1][k], dp[i][j] + a[i][k]);
            }
        }
    }
    long long res = 0;
    REP(i, 3)
    {
        chmax(res, dp[n][i]);
    }
    cout << res << endl;
}


Measured memory_bytes: 8280
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll n,k,x,sum=0,m=1e18;
    cin>>n>>k;
    ll a[n];
    for(int i=1;i<=n;i++)
    {
        //cin>>x;
        a[i-1]=k+i-1;
        sum+=a[i-1];
    }

for(int i=0;i<n;i++)
{
    m=min(m,abs(a[i]));
}
if(sum<0)
cout<<sum+m;
else
 cout<<sum-m;
    
    return 0;
    
}


Measured memory_bytes: 508
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,num,ans;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int num;
        scanf("%d",&num);
        while(num%2==0&&num!=0)
        {
            num/=2;ans++;
        }
    }
    printf("%d",ans);
}

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

#define Solved int main()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define forn(i, n) for(int i = 1; i <= n; i++)
#define rep(i, x, y) for(int i = x; i <= y; i++)
#define sz(x) (int)x.size()
#define pii pair<int, int>
#define ll long long
#define ull unsigned long long
#define ld long double
#define mii map<int, int>
#define all(x) x.begin(), x.end()
using namespace std;

inline ll bip(ll x,ll n,ll mod){ll res=1;while(n){if(n&1){res=(res*x)%mod;}x=(x*x)%mod;n>>=1;}return res;}

const int maxn = 1e9;
const ll inf = 1e18;
const int mod = 998244353;
//const int mod = 1e9 + 7;
const int N = 1e5 + 10;

int n, a[N], b[N], c[N], dp[N][4];

void solve() {
    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> a[i] >> b[i] >> c[i];

    dp[1][1] = a[1], dp[1][2] = b[1], dp[1][3] = c[1];
    for (int i = 2; i <= n; i++) {
        dp[i][1] = a[i] + max(dp[i - 1][2], dp[i - 1][3]);
        dp[i][2] = b[i] + max(dp[i - 1][1], dp[i - 1][3]);
        dp[i][3] = c[i] + max(dp[i - 1][2], dp[i - 1][1]);
    }

    cout << max({dp[n][1], dp[n][2], dp[n][3]});
}

Solved {
    SpeedForce;
	int tt = 1;
    //cin >> tt;
	while (tt--) {
		solve();
		cout << '\n';
	}

}


Measured memory_bytes: 2944
using System;

namespace CA { 
    class Program {
        static void Main(string[] args) {
			string[] str = Console.ReadLine().Split(' ');
			int count = 0;
			for(int i = int.Parse(str[0]); i <= int.Parse(str[1]); i++) {
				if (int.Parse(str[2]) % i == 0)
					count++;
			}
			Console.WriteLine(count);
        }
    }
}

Measured memory_bytes: 9148
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long long p[210000];
long long sum[210000];
long long z[210000];
int bit[210000];
int Sum(int a,int b){
	if(a)return Sum(0,b)-Sum(0,a-1);
	int ret=0;
	for(;b>=0;b=(b&(b+1))-1)ret+=bit[b];
	return ret;
}
void add(int a,int b){
	for(;a<210000;a|=a+1)bit[a]+=b;
}
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++){
		scanf("%lld",p+i);
		p[i]-=b;
		sum[i+1]=sum[i]+p[i];
	}
	for(int i=0;i<=a;i++)z[i]=sum[i];
	std::sort(z,z+a+1);
	long long ret=0;
	add(lower_bound(z,z+a+1,0)-z,1);
	for(int i=1;i<=a;i++){
		ret+=Sum(0,lower_bound(z,z+a+1,sum[i])-z);
		add(lower_bound(z,z+a+1,sum[i])-z,1);
	}
	printf("%lld\n",ret);
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
#define INF 1e9
typedef long long ll;
#define N_MAX 509
int X[N_MAX][N_MAX], C[N_MAX][N_MAX];

int main(void){
  int N,M,Q;cin >> N >> M >> Q;
  int i,j;
  REP(i,M){
    int x,y;
    cin >> x >> y; X[x][y]++;
  }
  for(i=1;i<=N;i++){
    for(j=1;j<=N;j++) C[i][j] = C[i][j-1]+X[i][j];
  }
  vector<int> ans;
  REP(j,Q){
    int l,r;cin >> l >> r;
    int sum = 0;
    for(i=l;i<=r;i++) sum += C[i][r] - C[i][l-1];
    ans.push_back(sum);
  }
  REP(i,ans.size()) cout << ans[i] << endl;
  return 0;
}


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

int main() {
    unsigned long long a,b,x;
    cin >> a >> b >> x;
    unsigned long long  aa,bb;
    bb = b/x + 1;
    if(a > 0) aa = (a-1)/x + 1;
    else aa = 0;
    cout << bb-aa << endl;
}

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

int main()
{
  ll n,a,b; cin>>n>>a>>b;

  if ((b-a)%2 == 0) {
    cout << (b-a)/2 << endl;
  } else {
    if (a-1 < n-b) {
      ll x = a-1;
      a -= x;
      b -= x+1;
      cout << x+1+(b-a)/2 << endl;
    } else {
      ll x = n-b;
      a += x+1;
      b += x;
      cout << x+1+(b-a)/2 << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 768
#include <iostream>

using namespace std;

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;

  int ans = 0;
  for (int a = 0; a <= A; ++a) {
    for (int b = 0; b <= B; ++b) {
      for (int c = 0; c <= C; ++c) {
        if (X == 500 * a + 100 * b + 50 * c) {
          ++ans;
        }
      }
    }
  }

  cout << ans << endl;

  return 0;
}


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

int main() {
  int k;
  string s;
  cin >> k >> s;
  
  string s2 = "...";
  if(k < s.size()){
    s.erase(k);
    s += s2;
  }
  cout << s << endl;
}



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

int main() {
	ll n;
	cin >> n;
	ll ans = 0;
	ll i = 1;
	while (i <= sqrt(n)) {
		if (n % i == 0) {
			ll b = n / i - 1;
			if (i < b)ans+= b;
		}
		i++;
	}
	cout << ans << endl;
}

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

using namespace std;

#define pb push_back
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define all(x) (x).begin(),(x).end()
#define F(i,x,n,y) for(i=x;i<n;i+=y)
#define fi(i,x,n) for(i=x;i<n;++i)
#define f(n) for(int i=0;i<n;++i)
#define fr(i,x,n) for(i=x;i>=n;--i)
#define endl '\n'

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

int part[100010];
int tmp[100010];

#define MAXN 100000
#define operacion(x, y) x+y
#define tipo ll
const int neutro=0;
struct RMQ{
	int sz;
	tipo t[4*MAXN];
	tipo &operator[](int p){return t[sz+p];}
	void init(int n){//O(nlgn)
		sz = 1 << (32-__builtin_clz(n));
		for(int i=0; i<2*sz;++i)
			t[i]=neutro;
	}
	void updall(){//O(n)
		for(int i=sz-1; i>=0;--i)
			t[i]=operacion(t[2*i], t[2*i+1]);
	}
	tipo get(int i, int j){return get(i,j,1,0,sz);} // [i,j) !
	tipo get(int i, int j, int n, int a, int b){//O(lgn)
		if(j<=a || i>=b) return neutro;
		if(i<=a && b<=j) return t[n];
		int c=(a+b)/2;
		return operacion(get(i, j, 2*n, a, c), get(i, j, 2*n+1, c, b));
	}
	void set(int p, tipo val){//O(lgn)
		for(p+=sz; p>0 && t[p]!=val;){
			t[p]=val;
			p/=2;
			val=operacion(t[p*2], t[p*2+1]);
		}
	}
};


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    vector<ll> a,b,c;
    ll x;
    cin>>n;
    f(n){
        cin>>x;
        a.pb(x);
    }
    f(n){
        cin>>x;
        b.pb(x);
    }
    f(n){
        cin>>x;
        c.pb(x);
    }
    sort(all(a));
    sort(all(b));
    sort(all(c));
    int i=0;
    RMQ tree;
    tree.init(n);
    for(auto val:b){
        int l=lower_bound(all(a),val)-a.begin();
        tree[i]=l;
       ++i;
    }
    tree.updall();
    ll ans=0;
    for(auto val:c){
        int l=lower_bound(all(b),val)-b.begin();
        auto xxx=tree.get(0,l);
        ans+=xxx;
    }
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 5748
a=int(input())
b=int(input())
c=int(input())
x=int(input())

cnt=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if (x-i*500-j*100-k*50)==0:
                cnt = cnt+1
print(cnt)

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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define repr(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = 1e9 + 100;
const long long LLINF = 2e18 + 129;
const long long MOD = 1e9 + 7;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

long long power(long long x, long long n){
    long long res = 1;
    x %= MOD;
    while(n > 0LL){
        if(n & 1LL){
            res *= x;
            res %= MOD;
        }
        x *= x;
        x %= MOD;
        n >>= 1;
    }
    return res;
}

long long nCr(long long n, long long r){
    r = min(r, n - r);
    if(r < 0LL){
        return 0LL;
    }
    long long multiple = 1, divide = 1;
    for(long long i = 0 ; i < r ; ++i){
        multiple *= (n - i);
        multiple %= MOD;
        divide *= (i + 1LL);
        divide %= MOD;
    }
    long long res = multiple * power(divide, MOD - 2);
    res %= MOD;
    return res;
}

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

    int n;
    cin >> n;
    string s;
    cin >> s;

    vector<int> cnt(26);
    rep(i, n){
        ++cnt[s[i] - 'a'];
    }

    lint ans = 1;
    rep(i, 26){
        ans *= (lint)(cnt[i] + 1);
        ans %= MOD;
    }
    --ans;
    ans += MOD;
    ans %= MOD;
    
    cout << ans << endl;

    return 0;
}

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

int main(){
    char b;
    cin>>b;
    
    if(b =='A'){
        cout<<"T";
    }else if(b =='T'){
        cout<<"A";
    }else if(b == 'G'){
        cout<<"C";
    }else if(b =='C'){
        cout<<"G";
    }
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


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

	vector<ll> a(n);
	for (ll i = 0; i < n; i++)
	{
		cin >> a[i];
	}

	ll m;
	cin >> m;

	vector<ll> b(m);
	for (ll i = 0; i < m; i++)
	{
		cin >> b[i];
	}

	vector<ll> res;
	set_intersection(all(a), all(b), inserter(res, end(res)));

	for (ll it : res)
	{
		println(it);
	}
}


Measured memory_bytes: 6468
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
#pragma warning (disable: 4996)

long long N, M, K;
long long A[1 << 18], B[1 << 18];

int main() {
	cin >> N >> M >> K;
	for (int i = 1; i <= N; i++) cin >> A[i];
	for (int i = 1; i <= M; i++) cin >> B[i];
	for (int i = 1; i <= N; i++) A[i] += A[i - 1];
	for (int i = 1; i <= M; i++) B[i] += B[i - 1];
	long long r = 0;
	for (int i = 0; i <= N; i++) {
		if (A[i] > K) continue;
		int pos1 = lower_bound(B, B + M + 1, K - A[i] + 1LL) - B; pos1--;
		r = max(r, 1LL * i + 1LL * pos1);
	}
	cout << r << endl;
	return 0;
}

Measured memory_bytes: 6732
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
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; }

int main(){
  double a,b,h,m ;
  cin >> a >> b >> h >> m ;
  cout << fixed << setprecision(10);

  double ans = 0.0;
  double C= 0.0;
  double hour = (h*60.0+ m) * 0.5 * acos(-1)/180.0;
  double min = m * 6.0 * acos(-1)/180.0;

  ans = a*a + b*b - (2.0*a*b* cos(hour - min));
  // cout << ans << endl;
  cout << sqrtl(ans) << endl;

}


Measured memory_bytes: 4224
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
using namespace std;

int main() {
	long long s, c;
	cin >> s >> c;
	if (s * 2 >= c) {
		cout << c / 2 << endl;
	}
	else {
		cout << s + (c - s * 2) / 4 << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
	int map[14][14],max=0,white=0,x,y,size,i,j;
	for(i=0; i<14; i++){
		for(j=0; j<14; j++){
			map[i][j]=0;
		}
	}
	while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
		x+=2;
		y+=2;
		switch(size){
		case 3:
			map[x-2][y]++;
			map[x+2][y]++;
			map[x][y-2]++;
			map[x][y+2]++;
		case 2:
			map[x-1][y-1]++;
			map[x-1][y+1]++;
			map[x+1][y-1]++;
			map[x+1][y+1]++;
		case 1:
			map[x-1][y]++;
			map[x+1][y]++;
			map[x][y-1]++;
			map[x][y+1]++;
			map[x][y]++;
			break;
		}
	}
	for(i=2; i<12; i++){
		for(j=2; j<12; j++){
			if(map[i][j]==0){
				white++;
			}else if(max<map[i][j]){
				max=map[i][j];
			}
		}
	}
	printf("%d\n%d\n",white,max);
	return 0;
}

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

int main(void)
{
    int N, M;
    cin >> N >> M;
    vector<tuple<int, int, int>> cities(M);
    vector<tuple<int, int>> cities_id(M);
    for (int i = 0; i < M; i++) {
        int P, Y;
        cin >> P >> Y;
        cities[i] = make_tuple(Y, P, i);
    }
    sort(cities.begin(), cities.end());

    vector<int> cities_number(N, 0);
    for (auto& city : cities) {
        int P = get<1>(city);
        int i = get<2>(city);
        cities_number[P-1]++;
        cities_id[i] = make_tuple(P, cities_number[P-1]);
    }
    for (auto& city_id : cities_id) {
        cout << setfill('0') << right << setw(6) << get<0>(city_id);
        cout << setfill('0') << right << setw(6) << get<1>(city_id) << endl;
    }

    return 0;
}



Measured memory_bytes: 3840
#include<iostream>

int main(){
    int n;
    int mindiv = 100000000;
    std::cin >> n;

    for(int i = 0; i < n; i++) {
        int num;
        int count = 0;
        std::cin >> num;

        while(num % 2 == 0) {
            count++;
            num /= 2;
        }

        if(count < mindiv) mindiv = count;
    }
    
    std::cout << mindiv << std::endl;
    return 0;
}

Measured memory_bytes: 256
/*
	ALDS1_1_C: Prime Numbers
*/
#include	<iostream>
#include	<cmath>

using namespace std;

bool isPrime(int);

int main(void) {
	int f, n, c = 0;
	
	cin >> f;
	for(int i = 0; i < f; i++) {
		cin >> n;
		if(isPrime(n)) { c++; }
	}
	cout << c << endl;
	return 0;
}

bool isPrime(int x) {
	if(x == 2) { return true; }
	if(x < 2 || x % 2 == 0) { return false; }
	for(int i = 3; i <= sqrt(x); i += 2) {
		if(x % i == 0) { return false; }
	}
	return true;
}

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

#define ONLINE_JUDGE
#define pb(a) push_back(a)
#define ALL(a) a.begin(), a.end()
#define FOR(x,to) for(x=0;x<(to);x++)

using ll = long long;

const int E5 = 1e5;

//////////// Solution /////////////////////////////////

void solve() {	
	set<char> s;
	int N;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		char c;
		cin >> c;
		s.insert(c);
	}
	if (s.size() == 3) {
		cout << "Three\n";
	} else {
		cout << "Four\n";
	}
}	

/////////// End Solution ///////////////////////////////////////

//////// Initialization ////////////////////////////////////

int main() {

	#ifndef ONLINE_JUDGE
	FILE *FIN = freopen("/home/danil/prog/input.txt", "r", stdin);
	clock_t time_start = clock();
	#endif

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

	solve();

	#ifndef ONLINE_JUDGE
	fclose(FIN);
	cerr << "\x1b[031m\n-----------------\nTime=" << (ll)((double)(clock()-time_start) / CLOCKS_PER_SEC * 1000) << "ms\n\x1b[0m";
	#endif

	return 0;
}

//////// End Initialization ///////////////////////////////////////

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  vl t(3);
  ll a, b;
  cin >> a >> b;
  t[a-1]++;
  t[b-1]++;
  rep(i, 3) {
    if (t[i] == 0) {
      cout << i+1 << endl;
      return 0;
    }
  }
}


Measured memory_bytes: 256
program main;
var
    a, b, target, i : integer;
    can : boolean;
begin
    can := false;
    readln(target);
    readln(a, b);
    for i := a to b do
        if (i mod target = 0)
            then can := true;
    if can 
        then writeln('OK')
        else writeln('NG');;
end.


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

int main(){
    int a, b, c, x, y;
    cin >> a >> b >> c;
    x = a;
    y = b;
    if(c < a)   x = c;
    else if(c < b) x = c;

    cout << x*y/2 << endl;
}

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

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define TRAV(a, x) for(const auto& a : x)
#define ALL(x) x.begin(), x.end()
#define NEXT_PERM(x) while(next_permutation(ALL(x))) // 순열 알고리즘(오름)
#define PREV_PERM(x) while(prev_permutation(ALL(x))) // 순열 알고리즘(내림)
#define PRINT(x) cout << x
#define PRINT_LN(x) cout << x << endl;
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

typedef long long int ll;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<char> vc;

void solve() {
  ll n;
  cin >> n;
  string input;
  set<string> vs;
  REP(i, n) cin >> input, vs.insert(input);
  PRINT(vs.size());
}

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


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

#ifdef local
template <class T> void _E(T x) { cerr << x; } void _E(double x) { cerr << fixed << setprecision(6) << x; } void _E(string s) { cerr << "\"" << s << "\""; } template <class A, class B> void _E(pair<A, B> x) { cerr << '('; _E(x.first); cerr << ", "; _E(x.second); cerr << ")"; } template <class T> void _E(vector<T> x) { cerr << "["; for (auto it = x.begin(); it != x.end(); ++it) { if (it != x.begin()) cerr << ", "; _E(*it); } cerr << "]"; }
void ERR() {} template <class A, class... B> void ERR(A x, B... y) { _E(x); cerr << (sizeof...(y) ? ", " : " "); ERR(y...); }
#define debug(x...) do { cerr << "{ "#x" } -> { "; ERR(x); cerr << "}" << endl; } while(false)
#else
#define debug(...) 114514.1919810
#endif

using ll = long long;


int main(int argc, char *argv[]) {
  cin.sync_with_stdio(false), cin.tie(nullptr);

  int k;
  cin >> k;
  unordered_set<int> S;
  for (int i = 1, cur = 7 % k; ; i++, cur = (cur * 10ll + 7) % k) {
    if (S.count(cur)) {
      cout << "-1\n";
      return 0;
    }
    if (cur == 0) {
      cout << i << "\n";
      return 0;
    }
    S.insert(cur);
  }
}



Measured memory_bytes: 42652
#include <stdio.h>

int main(void)
{
	char w[110]; 
	int i = 0, alpha_count[26] = { 0 };

	scanf("%s", w);

	while (w[i] != '\0') {
		alpha_count[w[i++] - 'a']++;
	}

	for (i = 0; i < 26; i++) {
		if (alpha_count[i] % 2 == 1) {
			printf("No\n");
			return 0;
		}
	}

	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm> // sort
#include <map>       // pair
#include <string>
#include<stdio.h>
using namespace std;

int main(int argc, const char *argv[])
{

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
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 (b<a) {a=b; return 1;} return 0;}

const int MOD = 1000000007;

int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll ans;
    rep(i, 60) {
        ll x = 0;
        rep(j, n) if (a[j]>>i&1) x++;
        ll now = x*(n-x)%MOD;
        rep(j, i) {
            now = 2*now%MOD;
        }
        ans += now;
        ans %= MOD;
    }
    cout << ans << endl;
}


Measured memory_bytes: 2560
import java.util.Arrays;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] L = new int[2 * N];
		for (int i = 0; i < 2 * N; i++) {
			L[i] = sc.nextInt();
		}

		Arrays.sort(L);

		long sum = 0;
		for (int i = 0; i < 2 * N; i += 2) {
			sum += Math.min(L[i], L[i + 1]);
		}

		System.out.println(sum);
	}
}


Measured memory_bytes: 9680
#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;


int sumdigit(int x){
   int sum = 0;
    while(x != 0){
        sum += x % 10;
        x /= 10;
    }
    return sum;
}
int main(){
   int N ;
   cin >> N;
   int m = 0;
   for(int i = 0; i*i <= N; i++){
       if(i*i <= N)m = max(m,i*i);  
   }

   cout << m << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProblemC
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var N = read[0];
            var M = read[1];
            var ks = new int[M];
            var ss = new int[M, N];
            for (int i = 0; i < M; i++)
            {
                read = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                ks[i] = read[0];
                for (int j = 0; j < ks[i]; j++)
                {
                    ss[i, j] = read[j + 1];
                }
            }
            var ps = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var ret = 0;
            for(int i =0; i < Math.Pow(2, N); i++)
            {
                var iBi = Convert.ToString(i, 2).PadLeft(N, '0');
                var ok = true;
                for (int j = 0; j < M; j++)
                {
                    var onNum = 0;
                    for (int l = 0; l < ks[j]; l++)
                    {
                        onNum += int.Parse(iBi[ss[j, l] - 1].ToString());
                    }
                    if(onNum %2 != ps[j])
                    {
                        ok = false;
                        break;
                    }
                }
                if (ok) ret++;
            }
            Console.WriteLine(ret);

        }
    }
}


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

using namespace std;

int main(){
    int n, x, y;
    cin >> n >> x >> y;
    x--; y--;
    
    vector<vector<int>> E(n);
    for (int i = 0; i < n - 1; i++){
        E[i].push_back(i + 1);
        E[i + 1].push_back(i);
    }
    E[x].push_back(y);
    E[y].push_back(x);

    vector<int> D(n);
    int ans = 0;
    for (int i = 0; i < n; i++){
        queue<array<int, 2>> Q;
        Q.push({i, 0});
        vector<bool> visited(n);
        while (!Q.empty()){
            auto v = Q.front()[0]; 
            auto d = Q.front()[1];
            Q.pop();
            if (visited[v])
                continue;
            visited[v] = true;
            D[d]++;
            for (const auto &e: E[v])
                Q.push({e, d + 1});
        }
    }

    for (int i = 1; i < n; i++)
        cout << D[i] / 2 << endl;
}

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

using namespace std;

int main() {
	int n;
	while (cin >> n && n != 0) {
		vector<int> s(n);
		for (int i = 0; i < n; ++i) cin >> s[i];

		sort(s.begin(), s.end());
		int ave = 0;
		for (int i = 1; i < n - 1; ++i) ave += s[i];
		ave /= (n - 2);
		cout << ave << endl;
	}
	return 0;
}


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

int main()
{
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++) 
        printf("%c", ((s[i] - 'A' - 3 + 26) % 26) + 'A');
    printf("\n");
    
}

Measured memory_bytes: 0
import java.util.*;
public class Main{
	public static void main(String[] args) {
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	int t = scan.nextInt();
		int [] ar = new int[n + 1];
      	for (int i = 1 ; i <= n ; i++)
        	ar[i] = scan.nextInt();
      	Arrays.sort(ar);
      	long ans = 0;
      	for (int i = 1 ; i <= Math.max(0,n-t) ; i++)
        	ans += ar[i];
      	System.out.println(ans);
    }
}


Measured memory_bytes: 60656
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  ll X; cin >> X;
  ll now = 100, ans = 0;
  while (now < X){
    now += now / 100;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
using namespace std;


int main() {
	const long long int mod = 1000000007;
	map<long long int, long long int>mp;
	long long int  s[200][200];
	string str[2005];
	//cout << fixed << setprecision(10);
	long long int n, m, k,start=0,cou=0, h, w, a[2005][2005] = {}, sum[200005] = {}, dpz[200005] = {}, dpo[200005] = {}, res = 0;
	cin >>h>>w;
	
	for (int i = 0; i < h; i++) {
		cin >> str[i];
	}
	for (int i = 0; i < h; i++) {
		cou = 0;
		start = -1;
		for (int j = 0; j < w; j++) {
			if (str[i][j] == '#'&&cou==0) { start = j; }
			else if (str[i][j] == '#') {

				for (int p = start + 1; p < j; p++) {
					a[i][p] += cou;
				}
				cou = 0;
				start = j;
			}
			else if (j == w - 1) {
				for (int p = start + 1; p <= j; p++) {
					a[i][p] += cou+1;
				}
				cou = 0;
			}
			else { cou++; }
		}
	}
	for (int i = 0; i < w; i++) {
		cou = 0;
		start = -1;
		for (int j = 0; j < h; j++) {
			if (str[j][i] == '#' && cou == 0) { start = j; }
			else if (str[j][i] == '#') {
				for (int p = start + 1; p < j; p++) {
					a[p][i] += cou;
				}
				cou = 0;
				start = j;
			}
			else if (j == h - 1) {
				for (int p = start + 1; p <= j; p++) {
					a[p][i] += cou+1;
				}
				cou = 0;
			}
			else { cou++; }
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (res < a[i][j]) { res = a[i][j]; }
			
		}
	}
	cout << res-1;
}


Measured memory_bytes: 35712
"""
21:12:30
"""
mod = 10**9 + 7
H, W, K = map(int, input().split())
# 残っている本数
bs = [1,2,3,5,8,13,21]

if W == 1:
    print(1)
    exit()
dp = [[0]*(W) for i in range(H+1)]
dp[0][0] = 1
for i in range(H):
    for j in range(W):
        # 左端 : そのまま下ろす(j+1からｱﾐﾀﾞ)か、一つ右から下ろす(j+2からｱﾐﾀﾞ)
        if j == 0:
            dp[i+1][j] = dp[i][j] * bs[W-1-(j+1)] + dp[i][j+1] * bs[W-1-(j+2)]        
        # 右端 : そのまま下ろす(j-1からｱﾐﾀﾞ)か、一つ左から下ろす(j-2からｱﾐﾀﾞ)
        elif j == W-1:
            dp[i+1][j] = dp[i][j-1] * bs[j-2] + dp[i][j] * bs[j-1]   
        # 中    
        else:
            dp[i+1][j] = dp[i][j-1]*bs[max(0,j-2)]*bs[W-1-(j+1)] + dp[i][j]*bs[j-1]*bs[W-1-(j+1)] + dp[i][j+1]*bs[j-1]*bs[max(0,W-1-(j+2))]
        # print(dp[i+1])
        dp[i+1][j] %= mod
print(dp[H][K-1])

Measured memory_bytes: 3064
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    a_max = a[-1]
    is_divisible = [True]*(a_max+1)
    ans = 0
    is_divisible[0]= False
    el_old = 0
    for el in a:
        if is_divisible[el]:
            if el == el_old:
                ans-=1
                is_divisible[el] = False
                continue
            ans +=1
            k = 2
            while k*el <= a_max:
                is_divisible[k*el] = False
                k+=1
        el_old = el
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 33164
#include<iostream>
using namespace std;
int main()
{
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;
  if(e-a > k){
    cout << ":(";
  }
  else if(d-a > k){
    cout << ":(";
  }
  else if(c-a > k){
    cout << ":(";
  }
  else if(b-a > k){
    cout << ":(";
  }
  else
    cout << "Yay!";
  return 0;
}
  

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<tuple>
#include<cassert>
#include<set>
#define int long long
using namespace std;
const int INF = 1000000000;
const int mod = 1000000007;
signed main() {
	int n, x, y, z; cin >> x >> y >> z;
	cout << z << ' ' << x << ' ' << y << endl;
	return 0;
}

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    ll a,b;
    std::cin >> a>>b;
    
    for (int i = 1; i < 10000; i++) {
        if(floor(i*0.08)==a && floor(i*0.1)==b){
            std::cout << i << std::endl;
            return 0;
        }
    }
    std::cout << -1 << std::endl;
}


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

using ll = long long;
const ll INF = (ll)1e18 + 9;

template<typename Iterator> void printVec(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << *it << " ";
    if ((it - begin) % 20 == 19 || it == end - 1) { std::cout << std::endl; }
  }
}

int main(int argc, char* argv[])
{
  ll N, M;
  std::cin >> N >> M;
  std::vector<std::vector<ll> > vv(3, std::vector<ll >(N));
  for (ll i = 0; i < N; i++) {
    std::cin >> vv[0][i] >> vv[1][i] >> vv[2][i];
  }

  ll ans = -INF;
  for (ll S = 0; S < (1<<3); S++) {
    std::vector<ll> sum(N, 0LL);
    for (ll i = 0; i < 3; i++) {
      ll sign = S & (1<<i) ? 1 : -1;
      for (ll j = 0; j < N; j++) {
	sum[j] += sign * vv[i][j];
      }
    }
    std::sort(sum.begin(), sum.end(), std::greater<ll>());
    //printVec(sum.begin(), sum.end());
    ll calc = std::accumulate(sum.begin(), sum.begin()+M, 0LL);
    ans = std::max(ans, calc);
  }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define all(x) x.begin(),x.end()
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define sll set<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define endl "\n"
const ll maxn = 2e5+2;

int main()
{
    fastio; //remove for interactive
    ll i, j, k, n, m;
    string s,t;
    
    cin>>s>>t;
    t=t.substr(0,t.size()-1);
    if(s==t)    
    cout<<"Yes"<<endl;
else
{
    cout<<"No"<<endl;
}

    
        
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
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; }
int main(void){
    int n,k; cin>>n>>k;
    vector <int> a(n);
    for(int i=0;i<n;i++){
    cin>>a[i];
    }
    vector <int> dp(100010,1e9);
    dp[0]=0;
    for(int i=0;i<n;i++){
        for(int j=1;j<=k;j++){
        chmin(dp[i+j],dp[i]+abs(a[i]-a[i+j]));
        }
    }
    cout<<dp[n-1]<<endl;
}

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

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

#define P pair<lli,lli>

signed main(){

	lli n;
	cin>>n;

	lli ans = INF;
	for(lli i=1;i*i<=n;i++){
		if(n%i==0){
			lli j = n/i;
			ans = min(ans,i+j-2);
		}
	}
	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int> > piii;
#define pb push_back
#define NeedForSpeed ios_base::sync_with_stdio(0), cin.tie(0)
#define PI acos(-1)
#define all(c) c.begin(), c.end()
#define SET(x, y) memset((x), y, sizeof(x))
const int MOD = 1e9 + 7;
const int INF = 1e9 + 5;
const ll INF64 = 1e18;

template <typename T>
string to_string(const vector<T> &v) {
  string ret = "<";
  for (auto it : v) {
    ret += to_string(it) + ", ";
  }
  ret.pop_back(); ret.pop_back();
  ret += ">";
  return ret;
}

void debug_print() { cerr << endl; }

template <typename T, typename ...U>
void debug_print(T t, U... u) {
  cerr << " " << to_string(t);
  debug_print(u...);
}

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_print(__VA_ARGS__)
const int N = 1e5 + 5;

int main() {
  int a, b, k;
  cin >> k >> a >> b;
  for (int i = a; i <= b; i++) {
    if (i % k == 0) {
      cout << "OK" << endl;
      return 0;
    }    
  }
  cout << "NG" << endl;
  return 0;
}


Measured memory_bytes: 3624
s=input()
t=input()
y=len(t)
z=len(s)
yy=y
for i in range(0,(z-y+1)):
    xx=i+y
    s1=s[i:xx]
    ct=0
    
    for j in range(0,y):
        if(s1[j]==t[j]):
            ct+=1
    z=y-ct
    if(z<yy):
        yy=z
print(yy)
    
            
    


Measured memory_bytes: 9108