akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using Int = long long int;
template<typename T> void swap(T *t1, T *t2){ T* tmp=t1; t1=t2; t2=tmp;}
Int tmpi = 0;
double tmpd = 0.0;


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

    vector<Int> a, b;
    Int n, h, aa, bb;
    cin >> n >> h;
    for(Int i=0; i<n; i++){
        cin >> aa >> bb;
        a.push_back(aa);
        b.push_back(bb);
    }
    sort(a.begin(), a.end(), greater<Int>());
    sort(b.begin(), b.end(), greater<Int>());

    Int marker = b.size()-1;
    for(Int i=0; i<n; i++){
        if(b[i] < a[0]){
            marker = i-1;
            break;
        }
    }

    Int cnt = 0;
    Int sum = 0;
    for(Int i=0; i<n; i++){
        if(sum >= h) break;
        if(i > marker) break;
        sum += b[i];
        cnt++;
    }
    if(sum < h){
        cnt += (h-sum + a[0]-1)/a[0];
    }
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 2036
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include <map>
#include <queue>
#include <stack>
#include <initializer_list>
using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

int lcm(int a, int b) { return a * b / gcd(a, b); }
void solve(){
    int n,m,x,y;
    cin >> n >> m >> x >> y;
    if(n > m){
        cout << (n - m) * y + m * x;
    }else{
        cout << n * x;
    }
}
signed main() {
    solve();
}



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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

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

using ll = long long;

using namespace std;

template <typename T>
bool Setmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
  in(int, D);
  vector<int> c(26);
  rep(i, 26) cin >> c[i];
  vector<vector<int>> s(D, vector<int>(26));
  rep(i, D) rep(j, 26) cin >> s[i][j];

  int sat = 0;
  vector<int> last(26);
  rep(i, D) {
    int d = i + 1;
    int maxi = numeric_limits<int>::min();
    int chosen;
    rep(j, 26) {
      int change = s[i][j];
      rep(k, 26) {
        int last_day = k == j ? d : last[k];
        change -= c[k] * (d - last_day);
      }
      if (Setmax(maxi, change)) {
        chosen = j;
      }
    }
    last[chosen] = d;
    sat += maxi;
    dbg(sat, maxi, chosen);
    out(chosen + 1);
  }
  dbg(max(1000000 + sat, 0));
}


Measured memory_bytes: 3676
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
	string ans;
	ostringstream os;

	while (true)
	{
		int n;
		cin >> n;

		if (n == 0)
			break;

		double sum = 0, squ = 0;
		for (int i = 0; i < n; ++i)
		{
			double num;
			cin >> num;
			sum += num;
			squ += pow(num, 2);
		}

		squ -= (pow(sum, 2) / n);
		double sd = sqrt(squ / n);

		os << setprecision(16) << sd << "\n";
	}

	cout << os.str() << endl;

	return 0;
}

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

int str_cmp(void *s1, void *s2);

int main(){
    int N, L;
    scanf("%d %d", &N, &L);

    char s[N][L + 1];
    for(int i = 0; i < N; i++){
        scanf("%s", s[i]);
    }

    qsort(s, N, sizeof(s[0]), str_cmp);

    for(int i = 0; i < N; i++){
        printf("%s", s[i]);
    }
    printf("\n");
    return 0;
}

int str_cmp(void *s1, void *s2){
    return strcmp((char*)s1, (char*)s2);
}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;

#define MOD 1000000007
#define tc int t;scanf("%d",&t);while(t--)
#define pb push_back
#define ff(i,a,b) for(int i=a;i<b;i++)
#define mp make_pair
#define pf printf
#define sf scanf
#define bs binary_search
#define nl printf("\n")
#define IN(x) int x;scanf("%d",&x)
#define OUT(x) printf("%d\n",x )

int main()
{
	IN(a);
	IN(b);
	ff(i,1,b+1)
	{
		
		if(a==23)
			{
				a=0;
				continue;
			}
		a++;
	}
	pf("%d\n",a);
}

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

int main() {
    int n, x;
    cin >> n >> x;
    if (x == 1 || x == n * 2 - 1) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    if (n == 2) {
        cout << 1 << endl;
        cout << 2 << endl;
        cout << 3 << endl;
        return 0;
    }

    deque<int> q;
    if (x == 2) {
        for (int i = 1; i <= n * 2 + 1; i++) {
            if (i < x - 1 || i > x + 2) {
                q.push_back(i);
            }
        }

        for (int i = 0; i < n - 2; i++) {
            cout << q.front() << endl;
            q.pop_front();
        }
        cout << (x + 1) << endl;
        cout << (x) << endl;
        cout << (x - 1) << endl;
        cout << (x + 2) << endl;
        for (int i = 0; i < n - 3; i++) {
            cout << q.front() << endl;
            q.pop_front();
        }

    } else {
        for (int i = 1; i <= n * 2 + 1; i++) {
            if (i < x - 2 || i > x + 1) {
                q.push_back(i);
            }
        }

        for (int i = 0; i < n - 2; i++) {
            cout << q.front() << endl;
            q.pop_front();
        }
        cout << (x - 1) << endl;
        cout << (x) << endl;
        cout << (x + 1) << endl;
        cout << (x - 2) << endl;
        for (int i = 0; i < n - 3; i++) {
            cout << q.front() << endl;
            q.pop_front();
        }
    }
}


