akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;

#ifdef LOCAL
        #include "debug.h"
        #define input freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#else
        #define debug(...) 4
        #define input 4
#endif

using ll = long long;
constexpr int N = 2e5+ 5;
constexpr int mod = 1e9 + 7;

int main() {
    input;
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int n, m, k;
    cin >> n >> m >> k;
    string s[n];
    for(int i = 0; i < n; i++)
        cin >> s[i];
    int ans = 0;
    for(int i = 0; i < (1 << n); i++) {
        for(int j = 0; j < (1 << m); j++) {
            vector<int> row, col;
            for(int k = 0; k < n; k++) {
                if((1 << k) & i) {
                    row.push_back(k);
                }
            }
            for(int k = 0; k < m; k++) {
                if((1 << k) & j) {
                    col.push_back(k);
                }
            }
            string t[n];
            for(int x = 0; x < n; x++)
                t[x] = s[x];
            for(int r : row) {
                for(int x = 0; x < m; x++)
                    t[r][x] = '.';
            }
            for(int c : col) {
                for(int x = 0; x < n; x++)
                    t[x][c] = '.';
            }
            int cnt = 0;
            for(int x = 0; x < n; x++) {
                for(int y = 0; y < m; y++) {
                    if(t[x][y] == '#')
                        cnt++;
                }
            }
            if(cnt == k) {
                debug(row, col);
                ans++;
            }
            
        }
    }
    cout << ans;
}




Measured memory_bytes: 3616
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


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;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n,k;
  cin>>n>>k;
  vector<ll> v(n);
  rep(i,n) cin>>v[i];
  ll ans=0;
  for(ll i=0;i<=min(n,k);i++){
    for(ll j=0;i+j<=min(n,k);j++){
      vector<ll> tmp;
      ll cur=0;
      rep(l,i) tmp.push_back(v[l]),cur+=v[l];
      rep(l,j) tmp.push_back(v[n-1-l]),cur+=v[n-1-l];
      sort(ALL(tmp));
      rep(l,min(k-i-j,(ll)tmp.size())) if(tmp[l]<0) cur-=tmp[l];
      ans=max(ans,cur);
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
h = [0]*N
for i in range(N):
  h[i] = int(input())
  
h = sorted(h)
hmin = max(h)
for i in range(N-K+1):
  hmin = min([hmin, h[i+K-1]-h[i]])
  
print(hmin)

Measured memory_bytes: 14044
d,g = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for _ in range(d)]
def function(G, i):
    if i == 0:
        return 10**9
    n = min(G // (i *100), pc[i][0])
    s = n * i * 100
    if n == pc[i][0]:
        s += pc[i][1]
    if s < G:
        n += function(G-s, i - 1)
    return min(n, function(G, i-1))
print(function(g, d))
    

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

using namespace std;

int main()
{
    int no_of_stones, no_of_steps;
    cin >> no_of_stones >> no_of_steps;

    vector <int> height(no_of_stones + 1, 0);
    for(int i = 1; i <= no_of_stones; i++)
        cin >> height[i];

    const int oo = 1e9;
    vector <int> minimum_cost(no_of_stones + 1, oo);
    minimum_cost[1] = 0;

    for(int i = 2; i <= no_of_stones; i++)
    {
        for(int j = i - 1; j >= max(1, i - no_of_steps); j--)
        {
            minimum_cost[i] = min(minimum_cost[i], minimum_cost[j] + abs(height[i] - height[j]));
        }
    }

    cout << minimum_cost[no_of_stones];
    return 0;
}

Measured memory_bytes: 4032
#include <iostream>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL<<60;

const int MAX_N = 110;
const int MAX_V = 100100;

// 入力
int N;
long long W, weight[MAX_N], value[MAX_N]; // 品物の個数は 100 個なので少し余裕持たせてサイズ 110 に

// DPテーブル
long long dp[MAX_N][MAX_V];

int main() {
    cin >> N >> W;
    for (int i = 0; i < N; ++i) cin >> weight[i] >> value[i];

    // 初期化
    for (int i = 0; i < MAX_N; ++i) for (int j = 0; j < MAX_V; ++j) dp[i][j] = INF;

    // 初期条件
    dp[0][0] = 0;

    // DPループ
    for (int i = 0; i < N; ++i) {
        for (int sum_v = 0; sum_v < MAX_V; ++sum_v) {

            // i 番目の品物を選ぶ場合
            if (sum_v - value[i] >= 0) chmin(dp[i+1][sum_v], dp[i][sum_v - value[i]] + weight[i]);

            // i 番目の品物を選ばない場合
            chmin(dp[i+1][sum_v], dp[i][sum_v]);
        }
    }

    // 最適値の出力
    long long res = 0;
    for (int sum_v = 0; sum_v < MAX_V; ++sum_v) {
        if (dp[N][sum_v] <= W) res = sum_v;
    }
    cout << res << endl;
}


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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> P(M), Y(M), py[100010];
    for(int i = 0; i < M; ++i) {
        cin >> P[i] >> Y[i];
        py[P[i]].push_back(Y[i]);
    }
    for(int i = 1; i <= N; ++i)
        if(!py[i].empty()) sort(py[i].begin(), py[i].end());
    for(int i = 0; i < M; ++i) {
        auto itr = lower_bound(py[P[i]].begin(), py[P[i]].end(), Y[i]);
        int dist = itr - py[P[i]].begin();
        printf("%06d%06d\n", P[i], dist + 1);
    }
    return 0;
}


Measured memory_bytes: 7808
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.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 (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;} 
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll X;
        cin >> X;
        ll now = X;
        rep(i, 1, inf) {
                if (now % 360 == 0) {
                        cout << i << endl;
                        return 0;
                }
                now += X;
        }
}


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



