akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <unistd.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 3e18;
const ll fact_table = 800008;
double Pi = 3.1415926535897932384626;
 
//vector<ll> G[550010];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←
 
 
#define p(x) cout<<x<<"\n";
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
 
 
//ll mod = 998244353;
ll mod = 1000000007;
 
ll rui(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
 
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
 
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
 
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
 

ll fact[fact_table + 5],rfact[fact_table + 5];
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = rui(fact[fact_table],mod - 2);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}

 
ll n,m,num,sum,a,b,c,d,e,g,h,w,i,j,q,r,l;
ll k;
ll ans;
ll x[200005], y[500005], z[200005];
bool used[500005];
char s[500005];
ll query;

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

    c3_init();
    cin >> n;
    for(ll i=0;i<n;i++){
        cin >> x[i];
    }
    sort(x, x + n);
    reverse(x, x + n);
    ll ans = 0;
    for(ll i=0;i<n;i++){
        ll tmp;
        if(i == 0){
            tmp = 1;
        } else {
            tmp = (i + 2) * rui(2, i - 1);
        }
        tmp %= mod;
        tmp *= x[i];
        tmp %= mod;
        tmp *= rui(2ll, n - 1 - i);
        tmp %= mod;
        ans += tmp;
        ans %= mod;
    }
    ans *= rui(2ll, n);
    ans %= mod;
    p(ans);


    return 0;
}











Measured memory_bytes: 26496
#include<bits/stdc++.h>
#include<algorithm>
#include<vector>
#define ll long long int 
#define vi vector<int>
using namespace std;
int main()
{
  ll i,j,n,a,b,c,k;
  cin>>a>>b>>c>>k;
  if(k<=a+b)
  {
     cout<<min(a,k);
  }
  else{
    i=a*1+b*0;
    cout<<((k-(a+b))*(-1))+i;
  }
}