Measured memory_bytes: 2304
#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<complex>
using namespace std;
typedef long long int llint;

int main(){
	int n, m;
	cin >> n >> m;
	vector<pair<int, int>>a(m);
	for (int i = 0; i < m; i++){
		cin >> a[i].first >> a[i].second;
	}
	int tmp = 0;
	sort(a.begin(), a.end());
	for (int i = 0; i < m; i++){
		if (1 < a[i].first){
			break;
		}
		for (int j = tmp; j < m; j++){
			if (a[j].first < a[i].second){
				continue;
			}
			if (a[i].second < a[j].first){
				tmp = j;
				break;
			}
			if (a[j].second == n){
				cout << "POSSIBLE" << endl;
				return 0;
			}
		}
	}
	cout << "IMPOSSIBLE" << endl;
	return 0;
}

Measured memory_bytes: 1792
N = int(input())
A = [int(x) for x in input().split()]

import fractions

G = A[0]
for i in range(1,N):
    G = G * A[i] // fractions.gcd(G, A[i])

ans = 0
for j in range(N):
    ans += G // A[j]

print(ans % (10 ** 9 + 7))

Measured memory_bytes: 5608
import java.util.*
object MainKt {
  @JvmStatic fun main(args:Array<String>) {
    val nab=readLine()!!.split(" ")
    val S=readLine()!!
    val N=nab[0].toInt()
    val A=nab[1].toInt()
    val B=nab[2].toInt()

    var foreign=0
    var passed=0
    (0..(N-1)).forEach {
      when(S[it])
      {
        'a' -> 
        {
          if(passed < A+B)
          {
            passed++
            println("Yes")
          }
          else
          {
            println("No")
          }
        }
        'b'->
        {
          foreign++
          if (passed < A+B)
          {
            if (foreign <= B)
            {
              
              passed++
              println("Yes")
            } 
            else 
            {
              println("No")
            }
          }
          else 
          {
            println("No")
          }
        }
        else -> println("No")
      }
    }
  }
}


Measured memory_bytes: 28012
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as B
import Data.Maybe

main = do
  (a:b:_) <- readInts
  B.putStr $ solve a b

readInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

solve a b
  | odd (a * b) = "Odd"
  | otherwise = "Even"


Measured memory_bytes: 380
m=f=r=0
while 1:
    m,f,r=map(int,input().split())
    x=m+f
    if m==f==r==-1:break
    elif m==-1 or f==-1 or x<30:print('F')
    elif x>=80:print('A')
    elif 65<=x<80:print('B')
    elif 50<=x<65 or r>=50:print('C')
    else:print('D')

Measured memory_bytes: 7704
S = input()
N = int(input())
line = [''] * (N+1) * 2
rev = False
pos = N
line[pos] = S
leftPos = pos - 1
rightPos = pos + 1

for i in range(N):
    A = input().split()
    if len(A) == 1:
        rev = not rev
    else:
        if A[1] == '1':
            if rev == False:
                pos = leftPos
                leftPos -= 1
            else:
                pos = rightPos
                rightPos += 1
        else:
            if rev == False:
                pos = rightPos
                rightPos += 1
            else:
                pos = leftPos
                leftPos -= 1
        line[pos] = A[2]

ans = line[leftPos+1:rightPos]
ans = "".join(ans)
if rev == False:
    print(ans)
else:
    print(ans[::-1])


Measured memory_bytes: 13916
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
const int nMax=1e5+10;
int n,t,a[nMax],ans,cnt;
int main()
{
	scanf("%d%d",&n,&t);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	int Min=a[1];
	ans=0;
	for(int i=2;i<=n;i++)
	{
		if(a[i]-Min>ans)
		{
			ans=a[i]-Min;
			cnt=1;
		}
		else
			if(a[i]-Min==ans)
				cnt++;
		Min=min(Min,a[i]);
	}
	printf("%d\n",cnt);
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int s, r;
  cin >> s;
  if (s / 100 == 1) ++r;
  if (s / 10 % 10 == 1) ++r;
  if (s % 10 == 1) ++r;
  cout << r << endl;
}

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

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

typedef long long ll;
const ll MOD = 1e9 + 7;

const int MAX = 100001;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  int N, K;
  std::cin >> N >> K;
  std::vector<ll> A(N);
  rep(i, N) {
    std::cin >> A[i];
  }

  std::sort(A.begin(), A.end());
  COMinit();

  ll ans = 0;
  rep(i, N) {
    ans += COM(i, K - 1) * A[i] % MOD;
    ans %= MOD;
    ans -= COM(N - i - 1, K - 1) * A[i] % MOD;
    ans %= MOD;
  }

  std::cout << ans << '\n';
}


Measured memory_bytes: 3328
#include<cstdio>
#include<cstring>
using namespace std;
char a[1000];