int main() {
  char c;
  string ans;
  cin >> c;

  if(c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o'){
    ans = "vowel";
  }
  else{
    ans = "consonant";
  }

cout << ans << endl;
}

Measured memory_bytes: 256
'use strict'

main()

function main (input) {
  readInput()
  .then(parseInput)
  .then(calc)
}

function calc (input) {
  let n = input[0][0]
  let m = input[0][1]
  let a = [0]
  let b = [0]
  for (let i = 1; i <= m; i++) {
    a[i] = input[i][0]
    b[i] = input[i][1]
  }
  let cities = new Array(n + 1).fill(0)
  for (let i = 1; i <= m; i++) {
    cities[a[i]]++
    cities[b[i]]++
  }
  for (let i = 1; i <= n; i++) {
    console.log(cities[i])
  }
}

function parseInput (inputRaw) {
  let input = inputRaw.split('\n').map(row => row.split(' ').map(Number))
  return input
}

function readInput () {
  return new Promise((resolve) => {
    let inputArr = []
    process.stdin.resume()
    process.stdin.setEncoding('utf8')
    process.stdin.on('data', (chunk) => {
      inputArr.push(chunk)
    })
    process.stdin.on('end', () => {
      let input = inputArr.join('').trim()
      resolve(input)
    })
  })
}


Measured memory_bytes: 21448
n=int(input())
def b_search(a,b,value):
    med=(a+b)//2
    if a==b:return a
    else:
        if a+1==b:
            out("?",[i+1 for i in range(b,b+n)])
            v=input()
            if value(v):return b
            else:return a
        else:
            out("?",[i+1 for i in range(med,med+n)])
            v=input()
            if value(v):
                return b_search(med,b,value)
            else:
                return b_search(a,med-1,value)

def out(a,l):
    ll=[a]+l
    print(*ll)

out("?",[i+1 for i in range(n)])
v=input()
value=lambda x:x==v
k=b_search(0,n,value)

ans=[0]*(2*n)
l1=[i+1 for i in range(k+1,k+n)]
for i in range(k+1):
    out("?",l1+[i+1])
    v=input()
    if v=="Red":
        ans[i]="R"
    else:
        ans[i]="B"
for i in range(k+n,2*n):
    out("?",l1+[i+1])
    v=input()
    if v=="Red":
        ans[i]="R"
    else:
        ans[i]="B"
l2=[i+1 for i in range(k)]+[i+1 for i in range(k+n+1,2*n)]
for i in range(k+1,k+n):
    out("?",l2+[i+1])
    v=input()
    if v=="Red":
        ans[i]="R"
    else:
        ans[i]="B"
print("! "+"".join(ans),flush=True)

Measured memory_bytes: 3532
import java.util.*;


public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        StringBuilder sb1 = new StringBuilder(s);
        if(!(s.equals(sb1.reverse().toString()))){
        	System.out.println("No");
            return;
        }
        
        String s2 = s.substring(0, (s.length()-1)/2);
        StringBuilder sb2 = new StringBuilder(s2);
        if(!(s2.equals(sb2.reverse().toString()))){
        	System.out.println("No");
            return;
        }
        
        String s3 = s.substring(((s.length()+3)/2)-1);
        StringBuilder sb3 = new StringBuilder(s3);
        if(!(s3.equals(sb3.reverse().toString()))){
        	System.out.println("No");
            return;
        }
        
        System.out.println("Yes");
	}
}

Measured memory_bytes: 35696
#define PI 3.14159265359
#define INF 2000000000
#define MAX 500000
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
typedef long long ll;


void MCM(int n,int p[]){
  int m[120][120];
  for(int i=1;i<=n;i++) for(int j=0;j<=n;j++) m[i][j]=(1<<30);
  
  for(int i=1;i<=n;i++) m[i][i]=0;
  
  for(int l=2;l<=n;l++){
      for(int i=1;i<=n-l+1;i++){
          int j=i-1+l;
          for(int k=i;k<j;k++){
              m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
          }
      }
  }
  
   cout<<m[1][n]<<endl;
}

int main(){
   int p[120];
   int n;
   cin>>n;
   for(int i=1;i<=n;i++){
     cin>>p[i-1]>>p[i]; 
   }
 MCM(n,p);
}

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

static const int MAX_NUM = 200000;