Measured memory_bytes: 3616
import sys
import heapq
T = int(input())
from collections import deque
for t in range(T):
  N,A,B,C,D = map(int,input().split())
  q = [(0, N)]
  heapq.heapify(q)
  seen = set()
  while q:
    cost,n = heapq.heappop(q)
    if n in seen:
      continue
    seen.add(n)
    if n == 0:
      print(cost)
      break

    heapq.heappush(q, (cost + n * D, 0))
    if n % 2 == 0:
      heapq.heappush(q, (cost + A, n // 2))
    else:
      heapq.heappush(q, (cost + D + A, (n + 1) // 2))
      heapq.heappush(q, (cost + D + A, (n - 1) // 2))

    if n % 3 == 0:
      heapq.heappush(q, (cost + B, n // 3))
    else:
      rest = n % 3
      heapq.heappush(q, (cost + rest * D + B, (n - rest) // 3))
      heapq.heappush(q, (cost + (3 - rest) * D + B, (n - rest + 3) // 3))

    if n % 5 == 0:
      heapq.heappush(q, (cost + C, n // 5))
    else:
      rest = n % 5
      heapq.heappush(q, (cost + rest * D + C, (n - rest) // 5))
      heapq.heappush(q, (cost + (5 - rest) * D + C, (n - rest + 5) // 5))


Measured memory_bytes: 12816
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007
//S.size()
//配列名.Length()
using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;


int main(void){
	int N; cin>>N;
	int num;
	int cnt = 0;
	int ans;
	int max = -MOD;
	for(int i = 1; i <= N; i++){
		cnt = 0;
		num = i;
		while (num % 2 == 0){
			cnt++;
			num /= 2;
		}
		if(cnt >= max){
			max = cnt;
			ans = i;
		}
	}
	cout<<ans;
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	string N;
	cin >> N;

	bool ok = false;
	for (int a = 0; a < N.length(); ++a)
		if (N[a] == '9')
			ok = true;

	if (ok)
		cout << "Yes";
	else
		cout << "No";

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,a[100005];
int main()
{
	scanf("%d",&n);
	n*=2;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int ans=0;
	for(int i=1;i<=2*n;i+=2)
		ans+=min(a[i],a[i+1]);
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 1740
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int x = stdIn.nextInt();
		int t = stdIn.nextInt();
		
		System.out.println((n+x-1)/x*t);
		
		

	}

}


Measured memory_bytes: 35856
#include <bits/stdc++.h>
using namespace std;
typedef priority_queue <int> pi;
typedef priority_queue <int, vector<int>, greater<int>> pg;
typedef unsigned long long int ulli;

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    long long int X, Y;
    cin >> X >> Y;
    long long int ans = 0;
    while(X != 0 || Y != 0) {
        if(X != 0 && Y!= 0) {
            if(A + B < C * 2) {
                ans += (A + B);
                --X;
                --Y;
            } else {
                ans += C * 2;
                --X;
                --Y;
            }
        }else if(X != 0 && Y == 0) {
            if(A < C * 2) {
                ans += A;
                --X;
            } else {
                ans += C * 2;
                --X;
            }
        } else if(X == 0 && Y != 0) {
            if(B < C * 2) {
                ans += B;
                --Y;
            } else {
                ans += C * 2;
                --Y;
            }
        }
    }

    cout << ans << endl;
}

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

int main(){
  int k,s;
  int count=0;
  cin >> k >> s;
  
  for(int x=0; x<=k; x++){
    for(int y=0; y<=k; y++){
      if((x+y >= s-k)&&(x+y <= s)){
		count++;
      }
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define dmp(x) cerr<<#x<<":"<<x<<endl
typedef pair<int,int> P;
typedef pair<int,P> PP; 
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
const int MOD = 1e9+7;

struct Dice{
  
  int t,s,e,w,n,b;
  
  Dice(int n1,int n2,int n3,int n4,int n5,int n6){
    t=n1;//top
    s=n2;//south
    e=n3;//east
    w=n4;//west
    n=n5;//north
    b=n6;//bottom
  }
  
  void roll(char direction){
    if(direction=='S'){
	 int tmp=s;
	 s=t,t=n,n=b,b=tmp;
    }
    if(direction=='N'){
	 int tmp=n;
	 n=t,t=s,s=b,b=tmp;
    }
    if(direction=='E'){
	 int tmp=e;
	 e=t,t=w,w=b,b=tmp;
    }
    if(direction=='W'){
	 int tmp=w;
	 w=t,t=e,e=b,b=tmp;
    }
  }

  int get(char direction){
    if(direction=='T')return t;
    if(direction=='S')return s;
    if(direction=='E')return e;
    if(direction=='W')return w;
    if(direction=='N')return n;
    if(direction=='B')return b;
  }

};

signed main(){
  int n1,n2,n3,n4,n5,n6;
  cin>>n1>>n2>>n3>>n4>>n5>>n6;
  Dice dice(n1,n2,n3,n4,n5,n6);

  int q;
  cin>>q;
  for(int i=0;i<q;i++){
    int t,s;
    cin>>t>>s;
    if(s==dice.get('S'))dice.roll('N');
    else if(s==dice.get('N'))dice.roll('S');
    else if(s==dice.get('E'))dice.roll('W');
    else if(s==dice.get('W'))dice.roll('E');
    else if(s==dice.get('B')){dice.roll('S'),dice.roll('S');}
    //cout<<dice.get('T')<<" ";
    dice.roll('S');
    while(t!=dice.get('T'))dice.roll('E');
    //cout<<dice.get('T')<<" "<<dice.get('S')<<" ";
    cout<<dice.get('E')<<endl;
  }
  return 0;
}



Measured memory_bytes: 3084
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
 

int main(){
  int n,a,b; cin >> n >> a >> b;
  cout << min(a*n,b) << endl;
return 0;
}

Measured memory_bytes: 256
<?php
$ary = explode(' ',fgets(STDIN));
$ns = array_map('intval',$ary);

$d = intval($ns[0] / ($ns[1]+$ns[2]));
$r = $ns[0] % ($ns[1]+$ns[2]);

echo ($d*$ns[1])+min($r,$ns[1]);
?>

Measured memory_bytes: 3700
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Teleportation solver = new Teleportation();
        solver.solve(1, in, out);
        out.close();
    }

    static class Teleportation {
        int n;
        long[] x;
        long A;
        long B;

        public void solve(int testNumber, FastReader fs, PrintWriter pw) {
            n = fs.nextInt();
            A = fs.nextLong();
            B = fs.nextLong();
            x = new long[n];
            for (int i = 0; i < n; i++) x[i] = fs.nextLong();
            long ans = 0;
            for (int i = 1; i < n; i++) {
                if ((x[i] - x[i - 1]) * A > B) ans += B;
                else ans += (x[i] - x[i - 1]) * A;
            }

            pw.println(ans);
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
            st = null;
        }

        public FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }

        public FastReader(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 24400
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <cctype>
#include <map>
#include <vector>
#define PI 3.141592653
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())

using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;

int main() {
	int n;string s;
	cin >> n >> s;
	int ans = 0;
	for (int i = 1;i < n - 1;i++) {
		string str1 = s.substr(0, i);
		string str2 = s.substr(i, n - i);
		int cnt = 0;
		for (int ch = 'a';ch != 'z'+1;ch++) {
			int num1 = str1.find(ch);
			int num2 = str2.find(ch);
			if (num1 != string::npos && num2 != string::npos) cnt++;
		}
		ans = max(ans, cnt);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <fstream>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cstring>
#include <cctype>
#include <numeric>
#include <cstdio>
#include <math.h>
#include <functional>
using namespace std;
struct initon
{
    initon()
    {
        cin.tie(0);
        ios::sync_with_stdio(false);
    };
};
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vs = vector<string>;
using vl = vector<ll>;
using vvl = vector<vl>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using f80 = __float80;
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (i64 i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
#define UP(x) transform(x.begin(), x.end(), x.begin(), ::toupper);
#define LOW(x) transform(x.begin(), x.end(), x.begin(), ::tolower);
#define na(a, n) rep(i, n) cin >> a[i];
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
vb d(10);
int ans(int x)
{
    while (x)
    {
        if (d[x % 10])
            return 0;
        x /= 10;
    }
    return 1;
}
//ここからメイン
int main()
{
 string a,b,c,d;
  cin >> a;
  if(a[0]=='9'||a[1]=='9'){
  cout<<"Yes";
  }else{
  cout<<"No";

  }
  
    }

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

int main() {
  
  int N, K, dist = 0;

  cin >> N >> K;
  
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    
	if (x < abs(x - K)) {
      dist += 2 * x;
    } else {
      dist += 2 * abs(x - K);
    }
  }
  
  cout << dist << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
 
int main(void) {
    int a,b,c;
    int n;
    int count;
    while(!feof(stdin)) {
        scanf("%d",&n);
        if(feof(stdin))break;
        count=0;
        for(a=0;a<=9;a++) {
            for(b=0;b<=9;b++) {
                for(c=0;c<=9;c++) {
                    if(a+b+c>=n-9 && a+b+c<=n)count++;
                }
            }
        }
        printf("%d\n",count);
    }
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double EPS = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};

int main() {
	int total = 0;
	REP(i, 1, 1000) rep(j, 10) {
		if (i % 3 == 0) total += 20;
		else {
			if (j % 2) total += 20;
			else total += 19;
		}
	}

	int n; cin >> n;
	rep(i, n) {
		int Y, M, D;
		cin >> Y >> M >> D;

		int sum = 0;
		REP(i, 1, Y) rep(j, 10) {
			if (i % 3 == 0) sum += 20;
			else {
				if (j % 2) sum += 19;
				else sum += 20;
			}
		}
		REP(i, 1, M) {
			if (Y % 3 == 0) sum += 20;
			else {
				if (i % 2) sum += 20;
				else sum += 19;
			}
		}
		sum += D - 1;
		cout << total - sum << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include "iostream"
#include "vector"
#include "string"
#include "algorithm"
#include "math.h"

using namespace std;
typedef long long ll;

ll power_int(ll a, int b)
{
  ll x = 1;
  while (b > 0)
  {
    x *= a;
    b--;
  }
  return x;
}

vector<int> decompPrimeMatrix(ll n)
{
  const int SIZE = 1234567;	//ここは変える
  vector<int> ans(SIZE);
  ll i = 2;
  while (i < SIZE)
  {
    if (n == 1)
    {
      break;
    }
    if (n % i == 0)
    {
      ans[i]++;
      n /= i;
    }
    else
    {
      i++;
    }
  }
  return ans;
}

int main()
{
  ll n, p;
  ll ans = 1;
  cin >> n >> p;
  if (n == 1)
  {
    cout << p << "\n";
  }
  else
  {
    vector<int> v = decompPrimeMatrix(p);
    for (int i = 1; i < 1234567; i++)
    {
      ans *= power_int(i, (v[i] / n));
    }
    cout << ans << "\n";
  }
}

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

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    char ax = 'a';
    vector<char> x(n);
    for (int i = 0; i < n; i++)
    {
        x.at(i) = s[i];
    }
    sort(x.begin(), x.end());
    for (int i = 0; i < n; i++)
    {
        if (ax == x.at(i))
        {
            ax++;
        }
        if (ax == '{')
        {
            break;
        }
    }
    if (ax == '{')
    {
        cout << "None" << endl;
    }
    else
    {
        cout << ax << endl;
    }
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

void solve() {
  int n = 5;
  vector<int> v(n);
  rep(i,n) cin >> v[i];
  int d = 10;
  rep(i,n) if (v[i] % 10 != 0) d = min(d, v[i] % 10);
  int ans = d;
  rep(i,n) {
    if (v[i] % 10 == 0) ans += v[i];
    else ans += v[i] / 10 * 10 + 10;
  }
  ans -= 10;
  cout << ans << endl;
}

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

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

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
	ll k;
	cin >> k;
	ll sum = 0;
	for(ll i = 0; i < 1e6; i++){
		sum = ((sum * 10) + 7) % k;
		if(sum == 0){
			cout << i+1;
			return 0;
		}
	}
	cout << -1;
    return 0;
}


Measured memory_bytes: 3620
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
//---------------------------------//
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

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...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
//------------------------------//

typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;

#define  ff           first
#define  ss           second
#define  pb           push_back
#define  IOS          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  all(x)       (x).begin(), (x).end()
#define  ps(x,y)      fixed<<setprecision(y)<<x
#define  rep(i,a,b)   for(ll i=a ; i<b ; ++i)

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll maxn = 1e6 + 4;


void solve(){
  int n;
  cin >> n;
  vector<ll> div(n+1);
  ll ans=0;
  for(int i=1;i<=n;i++){
    for(int j=i;j<=n;j+=i){
      div[j]++;
    }
  }
  for(int i=1;i<n;i++){
    ans += (div[n-i]) ;
  }
  cout << ans;
}  

int main(){
  IOS
  	solve();
  //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}

// integer overflow

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

int main() {
	int N, T;
	cin >> N >> T;
	vector<int> a(N);
	vector<int> d;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}

	vector<int> v(N, 0);
	v[N - 1] = a[N - 1];
	for (int i = N - 2; i > 0; i--) {
		v[i] = max(v[i + 1], a[i]);
	}

	for (int i = 0; i < N - 1; i++) {
		if (v[i + 1] > a[i]) {
			d.push_back(v[i + 1] - a[i]);
		}
	}

	sort(d.begin(), d.end());

	int max_d = d[d.size() - 1];
	auto it = lower_bound(d.begin(), d.end(), max_d);
	int res = d.size() - (it - d.begin());

	cout << res << endl;
	return 0;
}


Measured memory_bytes: 1660
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;  //このネームスペースを使う

int main(){
  int M[2];
  int a,b,c;

  cin >> M[0] >> M[1] >> M[2] ;
  
  a = M[0]*10 + M[1] + M[2];
  b = M[0] + M[1]*10 + M[2];
  c = M[0] + M[1] + M[2]*10;

  if(a > b){
    if(a > c){
      cout << a << endl;
    }
    else{
      cout << c << endl;
    }
  }
  else{
    if(b > c){
      cout << b << endl;
    }
    else{
      cout << c << endl;
    }
  } 

  return 0;
}



Measured memory_bytes: 256
#if 0
date +%Y.%m.%d

题解先咕着。
#endif
#include <cstdio>
#include <vector>
#define debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long lolong;
inline int input() { int x; scanf("%d", &x); return x; }

const int maxn = 5005, mod = 1000000007;
lolong f[maxn][maxn], fu[maxn], g[maxn];
int size[maxn];
std::vector<int> G[maxn];

void dp(int u, int fa) {
	size[u] = 1;
	f[u][1] = 1;
	for(int v : G[u])
		if(v != fa) {
			dp(v, u);
			for(int i = 0; i <= size[u]; i ++) {
				fu[i] = f[u][i];
				f[u][i] = 0;
			}
			for(int i = 0; i <= size[u]; i ++)
				for(int j = 0; j <= size[v]; j ++)
					(f[u][i + j] += fu[i] * f[v][j]) %= mod;
			size[u] += size[v];
		}
	for(int i = 1; i <= size[u]; i ++)
		(f[u][0] -= f[u][i] * g[i]) %= mod;
}

int main() {
	int n = input();
	for(int i = 1; i < n; i ++) {
		int u = input(), v = input();
		G[u].push_back(v);
		G[v].push_back(u);
	}
	g[0] = 1;
	for(int i = 2; i <= n; i ++)
		g[i] = g[i - 2] * (i - 1) % mod;
	dp(1, 0);
	printf("%lld\n", (mod - f[1][0]) % mod);
}

Measured memory_bytes: 195328
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repbtw(i, a, b) for (int i = a; i <= (int)(b); i++)
#define all(v) v.begin(), v.end()
#define pr(x) cout << x << endl


int main()
{
    int64_t a, b, n;
    cin >> a >> b >> n;
    int64_t x = n>=b-1 ? b-1 : n;
    int64_t res = (int64_t)a*x/b;
    pr(res);
    return 0;
}



Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
using namespace std;

long long N, K;

int main() {
	cin >> N >> K;
	if (K == 0) {
		cout << N*N << endl;
		return 0;
	}
	long long ans = 0;
	for (int b = K + 1; b <= N; b++) {
		ans += (b - K) * (N / b) + max((long long)0,(N%b)-K+1);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(){
    vector<int> vec = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K;
    cin >> K;
    cout << vec[K-1] << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {

	void solve() {
		int n = in.nextInt();
		long mod = 1000000007;
		int[] a = new int[n], b = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = in.nextInt();
		}
		for (int i = 0; i < n; i++) {
			b[i] = in.nextInt();
		}
		
		
		int mxA = 0;
		for (int i = 1; i < n; i++) {
			if (a[i] > a[mxA]) {
				mxA = i;
			}
		}
		int mxB = n - 1;
		for (int i = n - 1; i >= 0; i--) {
			if (b[i] > b[mxB]) {
				mxB = i;
			}
		}
		
		if (mxA > mxB) {
			out.println(0);
			return;
		}
		if (a[mxA] != b[mxB]) {
			out.println(0);
			return;
		}
		for (int t = mxA; t <= mxB; t++) {
			if (a[t] != a[mxA] || b[t] != b[mxB]) {
				out.println(0);
				return;
			}
		}
		
		long result = 1;
		for (int t = mxA + 1; t < mxB; t++) {
			result = result * a[t] % mod;
		}
		
		for (int i = 0; i < mxA; i++) {
			if (i == 0 || a[i] != a[i - 1]) {
				continue;
			}
			result = result * a[i] % mod;
		}
		for (int j = n - 1; j > mxB; j--) {
			if (j == n - 1 || b[j] != b[j + 1]) {
				continue;
			}
			result = result * b[j] % mod;
		}
		out.println(result);
	}

	FastScanner in;
	PrintWriter out;

	void run() {
		in = new FastScanner();
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public String nextToken() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
				}
			}
			return st.nextToken();
		}

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

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

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

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


Measured memory_bytes: 34964
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b = readInts()
print(a * b)


Measured memory_bytes: 10300
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
for i in range(1, 10):
    if N%i==0:
        if N//i<10:
            print('Yes')
            break
else:
    print('No')

Measured memory_bytes: 61944
#include <iostream>
#include <algorithm>
using namespace std;
int n, a[1009];
int main() {
	while (cin >> n, n) {
		for (int i = 0; i < n; i++) cin >> a[i];
		sort(a, a + n);
		int ret = 1999999999;
		for (int i = 1; i < n; i++) ret = min(ret, a[i] - a[i - 1]);
		cout << ret << endl;
	}
	return 0;
}

Measured memory_bytes: 3048
import java.util.*;
import java.io.*;

public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out, true);

    int h, w, a, b;
    h = sc.nextInt();
    w = sc.nextInt();
    a = sc.nextInt();
    b = sc.nextInt();

    for (int i = 0; i < h; i++) {
      for (int j = 0; j < w; j++) {
        pw.print((i < b ^ j < a ? 1 : 0));
      }
      pw.println();
    }

  }
}

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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  const string AKI = "AKIHABARA";
  string S;
  cin >> S;
  int N =SZ(S);
  int i, j;
  for(i=0,j=0;j<SZ(AKI);){
	if(i < N && S[i] == AKI[j]){
	  ++i;
	  ++j;
	}
	else if(AKI[j] == 'A')
	  ++j;
	else
	  break;
  }

  cout << (i==N&&j==SZ(AKI)? "YES": "NO") << endl;
  

  return 0;
}


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

#define ll long long 
const ll MAXP = 1e6 + 5;
ll n;

bool isPrime[MAXP];
vector<ll> primes;
ll ans = 1;

int main(){
	scanf("%lld", &n);
	//sieve(MAXP-1);
	ans = 0;
	for(ll i = 1; i*i <= n; ++i){
		if(n%i == 0){
			if(i > 1 && n/(i-1) == n%(i-1)){
				ans += i-1;
				fprintf(stderr, "(%lld)\n", i-1);
			}
			if(n/i > 1 && n/i != i && n/(n/i-1) == n%(n/i-1)){
				fprintf(stderr, "(%lld)\n", n/i-1);
				ans += n/i-1;
			}
		}
	}
	printf("%lld\n", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

vector<ll> f(400000);

void calc() {
    f[0] = 1;
    rep(i, 1, 400001) {
        f[i] = f[i - 1] * i;
        f[i] %= mod;
    }
}

ll pow_mod(ll a, ll b, ll m = mod){
    ll ret = 1;
    while (b > 0) {
        if (b & 1) {
            ret = ret * a % m;
        }
        a = a * a % m;
        b >>= 1;
    }
    return ret;
}

ll inv_mod(ll a, ll m = mod){
    return pow_mod(a, m - 2, m);
}

ll comb(ll n, ll r) {
    ll ret = f[n];
    ret *= inv_mod(f[r], mod);
    ret %= mod;
    ret *= inv_mod(f[n - r], mod);
    ret %= mod;
    return ret;
}

int N;
vector<ll> sz;
vector<ll> dp;


void dfs(vector<vector<int>> &G, int cur = 0, int par = -1) {
    sz[cur] = 0;
    dp[cur] = 1;
    for(int v: G[cur]) {
        if(v != par) {
            dfs(G, v, cur);
            (dp[cur] *= dp[v] * comb(sz[cur] + sz[v], sz[v]) % mod) %= mod;
            sz[cur] += sz[v];
        }
    }
    sz[cur]++;
//    cout << cur << ":" << dp[cur] << endl;
}

void dfs2(vector<vector<int>> &G, ll val, int cur = 0, int par = -1) {
    (dp[cur] *= val * comb(N - 1, N - sz[cur]) % mod) %= mod;
    for(int v: G[cur]) {
        if(v != par) {
            ll p = dp[cur] * inv_mod(dp[v] * comb(N - 1, sz[v]) % mod) % mod;
            dfs2(G, p, v, cur);
        }
    }
}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    
    cin >> N;
    vector<vector<int>> G(N);
    rep(i, N - 1) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].pb(b);
        G[b].pb(a);
    }
    calc();
    sz.resize(N);
    dp.resize(N);
    
    dfs(G);
    dfs2(G, 1);
    rep(i, N) output(dp[i]);
    
    
    
    return 0;
}


Measured memory_bytes: 20212
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define is(s) freopen((const char*)(s),"r",stdin)
#define os(s) freopen((const char*)(s),"w",stdout)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(),x.end()
//#define x first
//#define y second

using namespace std;
int n,k;
map<int,bool>a;
int main()
{
	//is("input.txt");os("output.txt");
	cin>>n;
	rep(i,n)
	{
		cin>>k;
		if(a.count(k))
		{
			cout<<"NO"<<endl;
			return 0;
		}
		else a[k]=0;
	}
	cout<<"YES"<<endl;
	return 0;}


Measured memory_bytes: 9600
let message = readLine()!
let check1 = "hi"
let check2 = "hihi"
let check3 = "hihihi"
let check4 = "hihihihi"
let check5 = "hihihihihi"
if message == check1 || message == check2 || message == check3 || message == check4 || message == check5{
  print("Yes")
}else{
  print("No")
}


Measured memory_bytes: 2544
N, K = map(int, input().split())

def substract(min):
    if N % K == 0:
        return 0
    tmp = N % K
    if abs(tmp - K) < tmp:
        return abs(tmp-K)
    return tmp
    #while(1):
    #    tmp = abs(tmp - K)
    #    if tmp > min:
    #        break
    #    min = tmp
    #return min

if abs(N-K) < N or abs(N-K) < K:
    print(substract(abs(N-K)))
elif N < K:
    print(N)
else:
    print(K)


Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll inf = 1000000007;
int main() {
	string s;
	cin >> s;
	while(1) {
		s.pop_back();
		string x = s.substr(0, s.size() / 2);
		string y = s.substr(s.size() / 2, s.size() / 2);
		if (x == y) {
			cout << x.size()+y.size() << endl;
			return 0;
		}
	}
}


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

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> s;

    if(n==0){
        cout << "0" << "\n";
        return 0;
    }

    int bin=-2;
    while(n!=0) {
        int m=n%(-2);
        if(m<0) m+=2;
        s.emplace_back(m);
        n=(n-m)/(-2);
    }

    n=s.size();
    for(int i = 0; i < n; i++) {
        cout << (s[n-1-i]!=0 ? 1 : 0);
    }
    cout << "\n";

    return 0;
}

Measured memory_bytes: 3636
object Main extends App {
  val Array(n, k) = io.StdIn.readLine().split(' ').map(_.toInt)
  val k2 = k*2
  val end = k2-1
  // 0 ≦ x,y ≦ 2K に圧縮
  val squares = Array.fill(k2)(Array.fill(k2)(0))
  for (i <- 1 to n) {
    val Array(x, y, color) = io.StdIn.readLine().split(' ')
    // 'W'はY方向にKずらした'B'と同値
    squares(x.toInt % k2)((y.toInt + (if (color == "B") 0 else k)) % k2) += 1
  }
  // 計算量削減のために累積和を事前算出
  for {
    i <- 0 to end
    j <- 1 to end
  } squares(i)(j) += squares(i)(j-1)
  for {
    j <- 0 to end
    i <- 1 to end
  } squares(i)(j) += squares(i-1)(j)
  var max = 0
  for {
    i <- 0 to k-1
    j <- 0 to k-1
  } {
    // ex) k = 2
    //      ■ □ □ ■ 
    //  j+k □ ■ ■ □
    //      □ ■ ■ □
    //    j ■ □ □ ■
    //      i   i+k
    val cnt =
      (squares(i)(j)) +
      (squares(end)(j) - squares(i+k)(j)) +
      (squares(i+k)(j+k) - squares(i+k)(j) - squares(i)(j+k) + squares(i)(j)) +
      (squares(i)(end) - squares(i)(j+k)) +
      (squares(end)(end) - squares(end)(j+k) - squares(i+k)(end) + squares(i+k)(j+k))
    max = Math.max(Math.max(cnt, n - cnt), max)
  }
  print(max)
}


Measured memory_bytes: 86940
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REP(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define REP1(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using Int = long long;

//INT_MAX = 2147483647;
//LLONG_MAX = 9223372036854775807;
//ULLONG_MAX = 18446744073709551615;
const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int x,y;
    cin >> x >> y;
    cout << x + y/2 << endl;
    
    
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
 int A[3][3];
 int i,j,k;
 int N,B[N];
 for(i=0;i<3;i++)
  scanf("%d %d %d\n",&A[i][0],&A[i][1],&A[i][2]);

 scanf("%d\n",&N);
 for(i=0;i<N;i++)
  scanf("%d\n",&B[i]);

 for(k=0;k<N;k++)
  for(i=0;i<3;i++)
    for(j=0;j<3;j++)
     if(B[k] == A[i][j]) A[i][j] = 0;

 if(A[0][0]==0 && A[0][1]==0 && A[0][2]==0) printf("Yes\n");
 else if(A[1][0]==0 && A[1][1]==0 && A[1][2]==0) printf("Yes\n");
 else if(A[2][0]==0 && A[2][1]==0 && A[2][2]==0) printf("Yes\n");
 else if(A[2][0]==0 && A[2][1]==0 && A[2][2]==0) printf("Yes\n");
 else if(A[0][0]==0 && A[1][0]==0 && A[2][0]==0) printf("Yes\n");
 else if(A[0][1]==0 && A[1][1]==0 && A[2][1]==0) printf("Yes\n");
 else if(A[0][2]==0 && A[1][2]==0 && A[2][2]==0) printf("Yes\n");
 else if(A[0][0]==0 && A[1][1]==0 && A[2][2]==0) printf("Yes\n");
 else if(A[2][0]==0 && A[1][1]==0 && A[0][2]==0) printf("Yes\n");
 else printf("No\n");

 return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<ll> vi;
typedef vector<ll> vl;
typedef pair<ll,ll> pii;
typedef pair<ll,ll> pll;
typedef map<ll,ll> mii;
typedef map<ll,ll> mll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define fi first
#define se second
#define pi 3.141592653589793
#define ld long double
#define mod 998244353ll
#define pb push_back
#define all(v) v.begin(),v.end()
#define rall(v) v.begin(), v.end(), greater<ll>()
#define tc ll t;cin>>t;while(t--)
#define pqmax priority_queue<ll>
#define pqmin priority_queue<ll,vi,greater<ll>>
#define fio ios_base::sync_with_stdio(0), cin.tie(NULL)
#define tc_g ll tt;cin>>tt;for(ll ti=1;ti<=tt;ti++)#define case_g "Case #"<<ti<<": "
#define Debug(x) cout << x << "\n"
using namespace std;
int main() {
    ll n;
    cin >> n;
    for(int i = 0; i < n; ++i)
        cout << "ACL";
}


Measured memory_bytes: 3580
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

   private static final String INPUT_FILE_PATH = "";

   void solve() {
      int n = in.nextInt(), x = in.nextInt(), t = in.nextInt();
      out.println((x + n - 1) / x * t);
   }

   private final InputReader in;
   private final PrintWriter out;

   private Main(InputReader in, PrintWriter out) {
      this.in = in;
      this.out = out;
   }

   private static class InputReader {
      private BufferedReader br;
      private StringTokenizer st;

      public InputReader(InputStream inputStream) {
         this.br = new BufferedReader(new InputStreamReader(inputStream), 32768);
         this.st = null;
      }

      public String nextToken() {
         while (st == null || !st.hasMoreTokens()) {
            try {
               st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
               throw new RuntimeException(e);
            }
         }
         return st.nextToken();
      }

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

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

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

   public static void main(String[] args) throws Exception {
      InputStream inputStream = INPUT_FILE_PATH.isEmpty()
         ? System.in
         : new FileInputStream(new File(INPUT_FILE_PATH));
      OutputStream outputStream = System.out;

      InputReader inputReader = new InputReader(inputStream);
      PrintWriter printWriter = new PrintWriter(outputStream);

      new Main(inputReader, printWriter).solve();

      printWriter.close();
   }

}


Measured memory_bytes: 32924
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007;
struct edge {int to,costa,costb;};

signed main() {
int n,m,q;
cin>>n>>m>>q;

if(n+m+q>=22)cout<<"bust";
else cout<<"win";

return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>

using namespace std;

typedef long long ll;

ll makeId(int p, int x)
{
  return (ll)p * 1000000 + x;
}

struct city {
  int no;
  int pref;
  int year;
  city(int, int, int);
};

city::city(int no, int pref, int year)
{
  this->no = no;
  this->pref = pref;
  this->year = year;
}

bool compare_cities(const city& c1, const city& c2)
{
  return c1.year < c2.year;
}


int main(void)
{
  int N, M;
  cin >> N >> M;
  vector< city > cities;
  for (int i = 0; i < M; i++) {
    int p, y;
    cin >> p >> y;
    cities.push_back(city(i, p, y));
  }

  vector< vector< city > > cities_in_pref(N + 1);
  for (int i = 0; i < M; i++) {
    cities_in_pref[cities[i].pref].push_back(cities[i]);
  }

  for (int j = 1; j <= N; j++) {
    sort(cities_in_pref[j].begin(), cities_in_pref[j].end(),compare_cities);
  }

  vector< ll > ids(M);
  for (int j = 1; j <= N; j++) {
    for(int x = 1; x <= cities_in_pref[j].size(); x++) {
      ids[cities_in_pref[j][x - 1].no] = makeId(j, x);
    }
  }

  for (int i = 0; i < M; i++) {
    cout << setfill('0') << setw(12) << right;
    cout << ids[i] << endl;
  }
}


Measured memory_bytes: 8948
#include<stdio.h>
#include <cmath>
#include<stdlib.h>
#include<math.h>
int main()
{
	int a, b, c,x;
	scanf("%d%d%d%d", &a, &b, &c,&x);
	int a1, b1, sum = 0;
	a1 = x / 500;
	if (a1 > a)a1 = a;
	b1 = x / 100;
	if (b1 > b)b1 = b;
	for (int i = 0;i <= a1;i++)
		for (int p = 0;p <= b1;p++)
			if ((i * 500 + p * 100) <= x && (x - i * 500 - p * 100) / 50 <= c)sum++;
	printf("%d", sum);
	return 0;
}

Measured memory_bytes: 128
def main():
    n, a, b = map(int, input().split())
    answer = 0
    for i in range(1, n + 1):
        digit_sum = 0
        now = i
        while 0 < now:
            digit_sum += now % 10
            now //= 10
        if a <= digit_sum <= b:
            answer += i
    print(answer)


if __name__ == '__main__':
    main()



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

typedef long long ll;
typedef unsigned long long ull;

int main(){
    int A[5][4][11];
    for(int b=1;b<=4;b++){
        for(int f=1;f<=3;f++){
            for(int r=1;r<=10;r++){
                A[b][f][r]=0;
            }
        }
    }
    
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        int b,r,f,v;
        cin >> b >> f >> r >> v;
        A[b][f][r]+=v;
    }

    for(int b=1;b<=4;b++){
        for(int f=1;f<=3;f++){
            for(int r=1;r<=10;r++) cout << " " << A[b][f][r];
            cout << endl;
        }
        if(b<4) cout << "####################" << endl;
    }
    return 0;
}


Measured memory_bytes: 3104
n,a=map(int,input().split())
x=[int(j)-a for j in input().split()]
from collections import defaultdict
dp=[defaultdict(int)for i in range(n+1)]
dp[0][0]=1
for i,j in enumerate(x,1):
    l=dp[i-1].copy()
    for k in dp[i-1]:
        l[k+j]+=dp[i-1][k]
    dp[i]=l

print(dp[-1][0]-1)

Measured memory_bytes: 10528
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int A=0;
  int B=0;
  vector<int>a(110);
  cin >> N;
  for(int i=0;i<N;i++) cin >> a.at(i);
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());

  for(int i=0;i<N;i++){
    if(i%2==0) A += a.at(i);
    else B += a.at(i);
  }
  cout << A - B << endl;
}

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#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 Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n;
  cin >> n;

  vector<ll> a(n);
  ll mod1, mod2, mod4;
  mod1 = mod2 = mod4 = 0;
  REP(i, n){
    cin >> a[i];
    if(a[i] % 4 == 0)
      mod4++;
    else if(a[i] % 2 == 0)
      mod2++;
    else
      mod1++;
  }

  if((mod2 == 0 && mod1 <= mod4+1) || (mod1 <= mod4))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;


  
  
}


Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#define ll long long
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define lowbit(x) (x& -x)
#define inf 0x3f3f3f3f
#define mod 1000000007
#define eps 1e-18
inline ll read(){ll tmp=0; char c=getchar(),f=1; for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1; for(;'0'<=c&&c<='9';c=getchar())tmp=tmp*10+c-'0'; return tmp*f;}
inline ll power(ll a,ll b){ll tmp=1; for(;b;b>>=1){if(b&1)tmp=tmp*a%mod; a=a*a%mod;} return tmp;}
using namespace std;
struct data{
	int l,r;
	ll rk;
	friend bool operator < (data a,data b){return a.rk>b.rk;}
};
priority_queue<data>q;
map<ll,int>a;
ll base[10];
char s[5010];
int n,k;
int main()
{
	int i;
	scanf("%s",s); n=strlen(s); k=read();
	base[0]=1;
	for(i=1;i<=k;i++)base[i]=base[i-1]*27;
	//for(i=0;i<=k;i++)printf("%lld\n",base[i]);
	for(i=0;i<n;i++){
		data tmp; tmp.l=i; tmp.r=i; tmp.rk=(s[i]-'a'+1)*base[k];
		q.push(tmp);
	}
	int m=k;
	data tmp=q.top(); q.pop();
	while(1){
	//	printf("%d %d %lld\n",tmp.l,tmp.r,tmp.rk);
		if(!a[tmp.rk]){
			k--; a[tmp.rk]=k;
			if(!k)break;
		}
		if(tmp.r<n-1){
			//printf("%d %d %d %lld\n",tmp.l,tmp.r,(tmp.r-tmp.l),base[m-(tmp.r-tmp.l)]);
			tmp.r++; tmp.rk+=(s[tmp.r]-'a'+1)*base[m-(tmp.r-tmp.l)];
			q.push(tmp);
		}
		tmp=q.top(); q.pop();
	}
	//printf("%d %d %lld\n",tmp.l,tmp.r,tmp.rk);
	for(i=tmp.l;i<=tmp.r;i++)printf("%c",s[i]);
	return 0;
}

Measured memory_bytes: 432