int main(){
	int len,k,sum;
	while(scanf("%s",&a)==1){
		len=strlen(a);
		sum=0;
		if(len==2){
			printf("2\n");
			continue;
		}
		else{
		len-=2;
		while(len>=2){
			sum=0;
			for(int i=0,j=len/2;i<len/2,j<=len-1;i++,j++){
				if(a[i]==a[j]){
					sum++;
				}
			}
			if(sum==len/2){
				printf("%d\n",sum*2);
				break;
			}
			len-=2;
		}
		}
	}
	return 0;
}

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

int main(void){
	int i,sum;
	int n,c,m,s;

	while(cin>>n && n){
		int name[4],time[4]={999999999,999999999,-1,-1};

		while(n--){
			cin>>c;
			for(i=sum=0;i<4;i++){
				cin>>m>>s;
				sum += m*60 + s;
			}
			if(time[0]>sum){
				name[1] = name[0];
				time[1] = time[0];
				name[0] = c;
				time[0] = sum;
			}
			else if(time[1]>sum){
				name[1] = c;
				time[1] = sum;
			}

			if(time[3]<sum){
				name[2] = name[3];
				time[2] = time[3];
				name[3] = c;
				time[3] = sum;
			}
			else if(time[2]<sum){
				name[2] = c;
				time[2] = sum;
			}
		}

		for(i=0;i<3;i++) cout<<name[i]<<endl;
	}

	return 0;
}

Measured memory_bytes: 864
from collections import deque


def generate_primes():
    yield 2

    n = 3
    while True:
        if is_prime(n):
            yield n
        n += 2


def is_prime(n):
    if n < 2:
        return False

    if n == 2:
        return True

    if n % 2 == 0:
        return False

    i = 3
    while i * i <= n:
        if n % i == 0:
            return False
        i += 2

    return True


n = int(input())
primes = []
# for i in range(2, 1 + 55555):
i = 2
while len(primes) < n:
    if i % 5 == 1 and is_prime(i):
        primes.append(i)
    i += 1
print(*primes)


Measured memory_bytes: 3316
n = int(input())
s = input()
rcount = [0] * 26
for i in range(n):
    rcount[ord(s[i])-ord("a")] += 1
lcount = [0] * 26

ans = 0
cur = 0
for i in range(n):
    j = ord(s[i])-ord("a")
    lcount[j] += 1
    rcount[j] -= 1
    if lcount[j] == 1 and rcount[j] >= 1:
        cur += 1
    if rcount[j] == 0 and lcount[j] >= 2:
        cur -= 1
    ans = max(ans, cur)
print(ans)

Measured memory_bytes: 3064
import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    H, W, N = map(int, sys.stdin.readline().split())
    nb = [0] * 10
    bm = dict()
    bb = set()

    for lp in range(N):
        a, b = map(int, sys.stdin.readline().split())
        a, b = a-1, b-1
        res = search(H, W, bm, bb, a, b)

        if 1 <= a <= H-2 and 1 <= b <= W-2:
            bm[a,b] = 1 + res
        
        bb.add((a,b))

    # debug(bm, locals())
    for i in bm.values():
        nb[i] += 1

    nb[0] = (H-2)*(W-2) - sum(nb)

    print(*nb, sep='\n')

def search(H, W, bm, bb, a, b):
    res = 0
    dx = (1, 0, -1, 0, 1, 1, -1, -1)
    dy = (0, 1, 0, -1, 1, -1, 1, -1)

    for j in range(8):
        if (a + dx[j], b + dy[j]) in bb:
            res += 1

        if a + dx[j] < 1 or a + dx[j] > H - 2:
            continue
        if b + dy[j] < 1 or b + dy[j] > W - 2:
            continue

        if (a + dx[j], b + dy[j]) not in bm:
            bm[a + dx[j], b + dy[j]] = 0

        bm[a + dx[j], b + dy[j]] += 1

    return res

if __name__ == '__main__':
    solve()

Measured memory_bytes: 159336
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

typedef struct {
	size_t idx;
	size_t P;
	size_t Y;
	size_t order;
} ID;

int compare_f(const void *a, const void *b) {
	const ID * aP = (ID *)a;
	const ID * bP = (ID *)b;

	if (aP->P < bP->P) {
		return -1;
	}
	else if (aP->P == bP->P){
		if (aP->Y < bP->Y) {
			return -1;
		}
		else {
			return 1;
		}
	}
	else {
		return 1;

	}
}

int compare_f2(const void *a, const void *b)
{
	return (((ID *)a)->idx < ((ID *)b)->idx) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
	uint64_t temp;

	while (m%n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}

	return n;
}

static ID id[100000];

int main(void) {
	size_t N, M;

	scanf("%zu %zu\n", &N, &M);
	for (size_t idx = 0; idx < M; idx++) {
		scanf("%zu %zu", &(id[idx].P), &(id[idx].Y));
		if (idx < M - 1) {
			scanf("\n");
		}
		id[idx].idx = idx;
	}

	qsort(id, M, sizeof(ID), compare_f);

	size_t contiguousCount = 0;
	size_t curP = (size_t)UINT32_MAX;
	for (size_t idx = 0; idx < M; idx++) {
		if (id[idx].P != curP) {
			contiguousCount = 1;
			curP = id[idx].P;
		}
		else {
			contiguousCount++;
		}

		id[idx].order = contiguousCount;
	}

	qsort(id, M, sizeof(ID), compare_f2);

	for (size_t idx = 0; idx < M; idx++) {
		printf("%06zu%06zu\n", id[idx].P, id[idx].order);
	}

	return 0;
}