long long MargeElem(int elem[], int start, int mid, int end)
{
    long long ret = 0;
    int i, j, k, l;
    int A[MAX_NUM/2 + 1], B[MAX_NUM/2 + 1];

    i = mid - start;
    j = end - mid;
    k = (i > j) ? i : j;
    for (l = 0; l < k; l++) {
        A[l] = elem[start + l];
        B[l] = elem[mid + l];
    }
    A[i] = 0x7FFFFFFF;
    B[j] = 0x7FFFFFFF;

    k = 0;
    j = 0;
    for (l = start; l < end; l++) {
        if (A[k] > B[j]) {
            elem[l] = B[j];
            ++j;
            ret += (i - k);
        }
        else {
            elem[l] = A[k];
            ++k;
        }
    }

    return ret;
}

long long MargeSort(int elem[], int start, int end)
{
    int mid;
    long long ret = 0;

    if (start < end - 1) {
        mid = (start + end) / 2;
        ret  = MargeSort(elem, start, mid);
        ret += MargeSort(elem, mid,   end);
        ret += MargeElem(elem, start, mid, end);
    }

    return ret;
}


int main(void)
{
    int i;
    long long ret;
    int num;
    int elem[MAX_NUM];

    scanf("%d", &num);
    for (i = 0; i < num; i++) {
        scanf("%d", &elem[i]);
    }

    ret = MargeSort(elem, 0, num);
    printf("%ld\n", ret);

    return 0;
}

Measured memory_bytes: 2748
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

