akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=1;i<=n;i++)
#define ford(i,n) for(int i=n;i>=0;i--) 
#define REP(i,a,n) for(int i=a;i<n;i++)
#define foreach(itr,c) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define re return
#define INF 1e9
#define LINF 1e18
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi > vpi; 
int main(){
	int n;
	cin>>n;
	map<string,int> m;
	rep(i,n){
		string s;
		cin>>s;
		m[s]++;
	}
	int cnt=0;
	foreach(itr,m){
		cnt++;
	}
	cout<<cnt;
	re 0;
}

Measured memory_bytes: 19256
def slove():
    import sys
    input = sys.stdin.readline
    h, w = list(map(int, input().rstrip('\n').split()))
    s = [list(map(str, str(input().rstrip('\n')).split())) for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if s[i][j] == "snuke":
                print(chr(97 + j).upper() + str(i + 1))
                exit()


if __name__ == '__main__':
    slove()


Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
#define ll            long long
#define nl            "\n"
#define PB            push_back
#define _SAD()        ios::sync_with_stdio(0),cin.tie(0), cout.tie(0);
#define SZ(s)         s.size()
#define SRT(x,y)      sort(x,x+y)
#define REV(a,b)      reverse(a,a+b)
#define VSRT(x)       sort(x.begin(),x.end())
#define VREV(x)       reverse(x.begin(),x.end())
int maxn=1e5+10;
int main()
{
    _SAD()
    int n;
    cin>>n;
    if(n==1)
    {
        cout<<"Hello World"<<nl;
    }
    else
    {
        int x,y;
        cin>>x>>y;
        cout<<x+y<<nl;
    }
    return 0;
}



Measured memory_bytes: 256
line1 = STDIN.gets.chomp.split(" ")
n = line1[0].to_i
q = line1[1].to_i

queue = Array.new(n)
n.times do |i|
  line = STDIN.gets.chomp.split(" ")
  process = [line[0], line[1].to_i]
  queue[i] = process
end

time = 0
processes_ended = Array.new
while queue.empty? == false
  process = queue.shift
  if process[1] > q
    time += q
    process[1] -= q
    queue.push(process)
  else
    time += process[1]
    process[1] -= process[1]
    puts "#{process[0]} #{time}"
  end
end

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

int a[100000],b[100000];
int main(){
	int n;scanf("%d",&n);
	rep(i,n){
		scanf("%d%d",&a[i],&b[i]);
	}
	int c=*max_element(a,a+n),d=*min_element(b,b+n);
	cout<<c+d<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, a, b) for(int i = b - 1; i >= a; i--)
#define ALL(a) a.begin(), a.end()
#define pii pair<int,int>
#pragma GCC optimize("Ofast")
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define pb push_back
#define mp make_pair
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
template<class T>bool chmax(T &a, const T &b) {if(a<b){a = b; return 1;} return 0; };
template<class T>bool chmin(T &a, const T &b) {if(a>b){a = b; return 1;} return 0; };
inline void IN(void){return;}
template <typename First, typename... Rest> void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
inline void OUT(void){cout << "\n";return;}
template <typename First, typename... Rest> void OUT(First first, Rest... rest){cout << first << " ";OUT(rest...);return;}
const double EPS = 1e-9;
const int mod = 1e9 + 7;
const int INF = 1e9;
const long long LLINF = 1e18;
long long lcm(ll a, ll b){return a * b / __gcd(a,b);}
struct IoSetup { IoSetup() {
    cin.tie(nullptr);ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
} } iosetup;
template< int mod > struct ModInt {
    int x; ModInt() : x(0) {}
    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    ModInt &operator+=(const ModInt &p) {if((x += p.x) >= mod) x -= mod;return *this;}
    ModInt &operator-=(const ModInt &p) {if((x += mod - p.x) >= mod) x -= mod;return *this;}
    ModInt &operator*=(const ModInt &p) {x = (int) (1LL * x * p.x % mod);return *this;}
    ModInt &operator/=(const ModInt &p) {*this *= p.inverse();return *this;}
    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }
    ModInt inverse() const {int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) { t = a / b; swap(a -= t * b, b); swap(u -= t * v, v); }return ModInt(u);}
    ModInt pow(int64_t n) const {ModInt ret(1), mul(x); while(n > 0) {if(n & 1) ret *= mul;mul *= mul;n >>= 1;}return ret;}
    friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x;}
    friend istream &operator>>(istream &is, ModInt &a) { int64_t t; is >> t; a = ModInt< mod >(t); return (is); }
    static int get_mod() { return mod; }
}; using modint = ModInt< mod >;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){
    iosetup;
    int A, B, C; cin >> A >> B >> C;
    int X; cin >> X;
    int cnt = 0;
    rep(i, 0, A + 1){
        rep(j, 0, B + 1){
            rep(k, 0, C + 1){
                if(i * 500 + j * 100 + k * 50 == X) cnt++;
            }
        }
    }
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
/*
  Problem:
  Date:
*/
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#define line cout << endl
using namespace std;
int a;
string s, t;
int main () {
	cin >> s >> t;
	int len = s.length();
	int ans = 0;
	for (int i = 0; i < len; i++) {
		if (s[i] != t[i]) ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3888
N,M = (int(x) for x in input().split())

S_arr_arr = []
for _ in range(M):
    S_arr = [int(x) for x in input().split()][1:]
    S_arr_arr.append(S_arr)
P_arr = [int(x) for x in input().split()]

ans = 0
for i in range(1 << N):
    success_flag = True
    for S_arr, P in zip(S_arr_arr, P_arr):
        s_count = 0
        for S in S_arr:
            if i & (1 << (S-1)) != 0:
                s_count += 1
        if s_count % 2 != P:
            success_flag = False
            break
    if success_flag:
        ans += 1

print(ans)


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

int main(void)
{
	int w, h;
	int map[51][51];
	char in[51];
	int i, j;
	int nb, nw;
	int n;
	int cnt;
	int flag;
	int flag_b, flag_w;
	
	while (1){
		scanf("%d%d", &w, &h);
		if (w == 0 && h == 0){
			break;
		}
		
		memset(map, -1, sizeof(map));
		
		for (i = 1; i <= h; i++){
			scanf("%s", in);
			for (j = 1; j <= w; j++){
				switch (in[j - 1]){
				  case '.':
				    map[i][j] = -2;
					break;

				  case 'B':
				    map[i][j] = -4;
					break;

				  case 'W':
				    map[i][j] = -8;
					break;
				}
			}
		}

		n = 1;
		nb = nw = 0;
		
		while (1){
			for (i = 1; i <= h; i++){
				for (j = 1; j <= w; j++){
					if (map[i][j] == -2){
						goto exit;
					}
				}
			}
exit:;

			if (i == h + 1 && j == w + 1){
				break;
			}

			flag_b = flag_w = 0;
			map[i][j] = n;
			if (map[i    ][j - 1] == -4){
				 flag_b = 1;
			}
			if (map[i    ][j - 1] == -8){
				 flag_w = 1;
			}
			if (map[i    ][j + 1] == -4){
				 flag_b = 1;
			}
			if (map[i    ][j + 1] == -8){
				 flag_w = 1;
			}
			if (map[i - 1][j] == -4){
				 flag_b = 1;
			}
			if (map[i - 1][j] == -8){
				 flag_w = 1;
			}
			if (map[i + 1][j] == -4){
				 flag_b = 1;
			}
			if (map[i + 1][j] == -8){
				 flag_w = 1;
			}

			cnt = 1;

			do {
				flag = 0;
				for (i = 1; i <= h; i++){
					for (j = 1; j <= w; j++){
						if (map[i][j] == -2){
							if (map[i    ][j - 1] == n ||
								map[i - 1][j    ] == n ||
								map[i    ][j + 1] == n ||
								map[i + 1][j    ] == n){
								
								map[i][j] = n;
								flag = 1;
								cnt++;

								if (map[i    ][j - 1] == -4){
									 flag_b = 1;
								}
								if (map[i    ][j - 1] == -8){
									 flag_w = 1;
								}
								if (map[i    ][j + 1] == -4){
									 flag_b = 1;
								}
								if (map[i    ][j + 1] == -8){
									 flag_w = 1;
								}
								if (map[i - 1][j] == -4){
									 flag_b = 1;
								}
								if (map[i - 1][j] == -8){
									 flag_w = 1;
								}
								if (map[i + 1][j] == -4){
									 flag_b = 1;
								}
								if (map[i + 1][j] == -8){
									 flag_w = 1;
								}
							}
						}
					}
				}
			} while (flag == 1);
	
			if (flag_b == 1 && flag_w == 0){
				nb += cnt;
			}
			else if (flag_b == 0 && flag_w == 1){
				nw += cnt;
			}
			n++;
#if 0			
			for (i = 1; i <= h; i++){
				for (j = 1; j <= w; j++){
					printf("%4d", map[i][j]);
				}
				printf("\n");
			}
#endif
			
			
			
		}
		
		printf("%d %d\n", nb, nw);
	}
	return (0);
}

									

Measured memory_bytes: 620
#include<stdio.h>
int main(void) {
	char a[5];
	int i, j;
	int ans = 0;
	scanf("%s", &a);
	
	int count = 0;
	int count2 = 0;
	char count3;
	char count4;


	count3 = a[0];

	for (i = 1; a[i] != '\0'; i++) {
		if (count3 != a[i]) {
			count4 = a[i];
			break;
		}
	}
	

	for (i = 0; a[i] != '\0'; i++) {
		if (a[i] == count3) {
			count++;
			if (count > 2) {
				printf("No\n");
				break;
			}
		}
		else if (a[i] == count4) {
			count2++;
			if (count2 > 2) {
				printf("No\n");
				break;
			}
		}
		else {
			printf("No\n");
			break;
		}
	}

	if (count == 2 && count2 == 2) {
		printf("Yes\n");
	}

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){int n;
cin>>n;
priority_queue<int> pq;
for(int i=0;i<n;i++){
    int a;
    cin>>a;
    pq.push(a);
}
int alice=0,bob=0;
while(!pq.empty()){
alice+=pq.top();
pq.pop();
if(!pq.empty()){
bob+=pq.top();
pq.pop();}
}
cout<<alice-bob<<endl;
}



Measured memory_bytes: 256
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Arrays;
public class Main {
	public static void main(String args[]) {
		Sc sc = new Sc(System.in);
		int n = sc.nI();
		long pairs = 0;
		long remainder = 0;
		for(int i = 0; i<n; i++) {
			long a = sc.nI();
			pairs += (a+remainder)/2;
			remainder = (a == 0) ? 0 : (a+remainder)%2;

		}
		System.out.println(pairs);
	}
}
class Sc {
    public Sc(InputStream i) {
        r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasM() {
        return peekToken() != null;
    }

    public int nI() {
        return Integer.parseInt(nextToken());
    }

    public double nD() { 
        return Double.parseDouble(nextToken());
    }

    public long nL() {
        return Long.parseLong(nextToken());
    }

    public String n() {
        return nextToken();
    }

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null) 
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}

Measured memory_bytes: 19860
N = int(input())
A = list(map(int,input().split()))
count = [0]*N
for i in range(N):
    count[A[i]-1] += 1
s = 0
for i in range(N):
    s += count[i] * (count[i]-1) // 2
for i in range(N):
    if count[A[i]-1] == 0 or count[A[i]-1] == 1:
        print(s)
    else:
        print(s - count[A[i]-1] + 1)

Measured memory_bytes: 24748
#include<cstdio>
#include<cstring>
const int N=2e5+7;
char s[N];
int t,l=1,n,nxt[N][26],qwq[26],qaq[N];
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	for(int i=1;i<=n;++i)if((t|=1<<(s[i]-97))==67108863)++l,t=0;
	for(int i=0;i<26;++i)qwq[i]=n+1;
	t=0;
	for(int i=n;~i;--i){
		memcpy(nxt[i],qwq,sizeof qwq);
		qwq[s[i]-97]=i;
		qaq[i]=qaq[i+1];
		if((t|=1<<(s[i]-97))==67108863)t=0,++qaq[i];
	}
	int nw=0;
	for(int i=1;i<l;++i){
		for(int c=0;c<26;++c){
			int to=nxt[nw][c];
			if(to<=n&&qaq[to+1]<l-i){
				putchar(c+97);
				nw=to;
				break;
			}
		}
	}
	t=0;
	for(int i=nw+1;i<=n;++i)t|=1<<(s[i]-97);
	for(int i=0;i<26;++i)if(t>>i&1^1)return putchar(i+97),0;
	return 0;
}

Measured memory_bytes: 21504
import Data.Array.IArray
import Data.Char

solve :: Char -> Array Char String -> Char
solve c a = case a!c of
              []     -> c
              (x:xs) -> let a' = a // [(c, xs)]
                         in solve x a'

main :: IO ()
main = do
    s <- listArray ('a', 'c') . lines <$> getContents :: IO (Array Char String)
    putChar . toUpper $ solve 'a' s

Measured memory_bytes: 508
#include "bits/stdc++.h"
using namespace std;

long long devide(long long n, long long x) {
    if (n < 0) return 0;
    return n / x + 1;
}

int main() {
    long long a, b, x;
    cin >> a >> b >> x;
    
    long long cnt = devide(b, x) - devide(a - 1, x);
    
    cout << cnt << endl;
    
    return 0;
}


Measured memory_bytes: 256
//                _                                      
//  ___ _ __ ___ (_) __ ___      ___   _ _ __ ___  _ __  
// / __| '_ ` _ \| |/ _` \ \ /\ / / | | | '_ ` _ \| '_ \ 
// \__ \ | | | | | | (_| |\ V  V /| |_| | | | | | | |_) |
// |___/_| |_| |_|_|\__, | \_/\_/  \__,_|_| |_| |_| .__/ 
//                  |___/                         |_|  
//code by smigwump
//https://codeforces.com/blog/entry/62393 hashing hack protection
//https://codeforces.com/blog/entry/61587 rand() alternatives
//https://codeforces.com/blog/entry/61675 randomized hack protection
#include <bits/stdc++.h>
typedef long long ll;
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define REP(i,a,b) for(ll i = a; i <= b; i++)
#define PER(i,a,b) for(ll i = a; i >= b; i--)

using namespace std;

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

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll series = 7%n;
    bool flag = 0;
    REP(i,1,1e7) {
        if(series==0) {
            cout<<i;
            flag = 1;
            break;
        }
        series = ((series*10) + 7)%n;
    }
    if(!flag) {
        cout<<"-1";
    }
	return 0;
}

Measured memory_bytes: 3624
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <deque>
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}