Measured memory_bytes: 7748
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <bitset>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define EPS 1e-8
#define LL_INF 0x3fffffffffffffff
#define INF 0x3f3f3f3f3f3f3f3f
#define MEM(a, b) memset(a, b, sizeof(a))
#define PPER(i, n, m) for (int i = n; i >= m; i--)
#define REPP(i, n, m) for (int i = n; i <= m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define PER(i, n, m) for (int i = n; i > m; i--)
#define SA(n) scanf("%d", &(n))
#define SLLA(n) scanf("%lld", &(n))
#define MP make_pair
#define FF first
#define SS second
#define PB push_back
#define DE(val) cout << #val << ": " << val << endl;

const int dx44[6] = {0, -1, -1, 1, 1};
const int dy44[6] = {0, -1, 1, -1, 1};
const int dx4[6] = {0, 1, 0,-1};
const int dy4[6] = {-1, 0, 1,0};
const int dx8[9] = {0, -1, 0, 1, 0, 1, 1, -1, -1};
const int dy8[9] = {0, 0, 1, 0, -1, 1, -1, 1, -1};
const int dx82[9] = {0, -1, -1, 1, 1, 2, 2, -2, -2};
const int dy82[9] = {0, 2, -2, 2, -2, 1, -1, 1, -1};
void update(ll& x,ll v){
    if(x==-1)x=v;
    else if(x>v)x=v;
}

ll po(ll a, ll b, ll mod)
{
    ll res = 1;
    a %= mod;
    for (; b; b >>= 1)
    {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}
ll gcd(ll a, ll b)
{
    if (a == 0)
    {
        return b;
    }
    else
    {
        return gcd(b % a, a);
    }
}
void extgcd(ll a, ll b, ll &d, ll &x, ll &y)
{
    if (!b)
    {
        d = a;
        x = 1;
    }
    else
    {
        extgcd(b, a % b, d, y, x);
        y -= x * (a / b);
    }
}
ll inverse(ll a, ll n)
{
    ll d, x, y;
    extgcd(a, n, d, x, y);
    return d == 1 ? (x + n) % n : -1;
}
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
const int maxn = 3e5 + 5;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
/*************************************************************************/

void solve() {
    ll n;
    SLLA(n);
    // n*=100;

    // if(n%108) {
    //     puts(":(");
    //     return;
    // }
    int x = n*100/108;
    // DE(x)
    // DE(n)
    REPP(k,x-100,x+100) {
        // DE(k*1.08)
        // DE(n)
        int g = k*1.08;
        if(g == n && k >= 0) {
            printf("%d\n", k);
            return;
        }
    }
   puts(":(");
}

int main()
{
#ifndef ONLINE_JUDGE
  //freopen("i.txt", "r", stdin);
  //freopen("o.txt", "w", stdout);
#endif
  solve();

  return 0;
}





Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
if n >= 2000:
    print(1)
    quit()
x = n//100
if x*100 <= n <= x*105:
    print(1)
else:
    print(0)

Measured memory_bytes: 64024
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <array>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	int k; cin >> k;
	string s = "ACL";
	for (int i = 1; i <= k; i++) cout << s;

	return 0;
}

Measured memory_bytes: 3616
n = int(input())
a = [int(m) for m in input().split()]
pair = []
for i in range(n):
  pair.append([i + 1, a[i]])

for i in range(n):
  pair[i].sort()
tuplepair = []
for i in range(n):
  tuplepair.append((pair[i][0], pair[i][1]))
print(n - len(set(tuplepair)))

Measured memory_bytes: 34472
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb push_back
#define ff first 
#define ss second  
typedef pair<int,int> pp;
bool com(pp x,pp y){
    return x.ff<y.ff;
} 
int N=1e5+9;
int main() {
	// your code goes here
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int x;
	cin>>x;
	cout<<10-(x/200);
	return 0; 
	
}


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

long max(long a, long b) {
  return a > b ? a : b;
}

long keta(long n) {
  if (n < 10) return 1;
  return keta(n/10) + 1;
}

int main() {
  long N;
  cin >> N;
  long res = N;
  for (long i = 1; i*i <= N; i++) {
    if (N % i != 0) continue;
    long k = max(keta(N/i), keta(i));
    res = k > res ? res : k;
  }
  cout << res << endl;
  return 0;
}

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

using namespace std;

int a[1005];

int main(){
	int c, b, n, res = 0;
	cin >> n >> c >> b;
	int A = 0, AB = 0, B = 0;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		if (a[i] <= c) A++;
		else if (c + 1 <= a[i] && a[i] <= b) AB++;
		else B++;
	}
	
	cout << min(A, min(AB, B));
	return 0;
}

Measured memory_bytes: 256
<?php