void solve()
{
    int n;cin>>n;
   // cout<<n*n<<endl;
   string s;cin>>s;
   if(n%2==0){
       REP(i,n/2){
           if(s[i]!=s[i+n/2]){cout<<"No"<<endl;return;}
       }
       cout<<"Yes"<<endl;
   }else cout<<"No"<<endl;

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



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

#define ll long long
#define pb push_back

int main(){

	vector<int> N;
	for(int i = 0; i < 4; i ++){
		int n;
		cin >> n;
		N.pb(n);
	}
	sort(N.begin(), N.end());
	if(N[0] == 1 && N[1] == 4 && N[2] == 7 && N[3] == 9)cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import numpy as np

def main():
    # # 整数の入力
    # a = int(input())
    # # スペース区切りの整数の入力
    # b, c = map(int, input().split())
    # # 文字列の入力
    # s = input()
    # # 出力
    # print("{} {}".format(a+b+c, s))
    N = int(input())
    A_list = [int(input()) for i in range(N)]
    A_argsorted = np.argsort(A_list)[::-1]
    for i in range(N):
        max_value = A_list[A_argsorted[0]] if i != A_argsorted[0] else A_list[A_argsorted[1]]
        print(max_value)

    
if __name__=='__main__':
    main()


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

using namespace std;

int main()
{
	int n;
	cin >> n;
	string s[50];
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	for (char c = 'a'; c <= 'z'; c++) {
		int k = 1000;
		for (int i = 0; i < n; i++) {
			int kk = 0;
			for (int j = 0; j < s[i].size(); j++) {
				if (s[i][j] == c) kk++;
			}
			k = min(k, kk);
		}
		for (int i = 0; i < k; i++)cout << c;
	}
	cout << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int gcd(int n, int m)
{
  return m == 0 ? n : gcd(m, n % m);
}
int main()
{
  int x;
  cin >> x;
  cout << 360 / gcd(x, 360);
  return 0;
}


Measured memory_bytes: 3520
#include<bits/stdc++.h>
using namespace std;
#define RI register int
typedef long long LL;
LL read() {
	LL q=0;char ch=' ';
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') q=q*10+(LL)(ch-'0'),ch=getchar();
	return q;
}
const int N=100000;
int is[N+5];LL a[N+5],b[N+5],pri[N+5];
int n,tot,ans;map<LL,int> mp;
void prework() {
	for(RI i=2;i<=N;++i) {
		if(!is[i]) pri[++tot]=i;
		for(RI j=1;j<=tot&&pri[j]*i<=N;++j) {
			is[pri[j]*i]=1;
			if(i%pri[j]==0) break;
		}
	}
}
void work(int o,LL x) {
	a[o]=b[o]=1;
	for(RI i=1;pri[i]*pri[i]*pri[i]<=x;++i) {
		int js=0;
		while(x%pri[i]==0) ++js,x/=pri[i];
		if(js%3==1) a[o]*=pri[i],b[o]*=pri[i]*pri[i];
		else if(js%3==2) a[o]*=pri[i]*pri[i],b[o]*=pri[i];
	}
	if(x!=1) {
		LL kl=sqrt(x);
		if(kl*kl==x) a[o]*=kl*kl,b[o]*=kl;
		else a[o]*=x,b[o]*=x*x;
	}
}
int main()
{
	n=read();
	prework();
	for(RI i=1;i<=n;++i) work(i,read());
	for(RI i=1;i<=n;++i) ++mp[a[i]];
	for(RI i=1;i<=n;++i) {
		if(!mp[a[i]]) continue;
		if(a[i]==b[i]) ++ans,mp[a[i]]=0;
		else ans+=max(mp[a[i]],mp[b[i]]),mp[a[i]]=mp[b[i]]=0;
	}
	printf("%d\n",ans);
	return 0;
}

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


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int tmp = b - a;

		pr.println(tmp * (tmp + 1) / 2 - b);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 21844
using namespace std;
#include <bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for(int (I)=(A);(I)<(B);++(I))
#define ALL(C) (C).begin(),(C).end()
inline void solve()
{
  int n;
  cin>>n;
  if(n<1000)cout<<"ABC"<<endl;
  else cout<<"ABD"<<endl;
}
int main(int argc,char**argv)
{
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
x, y= list(map(int, input().split()))
a = [1,3,5,7,8,10, 12]
b = [4,6,9,11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x==2 and b==2):
    print('Yes')
else:
    print('No')

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

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

int main(){
    int X,Y,A,B,C,D;
    cin>>A>>B>>C>>D;
    X=abs(A-C),Y=abs(B-D);
    int g=gcd(X,Y);
    int x=X/g,y=Y/g;
    cout<<(x+y-1)*g<<endl;

    return 0;
}

Measured memory_bytes: 256
using System;

namespace fight3
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long A = long.Parse(input[0]);
            decimal B = decimal.Parse(input[1]);
            decimal C = Math.Floor(A * B);
            Console.WriteLine(C);
        }
    }
}

Measured memory_bytes: 18136
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
  string s;
  cin >> s;
  bool a = false, b = false;
  for (int i = 0; i < 3; i++) {
    if (s[i] == 'A') a = true;
    if (s[i] == 'B') b = true;
  }
  if (a && b) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 384
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}
struct multi {
  ll first;
  ll second;
  ll third;
  multi(ll first, ll second, ll third)
      : first(first), second(second), third(third) {}
};
bool multicomp(const multi &a, const multi &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N, L;
  vl A;
  cin >> N >> L;
  ll m = llINF;
  ll po = 0;
  ll ans = 0;
  REP(i, N) {
    ll a = L + i;
    if (m > abs(a)) {
      m = abs(a);
      po = a;
    }
    ans += a;
  }
  cout << ans - po << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define All(a) a.begin(),a.end()
#define INF 1000000007
const ll MOD = 1000000007;
//accumulate(vec.begin(), vec.end(), 0)
//std::sort(v.begin(), v.end(), std::greater<Type>());
//set_intersection(x, x+7, y, y+6, back_inserter(v));
//set_union(x, x+7, y, y+6, back_inserter(v));
//set_difference(x, x+7, y, y+6, back_inserter(v));

int gcd(int x,int y){
  if(x%y==0) return y;
  else return gcd(y,x%y);
}

bool isPrime(int n){
  if(n < 2) return false;
  else if(n == 2) return true;
  else if(n%2==0) return false;

  for(int i=3;i<=sqrt(n);i++){
    if(n%i==0) return false;
  }
  return true;
}


int main(){
  int n,k;
  cin >> n >> k;
  vector<int>p(n);
  for(int i=0;i<n;i++) cin >> p[i];
  sort(All(p));
  cout<< accumulate(p.begin(),p.begin()+k,0) <<endl;
}


Measured memory_bytes: 3720
def main():
    N = int(input())
    S = input()
    ec = S.count('E')
    tec = ec
    for k in S:
        if k == 'E':
            tec -= 1
        else:
            tec += 1
        ec = min(ec, tec)
    print(ec)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3672
#include <cstdio>
#include <utility>
using namespace std;

#ifdef __linux
#define _U(s) s##_unlocked
#else
#define _U(s) _##s##_nolock
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
#define gcu _U(getchar)
#define pcu _U(putchar)
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
#define _OP(t) inline operator t()
struct _in {
#ifdef _GLIBCXX_STRING
	_OP(string){string s;for(char c;c=gcu(),c!=' '&&c!='\n'&&c!=EOF;)s+=c;return s;}
#define _S
#endif
	_OP(char){char c=gcu();gcu();return c;}
	_OP(double){double d; scanf("%lf",&d); gcu();return d;}
	_T _OP(T){T n{},m{1},c;if((c=gcu())=='-')m=-1,c=gcu();do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
} in;
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
#ifdef _S
_SCAN(string &o) {int c{gcu()};if(c==EOF)return false;else{ungetc(c,stdin);string t=move(in);o=t;return true;}}
#endif
_T _SCAN(T &o) {int c{gcu()};return c==EOF?false:(ungetc(c,stdin),o=in,true);}
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);}
_OUT(const char *s){while(*s)pcu(*s++);}
_OUT(char c){pcu(c);}
#ifdef _S
_OUT(string &s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
	_T _OUT(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
	_HT _OUT(H &&h, T... t){out(h);out(t...);}
	template <typename... T> _OUTL(T... t){out(t...);outl();}
	struct range{
		int e,b=0,s=1;range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
		struct it{int v,s; it(int _v,int _s):v(_v),s(_s){} operator int()const{return v;} operator int&(){return v;}int operator*()const{return v;}
			it& operator++(){v+=s;return *this;} }; it begin(){return {b,s};} it end(){return {e,s};}};
#define times(i,n) for(int i=n;i;i--)

int main() {
	outl(((int) in - 30)/2);
}


Measured memory_bytes: 2576
# include <bits/stdc++.h>
# 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 SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
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 (b<a) { a=b; return 1; } return 0; }

static const ll mod = 1000000007LL;

int main() {
  int n; cin >> n;
  vector<ll> a(n);
  ll sum = 0;
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
    sum %= mod;
  }

  ll ans = 0;
  rep(i, n){
    sum = ((sum - a[i])%mod + mod) % mod;
    ll prod = (sum * a[i]) % mod;
    ans = (ans + prod) % mod;
  }

  cout << ans << endl;
}