#define INF 1e9+7
#define LLINF 1e18+7
const ll MOD=1e9+7;
const int N=500000;

main(){
    ll m=lin();
    ll ans=-1,sum=-1;
    rep(i,m){
        ll d=lin(),c=lin();
        ans+=c;
        sum+=d*c;
    }
    cout<<ans+sum/9ll;
}

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

const int MAX = 510000;
const int MOD = 1000000007;
long long 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;
    }
}

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

int main() {
    COMinit();
    long long n, a, b;
    cin >> n >> a >> b;
    long long res = powmod(2LL, n) - 1;
    
    long long tmp = 1;
    for(long long i=0; i<a; ++i) tmp = tmp * (n - i) % MOD;
    tmp = tmp * finv[a] % MOD;
    res = (res - tmp) % MOD;
    res = (res + MOD) % MOD;
    
    tmp = 1;
    for(long long i=0; i<b; ++i) tmp = tmp * (n - i) % MOD;
    tmp = tmp * finv[b] % MOD;
    res = (res - tmp) % MOD;
    res = (res + MOD) % MOD;

    cout << res << endl;
}

Measured memory_bytes: 12288
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace AtCoder.B
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var inputs = ReadLongs();
            var N = inputs[0];
            var K = inputs[1];
            var H = ReadLongs();

            return H.Count(x => x >= K);
        }

        #region Console

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