fscanf(STDIN, '%s', $W);

$c = 0;
while (true) {
    $T = trim(fgets(STDIN));
    if ($T == 'END_OF_TEXT') { break; }

    $words = explode(' ', strtolower($T));
    $count = array_count_values($words);

    if (isset($count[$W])) {
        $c += $count[$W];
    }
}

echo $c, PHP_EOL;

Measured memory_bytes: 6612
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
for i in range(N):
	ans += min([A[i], B[i]])
	B[i] = max([0, B[i] - A[i]])
	ans += min([A[i+1], B[i]])
	A[i+1] = max([0, A[i+1] - B[i]])
print(ans)

Measured memory_bytes: 82148
#include<iostream>

using namespace std ;
int main()
{
    int a,b;
    cin>>a>>b;

    if(a>=13){
        cout<<b<<endl;
    }
    else if(a<=12&&a>=6){
        cout<<b/2<<endl;
    }
    else if(a<=5){
        cout<<0<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
const int INF=1e9,MOD=1e9+7,ohara=1e6;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrrep(i,a,b) for(ll i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

ll n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);
      
    cin>>n;
    rrep(i,n,ohara){
        s=to_string(i);
        set<char> st;
        rep(j,Size(s)){
            st.insert(s[j]);
        }
        if(Size(st)==1){
            Cout(i);
            return 0;
        }
    }
    return 0;
}


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

int main(){
    int N,K;cin>>N>>K;
    long long res=0;
    int S,P,R;cin>>S>>P>>R;
    string st;cin>>st;
    for(int i=0;i<st.size();i++){
        if(st[i]=='s')res+=S;
        if(st[i]=='p')res+=P;
        if(st[i]=='r')res+=R;
           }
    for(int i=K;i<st.size();i++){
        if(st[i]==st[i-K]){
        if(st[i]=='s')res-=S;
        if(st[i]=='p')res-=P;
        if(st[i]=='r')res-=R;
        st[i]='n';
        }
    }
    cout<<res<<endl;
}

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

int main()
{
  int N;
  cin >> N;
  if (N == 1)
  {
    cout << "Hello World" << endl;
  }
  else
  {
    int A, B;
    cin >> A >> B;
    cout << A + B << endl;
  }
  return 0;
}

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

typedef pair<int, int> Pii;

void readint(int N, vector<int> &a);
void readdouble(int N, vector<double> &a);
void readindex(int N, vector<int> &a);



signed main(){

    int N;
    cin >> N;
    char S[100];
    REP(i, N){
        cin >> S[i];
    }
    

    string ans = "Three";
    REP(i, N){
        if(S[i] == 'Y') ans = "Four";
    }

    cout << ans;

    
    return 0;
}








void readint(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str());
}
void readdouble(int N, vector<double> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atof(s.c_str());
    }
    getline(cin, s, '\n');
    a[N - 1] = atof(s.c_str());
}
void readindex(int N, vector<int> &a){
    string s;
    for(int i = 0; i < N - 1; i++){
        getline(cin, s, ' ');
        a[i] = atoi(s.c_str()) - 1;
    }
    getline(cin, s, '\n');
    a[N - 1] = atoi(s.c_str()) - 1;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 /*int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }*/
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int a){
  par= vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0)
      return a;
    else
      return par[a]=find(par[a]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int gcm(int a,int b){
    if(b==0)
        return a;
    return gcm(b,a%b);
}
int lcm(int a,int b){
    return a/gcm(a,b)*b;
}
/*struct aa{
  vector<int> gt;
  aa(int n){
  gt= vector<int>(n, 1);
  }
  void c(V<int> d,int b){
  if(d[b]==0){
    gt[d[b]-1]++;
    gt[gt.sz-1]++;
  }
  else{
    gt[d[b]-1]++;
    c(d,d[d[b]]-1);
  }
}
void cok(int a){
  cout<<gt[a-1]<<endl;
  fo(i,a-1)
  cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){

}*/
signed main(){
  int a;
  cin>>a;
  int b=a;
  int c=0;
  int d=0;
  while(b>0){
    b/=2;
    c++;
  }
  d=pow(2,c);
  cout<<d-1<<endl;
}


Measured memory_bytes: 256
/**
DufauX-XuafuD
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define reset(x) memset(x,-1,sizeof(x))
#define CheckBit(a,b) (a&(1ll<<b))
#define SetBit(a,b) a=(a|(1ll<<b))
#define UnSetBit(a,b) a=(a&(~(1ll<<b)))
#define maxx 10000006
#define PI 2*acos(0.0)
const long long INF = 2000000000000000000LL;	// 2e18
const int inf = 0x3f3f3f3f;	// 1061109567
const long double EPS = 1e-9;
//bitset<maxx/2>vis;
//bitset<maxx>pr;
//int mobi[maxx+10];
//vector<ll>prime;
//void sieve(){
//    ll x=maxx/2, y=sqrt(maxx)/2;
//    for(ll i=1;i<=y;i++){
//        if(vis[i]==0){
//            for(ll j=(i*(i+1)*2);j<x;j+=(2*i)+1)
//                vis[j]=1;
//        }
//    }
//    prime.push_back(2);
//    for(ll i=3;i<maxx;i+=2)
//        if(vis[i/2]==0)
//        prime.push_back(i);
//}
//void generate_mobius()
//{
//    for(int i=0;i<maxx;i++)mobi[i]=1;
//    for(int i=2;i<maxx;i++){
//        if(!pr[i]){
//            mobi[i]*=-1;
//            for(int j=i+i;j<maxx;j+=i){
//                pr[j]=1;
//                mobi[j]*=(j%(i*i)?-1:0);
//            }
//        }
//    }
//}
//bool isprime(ll a)
//{
//    if(a==1)return false;
//    if(a==2)return true;
//    if(a%2==0)return false;
//    for(ll i=0;i<prime.size() && prime[i]*prime[i]<=a;i++)
//        if(a%prime[i]==0)return false;
//    return true;
//}
/* Calculate ( a*b ) %c */
inline ll mulmod(ll a, ll b, ll c) {
    ll ret = 0 , cur = a % c ;
    while(b) { if(b%2) ret=(ret+cur)%c; cur=(cur<<1)%c; b=b>>1; }
    return ret%c;
}
//Calculate (b^p)%m || modular inverse: b^-1 = bigmod(b, m-2, m)
inline ll bigmod(ll b, ll p, ll m){
    ll ret = 1, cur = b % m;
    while(p) { if(p&1) ret=(ret*cur)%m; cur=(cur*cur)%m; p=p>>1; }
    return ret;
}
inline ll modulo(ll a,ll b,ll c) { //Same as big mod, use for numbers over 1e10
    ll ret = 1 , cur = a%c ;
    while(b) { if(b%2) ret=mulmod(ret,cur,c); cur=mulmod(cur,cur,c); b=b>>1; }
    return ret%c ;
}
inline ll power(ll b, ll p){
    ll ret = 1, cur = b;
    while(p) { if(p&1) ret=(ret*cur); cur=(cur*cur); p=p>>1; }
    return ret;
}
ll lcm(ll a,ll b)
{
    return (a/__gcd(a,b))*b;
}
ll gcd(ll a,ll b)
{
    return __gcd(a,b);
}
void Dufaux()
{
    ll a,b,c;
    cin>>a>>b>>c;
    if(a==0 && b==0){
        cout<<"1"<<endl;
    }
    else if(a==0){
        cout<<(b/c)+1<<endl;
    }
    else{
        ll ans=(b/c)-(((a-1)/c));
        cout<<ans<<endl;
    }

}
int main()
{
    FastIO;
	///sieve();
	///generate_mobius();
	int test=1;
	while(test--){
        Dufaux();
	}
	return 0;
}






Measured memory_bytes: 3576
// ==============
const MAXN: usize = 300010;

struct Comb {
    fact: [usize; MAXN],
    finv: [usize; MAXN],
}
impl Comb {
    // これをメンバーに持たせるのは悩みどころさん
    fn p_mod(base: usize, exp: usize) -> usize {
        if exp != 0 {
            if (exp & 1) == 1 {
                Comb::p_mod(base * base % MOD, exp / 2) * (base) % MOD
            } else {
                Comb::p_mod(base * base % MOD, exp / 2)
            }
        } else {
            1
        }
    }

    fn fact_new() -> Self {
        let mut fact: [usize; MAXN] = [0; MAXN];
        fact[0] = 1;
        for i in 1..MAXN {
            fact[i] = (fact[i - 1] * i) % MOD;
        }
        let mut finv: [usize; MAXN] = [0; MAXN];
        finv[MAXN - 1] = Comb::p_mod(fact[MAXN - 1], MOD - 2);
        for i in (0..(MAXN - 1)).rev() {
            finv[i] = (finv[i + 1] * (i + 1)) % MOD;
        }
        Comb {
            fact: fact,
            finv: finv,
        }
    }
    fn nPr(&self, n: usize, r: usize) -> usize {
        if n < r || r == 0 {
            0
        } else {
            self.fact[n] * self.finv[n - r] % MOD
        }
    }
    fn nCr(&self, n: usize, r: usize) -> usize {
        if n < r {
            0
        } else if r == 0 {
            1
        } else {
            self.fact[n] * self.finv[r] % MOD * self.finv[n - r] % MOD
        }
    }
    fn nHr(&self, n: usize, r: usize) -> usize {
        if n == 0 && r == 0 {
            1
        } else {
            self.nCr(n + r - 1, r)
        }
    }
}
// ==============

fn main() {
    let (n, m, k): (usize, usize, usize) = (read::<usize>(), read::<usize>(), read::<usize>());
    let c = Comb::fact_new();
    let mut ans = 0;
    for kk in 0..k + 1 {
        ans += (m * c.nCr(n - 1, kk) % MOD) * Comb::p_mod(m - 1, n - 1 - kk) % MOD;
        ans %= MOD;
    }
    println!("{}", ans % MOD);
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: usize = 998244353;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========


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

using namespace std;
#define int long long
const int MOD = 1000000007;
void add(int &a, const int &b) {
	a += b;
	if (a >= MOD) a -= MOD;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M;
	cin >> N >> M;
	vector<vector<int> > dp(N + 1, vector<int>(M + 1, 0));
	for (int j = 0; j <= M; j++) {
		dp[0][j] = 1;
	}
	for (int i = 1; i <= N; i++) {
		int cur = 0;
		for (int j = 0; j <= M; j++) {
			add(dp[i][j], cur);
			add(dp[i][j], (j + 1) * dp[i - 1][j] % MOD);
			cur *= 2;
			cur += j * dp[i - 1][j];
			cur %= MOD;
		}
	}
	cout << dp[N][M] << endl;
}

Measured memory_bytes: 198824
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#define MP make_pair
using ll = long long;
using namespace std;

int main()
{
  string s;
  cin >> s;
  bool b = false;
  for(int i=0; i < s.size()-1; i++){
    if(s[i]=='A' && s[i+1]=='C')
      b = true;
  }
  if(b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
count = 1
l = 0
if (0 in a) == True:
  print(0)
else:
  for i in a:
    count *= i
    if count > 1000000000000000000:
      l = -1
      break
  if l == 0:
    print(count)
  else:
    print(l)

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

int main()
{
    int n, k;
    cin >> n >> k;
    long ans = 0, d = 0;
    for (int i = 1; i <= n; i++){
        if (k % 2 == 0){
            if (i % k == 0) ans++;
            else if (i % (k / 2) == 0) d++;
        }
        else if (i % k == 0) ans++;
        
    }
    cout << ans * ans * ans + d * d * d << endl;
}


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

LL mod = 1000000007;

int main()
{
	LL a, b;
	cin >> a >> b;

	LL dig, tim;
	if (a > b) {
		dig = b, tim = a;
	}
	else {
		dig = a, tim = b;
	}

	for (LL i = 0; i < tim; ++i) {
		cout << dig;
	}
	cout << "\n";

	
}

Measured memory_bytes: 256
fn main() {
  let n: usize = get::val();
  let mut veca: Vec<usize> = get::list(); veca.sort(); veca.reverse();
  let mut vecb: Vec<usize> = get::list(); vecb.sort(); vecb.reverse();
  let mut vecc: Vec<usize> = get::list(); vecc.sort(); vecc.reverse();

  let mut diff1 = vec![];
  let mut diff2 = vec![];
  let mut i = 0;
  let mut j = 0;
  for a in veca {
    while i < n && vecb[i] > a {i+=1}
    diff1.push(i)
  }
  for b in vecb {
    while j < n && vecc[j] > b {j+=1}
    diff2.push(j)
  }

  diff1.reverse();
  let asum = diff2.iter().scan(0,|a,&x|{*a+=x; Some(*a)}).collect::<Vec<_>>();
  let mut ans = 0;
  for &d in &diff1 {
    if d != 0 {ans += asum[d-1]}
  }

  println!("{}", ans)
}

#[allow(dead_code)]
mod get {
  use std::io::*;
  use std::str::*;

  pub fn val<T: FromStr>() -> T {
    let mut buf = String::new();
    stdin().read_line(&mut buf).ok();
    buf.trim().parse::<T>().ok().unwrap()
  }

  pub fn vals<T: FromStr>(n: usize) -> Vec<T> {
    let mut vec: Vec<T> = vec![];
    for _ in 0 .. n {
      vec.push(val());
    }
    vec
  }

  pub fn tuple<T1: FromStr, T2: FromStr>() -> (T1, T2) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).ok();
    let mut it = buf.trim().split_whitespace();
    let x = it.next().unwrap().parse::<T1>().ok().unwrap();
    let y = it.next().unwrap().parse::<T2>().ok().unwrap();
    (x, y)
  }

  pub fn tuples<T1: FromStr, T2: FromStr>(n: usize) -> Vec<(T1, T2)> {
    let mut vec: Vec<(T1, T2)> = vec![];
    for _ in 0 .. n {
      vec.push(tuple());
    }
    vec
  }

  pub fn tuple3<T1: FromStr, T2: FromStr, T3: FromStr>() -> (T1, T2, T3) {
    let mut buf = String::new();
    stdin().read_line(&mut buf).ok();
    let mut it = buf.trim().split_whitespace();
    let x = it.next().unwrap().parse::<T1>().ok().unwrap();
    let y = it.next().unwrap().parse::<T2>().ok().unwrap();
    let z = it.next().unwrap().parse::<T3>().ok().unwrap();
    (x, y, z)
  }

  pub fn tuple3s<T1: FromStr, T2: FromStr, T3: FromStr>(n: usize) -> Vec<(T1, T2, T3)> {
    let mut vec: Vec<(T1, T2, T3)> = vec![];
    for _ in 0 .. n {
      vec.push(tuple3());
    }
    vec
  }

  pub fn list<T: FromStr>() -> Vec<T> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|t| t.parse::<T>().ok().unwrap()).collect()
  }

  pub fn lists<T: FromStr>(h: usize) -> Vec<Vec<T>> {
    let mut mat: Vec<Vec<T>> = vec![];
    for _ in 0 .. h {
      mat.push(list());
    }
    mat
  }

  pub fn chars() -> Vec<char> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).ok();
    buf.trim().chars().collect()
  }
}


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