Measured memory_bytes: 4836
#include<iostream>

using namespace std;

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

	int* a = new int[n];

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

	for (int i = n - 1; i >= 0; i--) {
		cout << a[i];
		if (i != 0) cout << " ";
	}
	cout << "\n";
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
using namespace std;
int n;
char a[110000];
int main() 
{
	cin>>n;
	int ans=n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=n;i++)
	{
		if(a[i]==a[i-1])
		ans--;
	}
	cout<<ans;
    return 0;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int>unnko(n);
for(int i = 0;i < n;i++){
  cin >> unnko[i];
}

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

cout << unnko[n-1]-unnko[0] <<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef pair<int,int> P;
typedef pair<P,P> PP;
int ast,game[4][4];

int score(int t){
  if(game[t][t]<0)return -1000;
  int res=0;
  for(int i=0;i<4;i++) {
    if(game[i][i]<0)continue;
    int a=game[t][i],b=game[i][t];
    if(a>b) res+=3;
    if(a==b)res++;
  }    
return res;
}

int goal(int t){
  int res=0;
  for(int i=0;i<4;i++)if(game[i][i]>=0)res+=game[t][i];
  return res;
}

int ngoal(int t){
  int res=0;
  for(int i=0;i<4;i++)if(game[i][i]>=0)res+=game[i][t];
  return res;
}


bool eq(PP a,PP b){return a.f==b.f&&a.s.f==b.s.f;}

int nCr(int n,int r){
  int a=1,b=1;
  for(int i=0;i<r;i++)a*=(n-i),b*=(i+1);
  return a/b;
}

double calc(double p){return nCr(8,p)*pow(1.0/4,p)*pow(3.0/4,8-p);}

double check(int n){
  if(game[ast][ast]<0)return 0;
  PP p[4];
  for(int i=0;i<4;i++)
    p[i]=PP(P(score(i),goal(i)-ngoal(i)),P(goal(i),i));
  sort(p,p+4,greater<PP>());
  vector<int>er;

  if(eq(p[0],p[1])){
    double cnt=0;
    for(int i=0;i<4;i++){
      if(!eq(p[0],p[i])&&game[p[i].s.s][p[i].s.s]>=0)er.push_back(p[i].s.s);
      cnt+=game[i][i]>=0;
    }
    if(!er.size())return n/cnt;
  }
  else if(n==2&&eq(p[1],p[2])){
    if(p[0].s.s==ast)return 1;
    for(int i=0;i<4;i++)
      if(!eq(p[1],p[i])&&game[p[i].s.s][p[i].s.s]>=0)er.push_back(p[i].s.s);
  }
  else return p[0].s.s==ast||(n==2&&p[1].s.s==ast);

  for(int i=0;i<er.size();i++)game[er[i]][er[i]]=-1;
  double res=check(n-!eq(p[0],p[1]));
  for(int i=0;i<er.size();i++)game[er[i]][er[i]]=0;
  return res;
}

double solve(){
  double res=0;
  vector<int> x,y;
  for(int i=0;i<4;i++)
    for(int j=0;j<4;j++)
      if(game[i][j]==-1)y.push_back(i),x.push_back(j);
  
  for(int i=0;i<=8;i++)
    for(int j=0;j<=8;j++)
      for(int k=0;k<=8;k++)
        for(int l=0;l<=8;l++){
	  int a[]={i,j,k,l};
	  double p=1.0;
	  for(int m=0;m<4;m++)game[y[m]][x[m]]=a[m],p*=calc(a[m]);
	  res+=check(2)*p;
	}
  return res;
}

int main(){
  int T;
  cin>>T;
  while(T--){
    memset(game,-1,sizeof(game));
    for(int i=0;i<4;i++) game[i][i]=0;
    string mp[5];
    for(int i=0;i<5;i++)cin>>mp[i];
    for(int i=0;i<4;i++)if(mp[0][5+5*i]=='*')ast=i;
    
    for(int i=0;i<4;i++)
      for(int j=i+1;j<4;j++) {
	int a=mp[i+1][5+5*j+1]-'0',b=mp[i+1][5+5*j+3]-'0';
	if(a=='_'-'0')continue;
	game[i][j]=a;
	game[j][i]=b;
      }
    printf("%.8f\n",solve());
  }
  return 0;
}

Measured memory_bytes: 3288
from heapq import heapify, heappush, heappop