Measured memory_bytes: 19680
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

vector<ll> divisor(ll a){
	vector<ll> res; res.clear();
	for (ll i = 1LL; i * i <= a; ++i){
		if (a % i == 0LL){
			res.push_back(i);
			if (i * i < a){
				res.push_back(a/i);
			} // end if
		} // end if
	} // end for
	sort(ALL(res));
	return res;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll N, M; cin >> N >> M;

	vector<ll> d = divisor(M);
	int ind1 = lower_bound(ALL(d), M/N) - d.begin();
	int ind2 = upper_bound(ALL(d), M/N) - d.begin();

	ll res = 0LL;
	if (ind1 == ind2){	// M/N より大きい
		res = d[ind1-1];
	}else{			// M/N と等しい
		res = d[ind1];
	} // end if
 
	cout << res << endl;

	return 0;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

// {{{
template<typename T>
void printmatrix(vector<vector<T> > ar){
    for (int i = 0; i < (int)ar.size(); i++) {
        for (int j = 0; j < (int)ar[0].size(); j++) {
            cout << ar[i][j];
        }
        cout << endl;
    }
}

template<typename T>
void printvector(vector<T> vec){
    for (int i = 0; i < (int)vec.size(); i++) {
        cout << vec[i] << endl;
    }
}

template<typename T>
void unique(vector<T>& vec){
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

template<typename T>
vector<T> cumsum(vector<T> vec){
    vector<T> newvec((T)vec.size());
    int tmp = 0;
    for (int i = 0; i < (int)vec.size(); i++) {
        tmp += vec[i];
        newvec[i] = tmp;
    }

    return newvec;
}

template<typename T>
T digitsum(T x){
    T y=0;
    while(x){
        y += x % 10;
        x /= 10;
    }

    return y;
}

template<typename T>
T gcd(T x, T y){
    if (x == 0 || y == 0) {
        return 0;
    }

    while (x != y){
        if (x > y) {
            x -= y;
        }else{
            y -= x;
        }
    }
    return x;
}

// }}}
/* vim:set foldmethod=marker: */

void solve(){
    int n;
    cin >> n;

    cout << n * 800 - (n / 15) * 200 << endl;

    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}

// sortの仕方
// int a[N];
// array<int,N> ar;
// vector<int> v;
//
// sort(a, a+N); // 配列
// sort(ar.begin(), ar.end()); // array
// sort(v.begin(), v.end()); // vector 昇順
// sort(v.begin(), v.end(), greater<int>()); // 降順

// Template
// template <class T>
// T foomax(T x, T y){
//   if (x > y){
//     return x;
//   }else{
//     return y;
//   }
// }

// string を int に変換 stoi("1010")
// int を string に変換 to_string(1010)


// map の key, value を全て抜き出す。
// for (auto itr = mp.begin(); itr != mp.end(); itr++) {
//     cout << "key" << itr->first << " value" << itr->second << endl;
// }

// 文字列の検索
// string s="abc";
// if (s.find('d') == string::npos){
//     cout << "find" << endl;
// }else{
//     cout << "not find" << endl;
// }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<double,double> pd;
#define MAXN 100005

bool prime[MAXN];
void sieve(){
    memset(prime,true,sizeof(prime));
    for(int i = 2 ; i * i <= MAXN ; i++){
        if(!prime[i])continue;
        for(int j = i*i ; j <= MAXN ; j+= i){
            prime[j] = false;
        }
    }
}

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

    int X;
    cin >> X;
    sieve();
    for(int i = X ; i <= MAXN ; i++){
        if(prime[i]){
            cout << i << '\n';
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
int main(void){
    int A, B;
    scanf("%d",&A);
    scanf("%d",&B);
    int c=A+B;
    if(c<24){
        printf("%d\n",c);
    }
    else{
        printf("%d\n",c-24);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

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

	ll x;
	cin >> x;
	ll ans = x / 11 * 2;
	if (x % 11 == 0) {}
	else if (x % 11 <= 6) ans++;
	else ans += 2;
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  double data;
  while(cin>>data){
    if(data<=48.00){
      cout<<"light fly"<<endl;
    }if(data>48.00&&51.00>=data){
      cout<<"fly"<<endl;
    }if(data>51.00&&54.00>=data){
      cout<<"bantam"<<endl;
    }if(data>54.00&&57.00>=data){
      cout<<"feather"<<endl;
    }if(data>57.00&&60.00>=data){
      cout<<"light"<<endl;
    }if(data>60.00&&64.00>=data){
      cout<<"light welter"<<endl;
    }if(data>64.00&&69.00>=data){
      cout<<"welter"<<endl;
    }if(data>69.00&&75.00>=data){
      cout<<"light middle"<<endl;
    }if(data>75.00&&81.00>=data){
      cout<<"middle"<<endl;
    }if(data>81.00&&91.00>=data){
      cout<<"light heavy"<<endl;
    }if(data>91.00){
      cout<<"heavy"<<endl;
    }
  }
  return 0;
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;
using graph = mat;
using edge = pair<ll,ll>;
using wgraph = vector<vector<edge>>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back


int main()
{
    ll N;
    string S, T;
    cin >> N;
    cin >> S >> T;

    REP(i,0,N) cout << S[i] << T[i];
    cout << endl;


    return 0;
}

/*



*/

Measured memory_bytes: 256
N = int(input())
trains = []
for _ in range(N - 1):
    cost, start, f = map(int, input().split())
    trains.append([cost, start, f])

# print(trains)
for station_index in range(N - 1):
    ans = 0
    for j in range(station_index, N - 1):
        cost, start, f = trains[j]
        if ans < start:
            ans = start + cost
        elif ans == start:
            ans += cost
        else:
            if (ans - start) % f == 0:
                ans += cost
            else:
                ans += (f - (ans - start) % f) + cost
    print(ans)
print(0)


Measured memory_bytes: 9212
/*
//A
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while(true)

int main() {
	int A, B;
	cin >> A >> B;
	cout << A * B - A - B + 1 << endl;
	return 0;
}
*/


//B
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while(true)

int main() {
	int N;
	cin >> N;
	int ans = 0;
	for (int i = 1; i <= N; i++) {
		if (i % 2 == 0) continue;
		int tmp = 0;
		for (int j = 1; j <= i; j++) {
			if (i % j == 0) tmp++;
		}
		if (tmp == 8) ans++;
	}
	cout << ans << endl;
	
	return 0;
}


/*
//C
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while(true)

int main() {

return 0;
}
*/

/*
//D
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while(true)

int main() {

return 0;
}
*/


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

inline void read(int &a)
{
    a=0;int c=getchar();
    while(c>'9'||c<'0') c=getchar();
    while(c>='0'&&c<='9') a=(a<<3)+(a<<1)+c-48,c=getchar();
}

const int N=105;
struct city{
	string name;
	int w,id;
	bool operator<(const city &b)const
	{
		if(name==b.name) return w>b.w;
		return name<b.name;
	}
}a[N];
int n,b[N];

int main()
{
	read(n);
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].name;
		read(a[i].w);
		a[i].id=i;
	}
	sort(a+1,a+1+n);
	for(int i=1;i<=n;i++) cout<<a[i].id<<'\n';
	return 0;
}

Measured memory_bytes: 256
n=int(input())
ans_t=1
ans_a=1
for i in range(n):
    t,a=map(int,input().split())
    if t==1:
        k1=ans_t
    else:
    	k1=(ans_t-1)//t+1
    if a==1:
        k2=ans_a
    else:
    	k2=(ans_a-1)//a+1
    k=max(k1,k2)
    ans_t=k*t
    ans_a=k*a
print(ans_t+ans_a)

Measured memory_bytes: 9048
N=int(input())
mod=10**9+7

def prime_factorization(n):
    '''
    素因数分解を求める

    Parameters:
    n : int
        求める数
    
    Returns:
    r : list
        素因数分解の結果
    '''
    r=[1]*(n+1)
    for i in range(1,n+1):
        for j in range(2,i+1):
            while i % j == 0:
                r[j] += 1
                i //= j
    
    return r

r = prime_factorization(N)
ans = 1
for i in r:
    ans *= i
    ans %= mod

print(ans)


Measured memory_bytes: 39408
#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
#define rreps(i, n) for(int i=((int)(n)); i>0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pl(s) cout << (s) << "\n";
#define pls(...) {bool space = false; for(auto i : __VA_ARGS__) (cout << (space?" ":"") << i), space = true; cout << "\n";}
#define plexit(s) {cout << (s) << "\n"; exit(0);}
#define yes(s) cout << ((s)?"Yes":"No") << "\n";
#ifdef __LOCAL
#include <dump.hpp>
#define dump(...) DUMPOUT << "  " << string(#__VA_ARGS__) << ": " << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" << endl << "    ", dump_func(__VA_ARGS__)
#else
#define dump(...)
#endif
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct IOInit { IOInit() { cin.tie(nullptr); ios::sync_with_stdio(false); dump("READY"); /*cout << unitbuf;*/} } IO_INIT;
using ll = long long; using ull = unsigned long long; using ld = long double;
template<typename T = int> using V = vector<T>; template<typename T = int> using P = pair<T, T>;
using Vi = V<int>; using Vl = V<ll>; using Vd = V<ld>; using VVi = V<Vi>; using VVl = V<Vl>; using Pi = P<int>; using Pl = P<ll>; using Pd = P<ld>;
constexpr ll MOD = 1000000007; constexpr int INF = (1 << 30) - 1; constexpr ll INFL = 1LL << 60; constexpr ld EPS = 1e-12; constexpr ld PI = 3.141592653589793238462643383279;



signed main(void) {
  int d; cin >> d;
  const int N = 26;
  Vi c(N); rep(i,N) cin >> c[i];
  VVi s(d, Vi(N)); rep(i,d) rep(j,N) cin >> s[i][j];
  Vi last(N);

  auto getScore = [](int d, Vi& c, VVi& s, Vi& t) -> int {
    Vi last(N);
    int ret = 0;
    reps(i,d) {
      ret += s[i-1][t[i-1]];
      last[t[i-1]] = i;
      rep(j,N) ret -= c[j] * (i - last[j]);
      //pl(ret)
    }
    return ret;
  };

  Vi t(d); reps(i,d) {
    int ma = -INF;
    t[i-1] = 0;
    rep(j,N) {
      int ret = s[i-1][j];
      last[j] = i;
      rep(k,N) ret -= c[k] * (i - last[k]);
      if(chmax(ma,ret)) {
        t[i-1] = j;
      }
    }
  }

  //dump(getScore(d, c, s, t));

  rep(i,d) {
    pl(t[i]+1)
  }



  // int m; cin >> m;
  // rep(i,m) {
  //   int d, q; cin >> d >> q;
  //   --d; --q;
  //   t[d] = q;
  //   pl(getScore())
  // }
  return 0;
}


Measured memory_bytes: 3716
/*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES

#include <iostream> // ?¨??????\??????
#include <fstream>  // ??????????????\??????
#include <string>   // ???????????¢???
#include <vector>   // ???????????????
#include <cmath>    // ??°??????
#include <iomanip>  // stream???????????¢???
#include <algorithm>// max??¢??°??????

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;        // ????´???°????????????????????????
using std::fixed;         // ???????????????????¨???????????????????????????????
using std::setprecision;  // ?????°????°???°?????\???????????°????????????????????¨????????\???

void out1(vector<int> a) {
	for (size_t i = 0; i < a.size(); i++)
	{
		cout << a[i] << " ";
	}
	cout << endl;
}

int main() {
	int w, n;
	cin >> w;	// ???????????°
	cin >> n;	// ?¨?????????°
	vector<int> begin(n);
	vector<int> end(n);
	vector<int> location(w);
	int num1 = 0;
	int num2 = 0;

	// ??\???
	for (size_t i = 0; i < n; i++)
	{
		scanf("%d,%d", &begin[i], &end[i]);
	}

	// location????????????
	for (size_t i = 0; i < w; i++)
	{
		location[i] = i + 1;
		
	}
	
	// ????????\??¬????????§????????????
	for (size_t i = 0; i < w; i++)
	{
		vector<int> tmp(w,0);
		//out1(tmp);
		tmp[i] = location[i];
		//cout << "----i = " << i << "?????¨???----" << endl;
		for (size_t j = 0; j < n; j++)
		{
			if (begin[j] == location[i])
			{
				
				//cout << begin[j] << "???" << end[j] << "?????\???????????????" << endl;
				location[i] = end[j];
			}
			else if (end[j] == location[i])
			{
				//cout << end[j] << "???" << begin[j] << "?????\???????????????" << endl;
				location[i] = begin[j];
			}
			//out1(location);
		}
	}
	// ???????????????
	vector<int> output(w,0);
	for (size_t i = 0; i < w; i++)
	{
		output[location[i]-1] = i;
	}

	// ???????????¨???????????????????????°??????1????¶????
	for (size_t i = 0; i < w; i++)
	{
		cout << output[i]+1 << endl;
	}


	return 0;
}

Measured memory_bytes: 3168
package main

import(
    "fmt"
)

func main() {
    var n int
    var s string
    fmt.Scan(&n, &s)
    if n % 2 == 1 {
        fmt.Println("No")
        return
    } else {
        for i:=0;i < n/2;i++ {
            if s[i:i+1] != s[n/2+i:n/2+i+1] {
                fmt.Println("No")
                return
            } 
        }
        fmt.Println("Yes")
    }
}



Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,c=0,k;
    double ans,ans1;
    cin>>n>>m;
    int a[n][m];
    int i,j;
    for(i=0; i<n; i++)
        for(j=0; j<m; j++)
            cin>>a[i][j];
    for(i=0; i<n-1; i++)
    {
        for(k=i+1;k<n;k++){
        ans=0.0;
        for(j=0; j<m; j++)
        {
            ans=ans+((a[i][j]-a[k][j])*(a[i][j]-a[k][j]));
        }
        ans=double(sqrt(ans));
        if(ans==int(ans))
            c++;
        }
    }

    cout<<c<<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 all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  int N,K;
  cin>>N>>K;
  string S;
  cin>>S;
  rep(i,N){
    if(i==K-1) cout<<char(S[i]-'A'+'a');
    else cout<<S[i];
  }
  cout<<endl;
}

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


int main()
{
    int h, n, tmp;
    cin >> h >> n;

    for (int i=0; i<n; ++i) {
        cin >> tmp;
        h -= tmp;
    }

    cout << (h <= 0 ? "Yes" : "No") << endl;


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <climits>
#define ll long long
#define MAX 25 * 1e13
#define N  200010

#define SIZE(A) ((int)A.size())
#define LEN(A) ((int)A.length())
#define MP(A,B) make_pair(A,B)
#define PB(X) push_back(X)
#define EB(X) emplace_back(X)
#define REP(i,a) for(int i=0;i<(a);++i)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define range(a) a.begin(), a.end()
#define VI vector<int>;

using namespace std;
int MOD = 1000000007;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  int cntt = a/d;// cnt of attack reveived by T
  int cnta = c/b;
  int flag = 1;
  while (1) {
    c -= b;
    if( c <= 0 ) {
      cout << "Yes" << endl;
      break;
    }
    a -= d;
    if( a <= 0 ) {
      cout << "No" << endl;
      break;
    }
  }
  return 0;
}



Measured memory_bytes: 3132
#include <iostream>

using namespace std;

int main(){
  string s,p;
  cin >> s >> p;
  s=s+s;
  int i,j;
  for (i=0;i<s.length();i++) {
    for (j=0;j<p.length();j++) {
      if (s[i+j] != p[j]) break;
      if (j==p.length()-1) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}



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

int main(){
	int N;
  	double ans = 0,x;
  	cin>>N;
  	for(int i =0;i<N;i++){
    	cin>>x;
      	ans+=(1/x);
    }
	printf("%.5f",1/ans);

	return 0;
}

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

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

using namespace std;

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

    int N, M, X;
    cin >> N >> M >> X;
    vector<int> C(N);
    vector<vector<int>> A(N, vector<int>(M));
    REP(i, N) {
        cin >> C[i];
        REP(j, M) cin >> A[i][j];
    }

    constexpr int INF = INT_MAX;

    int result = INF;

    REP(bit, 1 << N) {
        vector<int> understanding(M, 0);
        int cost = 0;
        REP(i, N) {
            if (bit & (1 << i)) {
                REP(j, M) {
                    understanding[j] += A[i][j];
                }
                cost += C[i];
            }
        }
        bool learn_all = true;
        REP(j, M) {
            if (understanding[j] < X) {
                learn_all = false;
                break;
            }
        }
        if (learn_all) {
            result = min(result, cost);
        }
    }

    if (result == INF) {
        cout << -1 << endl;
    } else {
        cout << result << endl;
    }

    return 0;
}


Measured memory_bytes: 3632
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define INF (2 << 28)
#define fr first
#define sc second
using namespace std;

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

int n;
iP bug[311111]; //first: release, second: capacity
priority_queue<iP, vector<iP>, greater<iP> > que; 

int main(){

  cin >> n;
  for(int i = 0; i < n; i++) cin >> bug[i].fr >> bug[i].sc;
  
  sort(bug, bug + n);
  int maxi = 0, cap = INF;
  ll sum = 0;
  for(int i = 0; i < n; i++){
    cap = min(bug[i].sc, cap);
    sum += bug[i].fr;
    que.push(iP(bug[i].sc, bug[i].fr));
    while(sum > (ll)cap * (int)que.size() && !que.empty()){
      iP p = que.top(); que.pop();
      sum -= p.sc;
      cap = (que.empty() ? INF : que.top().fr);
    }
    maxi = max(maxi, (int)que.size());
  }
  cout << maxi << endl;
}

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

int main() {
    int n, q;
    while (cin >> n >> q, n | q) {
        vector<int> state(n, -1);
        for (int i = 0; i < q; i++) {
            char ch;
            cin >> ch;

            if (ch == 's') {
                int id, w;
                cin >> id >> w;

                bool possible = false;
                for (int pos = 0; pos < n; pos++) {
                    if (state[pos] < 0) {
                        bool valid = (pos + w) <= n;
                        for (int j = pos; j < min(n, pos + w); j++) {
                            if (state[j] >= 0) valid = false;
                        }
                        if (valid) {
                            cout << pos << endl;
                            for (int j = pos; j < pos + w; j++) {
                                state[j] = id;
                            }
                            possible = true;
                            break;
                        }
                    }
                }
                if (!possible) cout << "impossible" << endl;
            } else {
                int id;
                cin >> id;
                for (int pos = 0; pos < n; pos++) {
                    if (state[pos] == id) {
                        state[pos] = -1;
                    }
                }
            }
        }
        cout << "END" << endl;
    }
    return 0;
}

Measured memory_bytes: 3068
s = input()

def is_even(s):
    for i in range(len(s) // 2):
        if s[i] != s[i + len(s) // 2]:
            return False
    return True

for i in range(len(s) - 2, 0, -2):
    if is_even(s[0:i]):
        print(len(s[0:i]))
        break

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
const int M = 1000000007;

int main() {
    while (1) {
        int n;
        cin >> n;
        if (!n) return 0;

        vector<vector<int>> t(n, vector<int>(n + 1));
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n + 1; ++j) {
                cin >> t[i][j];
            }
        }
        vector<int> dp(1 << n, M);
        dp[0] = 0;
        for (int i = 1; i < (1 << n); ++i) {
            for (int j = 0; j < n; ++j) {
                if ((i >> j) & 1) {
                    int mi = t[j][0];
                    for (int k = 0; k < n; ++k) {
                        if (j != k && ((i >> k) & 1))
                            mi = min(mi, t[j][k + 1]);
                    }
                    dp[i] = min(dp[i], dp[i ^ (1 << j)] + mi);
                }
            }
        }
        cout << dp[(1 << n) - 1] << "\n";
    }
}

Measured memory_bytes: 3412
#include<stdio.h>
main()
{
	long long a,b,n,x,i,m=0,a1,a2;
	scanf("%lld %lld %lld",&a,&b,&n);
	if(b-1>=n) x=n;
	else x=b-1; 
       a1=a*x/b;
		a2=x/b;
			m=a1-a*a2;
	printf("%lld",m);
}

Measured memory_bytes: 2144
import java.util.Scanner;
import java.lang.String;

public class Main {

    public static void main(String[] args) {
        int A1, A2, sum, A3;
        Scanner scan = new Scanner(System.in);
        A1 = scan.nextInt();
		A2 = scan.nextInt();
      	A3 = scan.nextInt();
        sum = A1+A2+A3;
      	if(sum>=22){
          System.out.print("bust");
        }else{
          System.out.print("win");
        }

        
    }
}

Measured memory_bytes: 22868
#include <cstdio>
#include <cstdint>
#include <numeric>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>

int main() {
  size_t n;
  scanf("%zu", &n);

  char buf[4096];
  scanf("%s", buf);
  std::string s = buf;
  std::string t = "RGB";

  intmax_t res = 0;
  for (size_t i = 1; i+1 < n; ++i) {
    std::map<char, std::vector<bool>> lf, rg;
    std::map<char, intmax_t> lx, rx;
    for (char c: t) {
      if (c == s[i]) continue;
      lf[c].resize(i, false);
      rg[c].resize(n-i-1, false);
      lx[c] = 0;
      rx[c] = 0;
    }
    for (size_t j = 0; j < i; ++j) {
      size_t i0 = i-j-1;
      if (s[j] == s[i]) continue;
      lf[s[j]][i0] = true;
      ++lx[s[j]];
    }
    for (size_t j = i+1; j < n; ++j) {
      size_t i0 = j-i-1;
      if (s[j] == s[i]) continue;
      rg[s[j]][i0] = true;
      ++rx[s[j]];
    }

    size_t m = std::min(i, n-i-1);
    for (char c: t) {
      if (c == s[i]) continue;
      for (char d: t) {
        if (d == s[i] || d == c) continue;
        res += lx[c] * rx[d];
        for (size_t j = 0; j < m; ++j) {
          if (lf[c][j] && rg[d][j]) --res;
        }
      }
    }
  }
  printf("%jd\n", res);
}


Measured memory_bytes: 3372
#include <iostream>
using namespace std;
 
int main() {
    char C;
    cin >> C;
    if(C == 'a')cout << 'b' << endl;
    if(C == 'b')cout << 'c' << endl;
    if(C == 'c')cout << 'd' << endl;
    if(C == 'd')cout << 'e' << endl;
    if(C == 'e')cout << 'f' << endl;
    if(C == 'f')cout << 'g' << endl;
    if(C == 'g')cout << 'h' << endl;
    if(C == 'h')cout << 'i' << endl;
    if(C == 'i')cout << 'j' << endl;
    if(C == 'j')cout << 'k' << endl;
    if(C == 'k')cout << 'l' << endl;
    if(C == 'l')cout << 'm' << endl;
    if(C == 'm')cout << 'n' << endl;
    if(C == 'n')cout << 'o' << endl;
    if(C == 'o')cout << 'p' << endl;
    if(C == 'p')cout << 'q' << endl;
    if(C == 'q')cout << 'r' << endl;
    if(C == 'r')cout << 's' << endl;
    if(C == 's')cout << 't' << endl;
    if(C == 't')cout << 'u' << endl;
    if(C == 'u')cout << 'v' << endl;
    if(C == 'v')cout << 'w' << endl;
    if(C == 'w')cout << "x" << endl;
    if(C == 'x')cout << 'y' << endl;
    if(C == 'y')cout << 'z' << endl;
}

Measured memory_bytes: 256
n=int(input())
d=list(map(int,input().split()))
mod=998244353
from collections import Counter

c=dict(Counter(d))
c=sorted(c.items(),key=lambda x: x[0])


if d[0]!=0:
    print(0)
    exit(0)

if c[0][1]!=1:
    print(0)
    exit(0)

for i in range(1,len(c)):
    if c[i][0]!=c[i-1][0]+1:
        print(0)
        exit(0)

ans=1
for i in range(1,len(c)):
    ans*=c[i-1][1]**(c[i][1])

print(ans%mod)
        

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

int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    if(n%2==0){
        for(int i=0;i<n;i+=2){
            if(a[i]!=a[i+1]||a[i]!=i+1){
                cout<<0<<endl;
                return 0;
            }
        }
    }
    else{
        if(a[0]!=0){
            cout<<0<<endl;
            return 0;
        }
        for(int i=1;i<n;i+=2){
            if(a[i]!=a[i+1]||a[i]!=i+1){
                cout<<0<<endl;
                return 0;
            }
        }
    }
    int b=n/2;
    long long ans=1;
    for(int i=0;i<b;i++){
        ans=(ans*2)%1000000007;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll digsz(ll x){if(x==0) return 1;else{ll ans=0;while(x){x/=10;ans++;}return ans;}}
ll digsum(ll x){ll sum=0;while(x){sum+=x%10;x/=10;}return sum;}
vector<ll> pw3(15,1);vector<ll> pw10(19,1);
int main(){
    {rep1(i,14) pw3[i]=3*pw3[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    
    ll A,B,N; cin>>A>>B>>N;
    ll X=min(B-1,N);
    cout<< (A*X)/B - A*(X/B) <<endl;
}


Measured memory_bytes: 3608