using namespace std;
const int MAX = 1e5 + 1;
const int MOD = 1e9 + 7;

int dp[MAX];

void add_self(int &a, int b)
{
    a += b;

    if(a >= MOD)
        a %= MOD;
}

void sub_self(int &a, int b)
{
    a -= b;

    if(a < 0)
        a += MOD;
}

int main()
{
    int n, k;

    cin >> n >> k;

    dp[0] = 1;
    for(int child = 1; child <= n; ++child)
    {
        int nrCandies;

        cin >> nrCandies;

        vector<int> aux(k + 1);
        for(int used = k; used >= 0; used--)
        {
            int temp = dp[used];
            int L = used + 1;
            int R = used + min(nrCandies, k - used);

            if(L <= R)
            {
                add_self(aux[L], temp);

                if(R + 1 <= k)
                    sub_self(aux[R + 1], temp);
            }
        }

        int prefixSum = 0;
        for(int i = 0; i <= k; i++)
        {
            prefixSum = (prefixSum + aux[i]) % MOD;
            dp[i] = (dp[i] + prefixSum) % MOD;
        }
    }

    cout << dp[k];

    return 0;
}


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

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

long long gcd(long long a, long long b, long long c)
{
    return gcd1(a,gcd1(b,c));
}

int main()
{
    long long k;
    cin >> k;

    long long sum = 0;
    for(long long a = 1; a <= k; ++a)
    {
        for(long long b = 1; b <= k; ++b)
        {
            for(long long c = 1; c <= k; ++c)
            {
                sum += gcd(a,b,c);
            }
        }
    }

    cout << sum << endl;
}