N, K = map(int, input().split())
dts = []
for _ in range(N):
    t, d = map(int, input().split())
    dts.append((d, t-1))

dts.sort(reverse=True)

PQRem = []
isFounds = [False] * N
sumD = 0
for d, t in dts[:K]:
    sumD += d
    if isFounds[t]:
        heappush(PQRem, d)
    isFounds[t] = True
numKind = isFounds.count(True)

PQAdd = []
for d, t in dts[K:]:
    if not isFounds[t]:
        heappush(PQAdd, -d)
    isFounds[t] = True

ans = sumD + numKind**2
for x in range(numKind+1, K+1):
    if not PQRem or not PQAdd:
        break
    dRem = heappop(PQRem)
    dAdd = -heappop(PQAdd)
    sumD += -dRem + dAdd
    score = sumD + x**2
    ans = max(ans, score)

print(ans)


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

int main() {
	int N;
	std::cin >> N;

	std::vector<std::string> vs;
	bool ok = true;
	for (int i{}; i < N; ++i) {
		
		std::string x{}; std::cin >> x;
		
		if (!vs.empty()) 
			ok &= vs.back().back() == x[0];
	
		auto exist = std::find(vs.begin(), vs.end(), x) != vs.end();
		ok &= !exist;
		if (!exist)
			vs.emplace_back(x);

		if (!ok)
			break;

	}

	std::cout << (ok ? "Yes" : "No") << "\n";

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define MAX 1000000001
void mergesort(int *,int ,int );
void merge(int *,int ,int ,int );
int count=0,n,Left[250001],Right[250001],i,j,k,n1,n2;

int main(void){
  int S[500000];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&S[i]);
  mergesort(S,0,n);

  for(i=0;i<n;i++){
    printf("%d",S[i]);
    if(i!=n-1)printf(" ");
  }
  printf("\n%d\n",count);
  return 0;
}
void mergesort(int *S,int left,int right){
  int mid;
  if(left+1<right){
    mid=(left+right)/2;
    mergesort(S,left,mid);
    mergesort(S,mid,right);
    merge(S,left,mid,right);
  }
}
void merge(int *S,int left,int mid,int right){
  n1=mid-left;n2=right-mid;
  for(i=0;i<n1;i++)
    Left[i]=S[left+i];//not include mid
  for(i=0;i<n2;i++)
    Right[i]=S[mid+i];//include mid
  Left[n1]=MAX;
  Right[n2]=MAX;
  i=0;
  j=0;
  k=left;
  while(k<right){
    if(Left[j]>Right[i])S[k++]=Right[i++];
    else S[k++]=Left[j++];
  }
  count+=right-left;
}


Measured memory_bytes: 5760
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def main():
    a = list(map(int, input().split()))
    a.extend(list(map(int, input().split())))
    a.extend(list(map(int, input().split())))
    n = int(input())
    hit = [0] * 9
    for i in range(n):
        b = int(input())
        for j in range(9):
            if a[j] == b:
                hit[j] = 1

    ans = 'No'
    if hit[0] + hit[1] + hit[2] == 3:
        ans = 'Yes'
    if hit[3] + hit[4] + hit[5] == 3:
        ans = 'Yes'
    if hit[6] + hit[7] + hit[8] == 3:
        ans = 'Yes'
    if hit[0] + hit[3] + hit[6] == 3:
        ans = 'Yes'
    if hit[1] + hit[4] + hit[7] == 3:
        ans = 'Yes'
    if hit[2] + hit[5] + hit[8] == 3:
        ans = 'Yes'
    if hit[0] + hit[4] + hit[8] == 3:
        ans = 'Yes'
    if hit[2] + hit[4] + hit[6] == 3:
        ans = 'Yes'

    print(ans)


main()


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

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

  int i = 1;
  while(1) {
    int x = i;

    if(x % 3 == 0){
      cout<<" "<<i;
    }
    else {
      while(1){
        if(x % 10 == 3){
          cout<<" "<<i;
          break;
        }
        x /= 10;
        if(x == 0) break;
      }
    }

    if(++i > n) break;
  }
  cout<<endl;

  return 0;

}


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

using namespace std;

int main() {
  int x;
  cin >> x;
  if (x == 1) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 1;; i++) {
    if (2 * i + 1 >= x) {
      cout << i + 1 << endl;
      return 0;
    }
    x -= i;
  }

  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int a= 0;
		int b =0;
		int c =0;
		for (int i=0;i<N;i++) {
			int temp = sc.nextInt();
			if (A>=temp) {
				a++;
			} else if (B<temp) {
				c++;
			} else {
				b++;
			}
		}
		System.out.println(Math.min(a, Math.min(c, b)));
	}
}


Measured memory_bytes: 35980
#include <iostream>
#include <limits>
#include <climits>
#include <cmath>
#include <deque>
#include <cstring>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <vector>
#include <algorithm>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define fst first
#define snd second
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vint = vector<int>;

struct solver {
    void solve(int n, int k) {
        vector<int> xs(n);
        for (auto &it : xs) {
            cin >> it;
        }

        int ans = INT_MAX;

        for (int a = 0; a + k - 1 < n; a++) {
            int b = a + k - 1;

            ans = min(ans, abs(xs[b]) + abs(xs[b] - xs[a]));
            ans = min(ans, abs(xs[a]) + abs(xs[b] - xs[a]));
        }

        cout << ans << endl;
    }
};


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

    int n, k;
    while (cin >> n >> k) {
        solver s;
        s.solve(n, k);
    }
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
#define ALL(obj) (obj).begin(), (obj).end()
#define fi first
#define se second
#define NIL -1
using ll = long long;
const ll MOD = 1000000007;
#define REP(i,n) for (ll i=0; i < (n); ++i)
#define FOR(i,a,b) for (ll i=(a); i < (b); ++i)
using namespace std;

int get_gcd(int a, int b){while(1){if (a < b) swap(a, b); if (b == 0) return a; a %= b;}}
int get_lcm(int a, int b){return a * b / get_gcd(a, b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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

  int a,b;
  cin >> a >> b;

  auto sum_xor = [](int a, int b){
    int sum = 0;
    for (int i = a; i<=b; i++) {
      sum ^= i;
    }
    return sum;
  };

  // 4k XOR (4k+1) XOR (4k+2) XOR (4k+3) = 0
  // となるので、これを満たす区間を除外してXORの和を取ればよい。
  int aq = a/4;
  int ar = a%4;
  int bq = b/4;
  int br = b%4;

  int ans;
  if (aq == bq) {
    ans = sum_xor(a, b);
  }
  else {
    if (ar == 0) {
      if (br == 3) {
        ans = 0;
      }
      else {
        ans = sum_xor(b-br, b);
      }
    }
    else {
      if (br == 3) {
        ans = sum_xor(a, a + 3 - ar);
      }
      else {
        ans = sum_xor(a, a + 3 - ar) ^ sum_xor(b-br, b);
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
struct Drink{
    long long a;
	  long long b;
}d[100005];
bool cmp(Drink a,Drink b)
{
	return a.a<b.a;
}
int main()
{
    long long n,m;
    cin>>n>>m;
	  long long sum=0;
    for(int i=0;i<n;i++)
    {
				cin>>d[i].a>>d[i].b;
    }
    sort(d,d+n,cmp);
    long long i=0;
    while(m>0)
    {
			if(m>d[i].b)
			{
				sum+=d[i].a*d[i].b;
				m-=d[i].b;
      }
			else
			{
				sum+=m*d[i].a;
				m=0;
			}
			i++;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    cout<<(char)(s1[0]-'a'+65);
    cout<<(char)(s2[0]-'a'+65);
    cout<<(char)(s3[0]-'a'+65);
}

Measured memory_bytes: 256
import java.util.*;
import java.math.RoundingMode;
import java.math.BigDecimal;
 
 
 
public class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int t = sc.nextInt();
		int ans = 0;
		while(n>0) {
			ans++;
			n-=x;
		}
		System.out.println(ans*t);
		}
}

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


using namespace std;


#define ll long long
#define mk make_pair
#define pb push_back
#define ff first
#define sc second
#define all(x) x.begin(), x.end()
#define sz(x) (x).size()

ll gcd(ll a, ll b);

ll sum(int n);

void go(){
   int n,m;cin>>n>>m;
   int l=-1e5 + 7;
   int r=1e5 + 7;
   while(m--){
      int li,ri;cin>>li>>ri;
      if(li>l) l=li;
      if(ri<r) r=ri;
   }
   int ans=0;
   for(int i=1;i<=n;i++){
      if(i>=l&&i<=r){
         ans++;
      }
   }
   cout << ans;
}
int main(){
   
   ios_base::sync_with_stdio(0);
   cin.tie(0);
   cout.tie(0);

   go();

   return 0;
}

ll gcd(ll a, ll b){     
   if(b == 0) return a;
   
   return gcd(b, a % b);
}

ll sum(int n){                
   if(n == 0){
      return n;
   }else{
      return sum(n/10) + n%10;
   }
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
//
#include <bits/stdc++.h>
//
using namespace std;
//
#define krep(i,k,n)      for(int i=k;i<n;++i)
#define rep(i,n)         for(int i=0;i<n;++i)
#define toupp(s)         transform(s.begin(),s.end(),s.begin(),::toupper) // string
#define tolow(s)         transform(s.begin(),s.end(),s.begin(),::tolower) // string
#define pb(v)            push_back(v)
#define all(v)           v.begin(),v.end()
#define mp               make_pair
#define __sort(v)        sort(v.begin(),v.end()) // vector
#define __stable_sort(v) stable_sort(v.begin(),v.end()) // vector
#define __exists(c,v)    (find(all(c), (v)) != (c).end()) // vector
#define __unique(v)      __sort(v);v.erase(unique(v.begin(),v.end()),v.end()) // vector
#define __swap(a, b, tmp)  tmp=a;a=b;b=tmp;
#define __memset(a)      memset(a,0,sizeof(a));
//
#define dumpVar(v)       cout<<setw(30)<<#v" = ["<<v<<"]"<<endl
#define dumpArr(v, n)    for(int i=0;i<n;++i){cout<<v[i]<<", ";} cout<<endl
#define dumpPair(p)      cout<<"<"<<p.first<<", "<<p.second<<">"<<endl
//
typedef long long              ll;
typedef vector<string>         vs;
typedef vector<double>         vd;
typedef vector<int>            vi;
typedef pair<int, int>         pii;
typedef pair<double, double>   pdd;
//
int main ()
{
	ios::sync_with_stdio ( false );
	//
	/* code start */
	
	int a,b;
	
	cin >> a >> b;
	cout << max(a+b, max(a-b, a*b)) << endl;
	
	
	/* code end   */
	//
	return 0;
}


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


int main(){
    int N;
    int64_t sum=0;
    cin>>N;
    for (int i=0;i<N;i++){
        if((i+1)%3==0){
            continue;
        }
        else if((i+1)%5==0){
            continue;
        }
        else{
            sum+=i+1;
        }
    }
    cout<<sum<<endl;
    
    
    
}


Measured memory_bytes: 3636
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, M = map(int, input().split())
    S = tuple(map(int, input().split())) #1行ベクトル
    T = tuple(map(int, input().split()))
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

    dp=[[0]*(M+1) for _ in range(N+1)]
    for i in range(N+1):
        dp[i][0]=1
    for i in range(M+1):
        dp[0][i]=1

    for i in range(1,N+1):
        for j in range(1,M+1):
            dp[i][j]=dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1]
            if S[i-1]==T[j-1]:
                dp[i][j]+=dp[i-1][j-1]
            dp[i][j]%=mod
    print(dp[-1][-1])
    #printe(dp)

if __name__ == "__main__":
    main()

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

using namespace std;

# define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef pair<ll, ll> pll;

# define S second
# define F first
# define kill(x) return(cout << x << endl, 0)
# define debug(x) cerr<< #x << " : " << x << endl
# define ddebug(x, y) cerr<< #x << " : " << x  << ", " << #y << " : " << y << endl
# define sz(s) (int)s.size()
# define sq(x) (x) * (x)
# define PB(x) push_back(x)
# define smax(x, y) (x) = max((x), (y))
# define smin(x, y) (x) = min((x), (y))
# define all(x) x.begin(), x.end()
# define SP fixed << setprecision(10)

const int MAXN = 100 * 1000 + 10, MAXD = 13;
int n, m, 
    dis, 
    col, 
    ans[MAXN]; 

queue <int> q;
vector <pair<pii, int>> que;
vector <int> adj[MAXN];

int mark[MAXN];

void bfs(int r)
{
	if (mark[r] >= dis)
		return;

	q.push(r);
	mark[r] = dis;
	while (sz(q))
	{
		int u = q.front();
		q.pop();
		if (!ans[u])
			ans[u] = col;

		for (int v : adj[u])
			if (mark[v] < mark[u] - 1)
			{
				mark[v] = mark[u] - 1;
				q.push(v);
			}
	}
}

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

	cin >> n >> m;
	for (int i = 0; i < m; i ++)
	{
		int u, v;
		cin >> u >> v;
		u --, v --;
		adj[u].PB(v);
		adj[v].PB(u);
	}

	int q;
	cin >> q;
	for (int i = 0; i < q; i ++)
	{
		int v, d, c;
		cin >> v >> d >> c;
		v --;
		que.PB(make_pair(pii(v, d), c));
	}

	memset(mark, -1, sizeof mark);
	reverse(all(que));
	for (auto p : que)
	{
		dis = p.F.S;
		col = p.S;
		bfs(p.F.F);
	}

	for (int i = 0; i < n; i ++)
		cout << ans[i] << "\n";

	return 0;
}


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

using static Input;
class Program
{
    static int a;
    static string s;
    static void INPUT()
    {
        a = NextInt();
        s = NextString();
    }
    static void OUTPUT()
    {
        
        Console.WriteLine(a >= 3200 ? s: "red");
    }
    static void Main(string[] args)
    {
#if DEBUG  
        TESTINPUT();
#else
        INPUT();
#endif
        OUTPUT();
    }

    static void TESTINPUT()
    {
        a = 3200;
        s = "pink";
    }
}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}



Measured memory_bytes: 13268
#include <stdio.h>

int main(void) {
  int i, n, h, w, ans = 0, a, b;
  scanf("%d%d%d", &n, &h, &w);
  for(i = 0; i < n; ++i) {
    scanf("%d%d", &a, &b);
    if(a >= h && b >= w) ++ans;
  }
  printf("%d", ans);
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>

using namespace std;

typedef long long ll;

int main(){
ll N,A,B,C,D;
   cin >> N >> A >> B >> C >> D;
  
  for(ll m = 0; m < N; m++){
    ll X = C * ( N - 1 - m) - D * m;
    ll Y = - C * m + ( N - 1 - m ) * D;
    if( X <= B - A && B - A <= Y){ cout << "YES" << endl; return 0;}
  }
  cout << "NO" << endl; 
  
  return 0;}
      


Measured memory_bytes: 256