Measured memory_bytes: 3124
//#include "IntMod.h"
//typedef IntMod<1000000007> MInt;

//#include "Union_Find.h"

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

using namespace std;
#define REP(i,a,n) for(int i = (a); i < (int)(n); ++i)
#define REPM(i,n,a) for(int i = ((n) - 1); i >= (a); --i)
#define EPS 0.0001
#define INF 0x3FFFFFFF
#define INFLL 0x3FFFFFFF3FFFFFFF
#define INFD 1.0e+308
#define FLOAT setprecision(16)
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;

template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(begin(dest), end(dest), val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
// all_of

#if 1
#include <unordered_set>
#include <unordered_map>
template<typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;	// コスト小を優先
#endif

int N;
int P[1000];
vector<int> C[1000];
int X[1000];
PP OPT[1000];
bool DP[1000][5001];
bool calced[1000];

bool rec(int i) {
	if (calced[i]) return true;
	
	DP[i][0] = 1;
	int base = 0;
	int maxtotal = 0;
	for (int j : C[i]) {
		if (!rec(j)) return false;
		int optmin = min(OPT[j].first, OPT[j].second);
		int optmax = max(OPT[j].first, OPT[j].second);
		base += optmin;
		maxtotal += optmax;
		int diff = optmax - optmin;
		REPM(k, X[i] + 1, 0) {
			if (k - diff < 0) continue;
			DP[i][k] |= DP[i][k - diff];
		}
	}

	if (base > X[i]) return false;
	int submax = 0;
	REPM(k, X[i] - base + 1, 0) {
		if (DP[i][k]) {
			submax = k;
			break;
		}
	}
	OPT[i] = PP(X[i], maxtotal - submax);
	calced[i] = true;
	return true;
}

int main() {
	cin >> N;
	REP(i, 1, N) {
		cin >> P[i];
		--P[i];
		C[P[i]].push_back(i);
	}
	REP(i, 0, N) {
		cin >> X[i];
	}
	cout << (rec(0) ? "" : "IM") << "POSSIBLE" << endl;
	return 0;
}


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

#define rep(i,j,n) for(int i=j;i<n;++i)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(), i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 1e9 + 7;

typedef long long i64;
typedef pair<int, int> pi;

template <class T> using vt = vector<T>;
template <class T> using vvt = vector<vector<T>>;

i64 gcd(i64 n, i64 m) {return (m == 0? n : gcd(m, n % m));}
i64 lcd(i64 n, i64 m) {return (n / gcd(n, m) * m);}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

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

  int n, m;
  cin >> n >> m;
  vt<int> a(m);
  rep(i, 0, m) cin >> a[i];

  int c[] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};

  vt<int> dp(10100, -100);
  dp[0] = 0;
  rep(i, 0, n) {
    rep(j, 0, m) {
      dp[i + c[a[j]]] = max(dp[i + c[a[j]]], dp[i] + 1);
    }
  }

  string s = "";
  int num = n;
  sort(rall(a));
  while(num > 0) {
    rep(i, 0, m) {
      if(num >= c[a[i]] && dp[num] - 1 == dp[num - c[a[i]]]) {
        s += to_string(a[i]);
        num -= c[a[i]];
        break;
      }
    }
  }
  cout << s << endl;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

//main code

int main(int argc, char const* argv[])
{
	int r;
	cin >> r;
	cout << 3 *r*r << endl;
	return 0;
}


Measured memory_bytes: 256