akhauriyash/Code-Regression huggingface dataset:
h, w = map(int, input().split())
a = []
for i in range(h):
    s = input()
    if s.count('.') != w:
        a.append(s)
b = []
for i in range(w):
    f = True
    for x in a:
        if x[i] != '.':
            f = False
    if f:
        b.append(i)
for x in a:
    for i in range(len(x)):
        f = True
        for j in b:
            if i == j:
                f = False
        if f:
            print(x[i], end='')
    print()

Measured memory_bytes: 4468
import sys
from bisect import bisect
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
b.sort()
c.sort()

bc = [0 for _ in range(n)]
for i in range(len(b)):
    if b[i] >= c[n-1]:
        break
    p = bisect(c,b[i])
    bc[i] = (n-p)

for i in range(len(b)-1,0,-1):
    bc[i-1] += bc[i]
ans = 0
for i in range(len(a)):
    if a[i] >= b[n-1]:
        break
    p = bisect(b,a[i])
    ans += bc[p]

print(ans)

Measured memory_bytes: 95332
<?php
list($n) = explode(" ", trim(fgets(STDIN)));
for($i = 0; $i < $n; $i++){
    $data[] = explode(" ", trim(fgets(STDIN)));
}

for($i = 0; $i < $n-1; $i++){
    $time = 0;
    for($j = $i; $j < $n-1; $j++){
        list($c, $s, $f) = $data[$j];
        if($s > $time){
            $time = $s;
        }else{
            $time = ceil($time / $f) * $f;
        }
        $time = $time + $c;
    }
    echo $time."\n";
}
echo "0\n";

Measured memory_bytes: 4728
#pragma region 宣言部分
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
typedef long long ll;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define rep(i,m,n) for(int i = (m);i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
#define Vec(a) vector <int> a
const int INF = 1 << 20;
const int MOD = 1e9+7;
 
#pragma endregion
 
 
 
int main(){
    ll n;
    cin >> n;
    if(n == 1){
        cout << 0 << endl;
        return 0;
    }
    ll m = n;
    vector <ll> sosuu;
    //cout << "!" << endl;
    for(ll i = 2;i*i <= m;i++){
        ll cnt = 0;
        while(m%i == 0){
            m /= i;
            cnt++;
        }
        if(cnt != 0)
            sosuu.pb(cnt);
    }
    ll res = 0;
    if(m > 1)
        res++;

    
    for(int i = 0;i < sosuu.size();i++){    
        
        //cout << i << " " << num[i] << endl;
        int r = 1;
        while(sosuu[i] >= 0){
            sosuu[i] -= r;
            r++;
        }
            //cout << r-2 << endl;
            res += (r-2);
        
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <stdio.h>

int main() {
	char str[21];
	
	scanf("%s", &str);
	
	for (int i = 0; i < 19; i++) {
		if (i != 5 && i != 13) {
			printf("%c", str[i]);
		}
		else if (i == 5 || i == 13) {
			printf(" ");
		}
	}
	
	return 0;
}

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(Math.max(a-2*b,0));
    }


    private static int[] toArray(String text) {
        String[] vars = text.split("\\s+");
        int[] res = new int[vars.length];
        for (int i = 0; i < vars.length; i++) {
            res[i] = Integer.valueOf(vars[i]);
        }
        return res;
    }
}


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

int main() {

	int n,i,ans;
	cin >> n;

	for (i = n; i <= (n*2)/2; i++) {
		if (i % 2 == 0 && i%n == 0) {
			ans = i;
			break;
		}
		else if (i = (n * 2) / 2) {
			ans = n * 2;
		}
	}

	cout << ans;

	return 0;
}

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

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define w(x)            int x; cin>>x; while(x--)
#define fr(i,a,b)       for(int i = a; i < b; i++)
#define inf 			(1LL<<60)
void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int csum[401];
int dp[401][401];
int slimes(vi &arr, int i, int j)
{
	if (i == j)
		return 0;
	if (dp[i][j] != -1)
		return dp[i][j];

	int min_cost = inf;
	for (int k = i; k < j; k++)
	{
		min_cost = min(min_cost , (csum[j + 1] - csum[i]) + slimes(arr, i, k) + slimes(arr, k + 1, j));
	}
	return dp[i][j] = min_cost;
}

void solve()
{
	int n;
	cin >> n;
	vi arr(n);
	fr(i, 0, n)
	cin >> arr[i];

	csum[0] = 0;
	fr(i, 0, n)
	csum[i + 1] = csum[i] + arr[i];
	memset(dp, -1, sizeof(dp));

	cout << slimes(arr, 0, n - 1) << endl;
	return;

}

int32_t main()
{
	c_p_c();
	solve();
	return 0;
}

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

int main() {
  int n;
  std::cin >> n;
  std::vector<int> diameters(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> diameters.at(i);
  }

  std::vector<int> ans(101, 0);
  for (int i = 0; i < n; ++i) {
    ++ans.at(diameters.at(i));
  }
  int count = 0;
  for (int i = 1; i <= 100; ++i) {
    if (ans.at(i)) {
      ++count;
    }
  }
  std::cout << count << std::endl;
}


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

using namespace std;

int dp[100002];

int main() {
	int N, i;
	cin >> N;
	int h[N];
	for(i = 0; i < N; i++) {
		cin >> h[i];
	}
	vector<int> dp(N, 0);
	dp[0] = 0;
	for(i = 1; i < N; i++) {
		dp[i] = dp[i-1] + abs(h[i] - h[i-1]);
		if(i >= 2) {
			dp[i] = min( dp[i] , dp[i-2] + abs(h[i] - h[i-2]) );
		}
	}
	cout << dp.back() << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
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; }
using namespace std;

const int mod = 1000000007;
struct mint{ //modint
    int x;
    mint(int x = 0): x(x % mod) {}
    friend istream& operator >> (istream &s, mint& m){ return s >> m.x; }
    friend ostream& operator << (ostream &s, mint m){ return s << m.x; }
    inline mint& operator += (mint a){ if((x += a.x) >= mod)x -= mod; return *this; }
    inline mint& operator -= (mint a){ if((x += mod - a.x) >= mod)x -= mod; return *this; }
    inline mint& operator *= (mint a){ (x *= a.x) %= mod; return *this; }
    inline mint& operator /= (mint a){ return(*this) *= a.inv(); }
    inline mint operator + (mint a){ mint res(*this); return res += a; }
    inline mint operator - (mint a){ mint res(*this); return res -= a; }
    inline mint operator * (mint a){ mint res(*this); return res *= a; }
    inline mint operator / (mint a){ mint res(*this); return res /= a; }
    inline bool operator == (mint a){ return x == a.x; }
    inline bool operator != (mint a){ return x != a.x; }
    inline bool operator < (mint a){ return x < a.x; }
    inline bool operator > (mint a){ return x > a.x; }
    inline bool operator <= (mint a){ return x <= a.x; }
    inline bool operator >= (mint a){ return x >= a.x; }
    inline void takemod(){ x = ((x % mod) + mod) % mod; }
    mint inv(){ return pow(mod - 2); }
    mint pow(int p){
        mint res(1), tmp(x);
        for(; p; p >>= 1){ if(p & 1)res *= tmp; tmp *= tmp; }
        return res;
    }
};

struct mfact{ //modfact
    vector<mint> fact;
    mfact(int size = 200010){
        fact = vector<mint>(size + 1); fact[0] = 1;
        rep(i, size)fact[i + 1] = fact[i] * (i + 1);
    }
    inline mint operator [] (int i){ return fact[i]; }
    inline mint nPr(int n, int r){ return fact[n] / fact[r]; }
    inline mint nCr(int n, int r){ return fact[n] / (fact[n - r] * fact[r]); }
};

signed main(void){
    
    int N; cin >> N;
    vector<int> a(N);
    rep(i, N)cin >> a[i];

    vector<mint> vec(N + 1);
    rep(i, N){
        vec[i + 1] = vec[i] + mint(i + 1).inv();
    }

    mint fact = mfact(100010).fact[N];
    mint ans(0);
    rep(i, N){
        mint tmp = (vec[i + 1] + vec[N - i] - mint(1));
        ans += tmp * mint(a[i]) * fact;
    }

    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 2560
/*  
    Talkin' to myself and feelin' old
    Sometimes I'd like to quit, nothin' ever seems to fit
    Hangin' around, nothin' to do but frown
    Rainy days and Mondays always get me down
    _________________________
    _________________________
    912 Hours of Solitude
    Quarantine_Day : 38
*/

#include<bits/stdc++.h>

using namespace std;

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

#define pb(n)           push_back(n)
#define GSORT(v)        sort(v.begin(), v.end(), greater<int>())
#define SORT(v)         sort(v.begin(), v.end());
#define REV(v)          reverse(v.begin(), v.end());
#define db(a)           cout<<#a<<" = "<<a<<endl;
#define FIN             freopen("in.txt","r",stdin);
#define FOUT            freopen("out.txt","w",stdout);
#define REP(i,n)        for(int i = (int)(0); i < (int)(n); i++)
#define FOR(i, a, b)    for(int i = (int)a; i <= (int)b; i++)    

#define MAX 50005


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

	int n; cin>>n;
	int ans, t = -1;
	FOR(i, 1, n){
		int m = i, k = 0;
		while(m % 2 == 0){
			k++;
			m /= 2;
		}
		if(k > t){
			ans = i;
			t = k;
		}
	}
	cout<<ans<<"\n";
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <queue>
#include<iomanip>
#include <cmath>
#include <set>
#include <unordered_set>

#define ABS(x) ((x)>0?(x):-(x))
#define MIN(x,y) ((x)>(y)?(y):(x))
#define MAX(x,y) ((x)<(y)?(y):(x))

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

#define INF 1000000000

using namespace std;
typedef long long ll;

ll newton(long long int a, long long int  b)
{
	if(a==b)
		return a;
	while(a != 0 && b != 0)
	{
		if(a > b)
		{
			b += a;
			a = b-a;
			b -= a;
		}
		b %= a;
	}
	return a;
}

struct UnionFind {
	vector<int> p;
	UnionFind(int N):p(N)
	{
		for(int i=0; i< N; i++)
		{
			p[i] = i;
		}
	}
	int root(int x)
	{
		if(p[x] == x)
			return x;
		return p[x] = root(p[x]);
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if(rx == ry) return;
		p[rx] = ry;
	}
	bool issame(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

//大きな数に対する割り算をするとき、MODを指定することで掛け算の値に変換できる

ll div2mul_calc(ll a, ll b, ll m)
{
	if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll d = div2mul_calc(a, b / 2, m);
        return (d * d) % m;
    } else {
        return (a * div2mul_calc(a, b - 1, m)) % m;
    }
}
ll div2mul(ll n, ll mod)
{
	return div2mul_calc(n, mod-2, mod);
}

ll twoRow(ll a, ll b, ll mod)
{
	ll ret = 1;
	for(ll i = 1 ;i <= a+b;++i)
	{
		ret *= i;
		ret %= mod;
	}
	for(ll i = 1 ;i <= a;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	for(ll i = 1 ;i <= b;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	return ret;
}

struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};

vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return (ret);
}
/*
小数の桁数を指定する
	cout << setprecision(8)<< mp[0]-mx << endl;
*/

int main()
{
	ll i,j,k,a,b;
	ll N,M;
	char c = '>';
	vector<ll> v;
	string S;
	cin >> S;
	ll s_len = S.size();
	j = 0;
	for(i=0;i<s_len;++i)
	{
		if(S[i] == c)
		{
			++j;
		}
		else
		{
			c = S[i];
			v.push_back(j);
			j=1;
		}
	}
	v.push_back(j);
	if(c == '>')
	{
		v.push_back(0);
	}
	s_len = v.size()/2;
	k = 0;
	k += v[0];
	k += v[s_len*2-1];
	for(i=0;i<s_len;++i)
	{
		if(i<s_len-1)
		{
			k+=MAX(v[i*2+1],v[i*2+2]);
		}
		if(v[i*2] > 1)
		{
			k += v[i*2]*(v[i*2]-1)/2;
		}
		if(v[i*2+1] > 1)
		{
			k += v[i*2+1]*(v[i*2+1]-1)/2;
		}
	}
	cout << k << endl;
	return 0;
}




















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

N = input()
input_line = input()
Ai = input_line.split(" ")
NumAi = np.array(Ai)
Comment = "NO"
N = int(N)
if(len(NumAi) == len(np.unique(NumAi))):
  Comment = "YES"

#if(NumAi != set)
      
print(Comment)

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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

using i64=int64_t;

bool connected(vector<set<int>>& graph){
    int size=graph.size(),count_vertex=0;
    vector<bool> visited(size);
    function<void(int)> mark=[&](int u){
        if(visited[u]) return;
        visited[u]=true;
        ++count_vertex;
        for(auto v:graph[u]) mark(v);
    };

    mark(0);

    return count_vertex==size;
}

void solve(){
    int N,M;
    cin >> N >> M;

    vector<set<int>> graph(N);
    vector<pair<int,int>> edges;
    rep(i,0,M){
        int a,b;
        cin >> a >> b;
        --a;
        --b;
        graph[a].insert(b);
        graph[b].insert(a);
        edges.push_back(make_pair(a,b));
    }

    int ans=0;
    for(auto& edge:edges){
        int a=edge.first,b=edge.second;
        graph[a].erase(b);
        graph[b].erase(a);
        if(!connected(graph)) ++ans;
        graph[a].insert(b);
        graph[b].insert(a);
    }
    
    cout << ans <<endl;
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
L, R = map(int, input().split())
MOD = 2019
res = 2019
R = min(R, L+MOD)
for i in range(L, R+1):
    for j in range(i+1, R+1):
        res = min(res, (i*j)%2019)
        if res == 0:
            break
print(res)

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

struct Card{
	char suit, value;
};

void bubble(struct Card A[], int N){
	for( int i = 0; i < N; i++ ){
		for( int j = N - 1; j >= i; j-- ){
			if( A[j].value < A[j - 1].value ){
				Card t = A[j];
				A[j] = A[j - 1];
				A[j - 1] = t;
			}
		}
	}
}

void selection(struct Card A[], int N){
	for( int i = 0; i < N; i++ ){
		int minj = i;
		for( int j = i; j < N; j++ ){
			if( A[j].value < A[minj].value ) minj = j;
		}
		Card t = A[i];
		A[i] = A[minj];
		A[minj] = t;
	}
}

void print(struct Card A[], int N){
	for( int i = 0; i < N; i++ ){
		if( i > 0 ) cout << " ";
		cout << A[i].suit << A[i].value;
	}
	cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int N){
	for( int i = 0; i < N; i++ ){
		if( C1[i].suit != C2[i].suit ) return false;
	}
	return true;
}

int main(){
	Card C1[100], C2[100];
	int N;
	char ch;
	
	cin >> N;
	for( int i = 0; i < N; i++ ){
		cin >> C1[i].suit >> C1[i].value;
	}
	
	for( int i = 0; i < N; i++ ) C2[i] = C1[i];
	
	bubble(C1, N);
	selection(C2, N);
	
	print(C1, N);
	cout << "Stable" << endl;
	print(C2, N);
	if( isStable(C1, C2, N) ){
		cout << "Stable" << endl;
	} else {
		cout << "Not stable" << endl;
	}
	
	return 0;
}

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

double dp[301][301][301];
int n;
double solve(int cnt1, int cnt2, int cnt3) {
  if(cnt1 < 0 || cnt2 < 0 || cnt3 < 0) return 0;
  if(!cnt1 && !cnt2 && !cnt3) {
    return 0;
  }
  double &ans = dp[cnt1][cnt2][cnt3];
  if(ans) return ans;
  return ans = (1.0*n/(cnt1+cnt2+cnt3)) * ( (1.0*cnt1/n) * solve(cnt1-1, cnt2, cnt3)
  + (1.0*cnt2/n) * solve(cnt1+1, cnt2-1, cnt3)
  + (1.0*cnt3/n) * solve(cnt1, cnt2+1, cnt3-1) + 1);
}
int main () {
  int cnt1, cnt2, cnt3;
  cnt1 = cnt2 = cnt3 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if(x == 1) cnt1++;
    if(x == 2) cnt2++;
    if(x == 3) cnt3++;
  }
  cout << fixed << setprecision(10) << solve(cnt1,  cnt2, cnt3) << endl;
}

Measured memory_bytes: 213248
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
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; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
int main()
{
    ll N, K, ans;
    cin >> N >> K;

    ans = K;
    rep(i, N - 1) {
        ans *= K - 1;
    }
    
    cout << ans << endl;
    return 0;
}

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

int N,M, cnt[101010], dp[101010];
vector<vector<int>> G(101010);

int main(){
  cin>>N>>M;
  rep(i,M){
    int x,y; cin>>x>>y; x--,y--;
    G[x].push_back(y);
    cnt[y]++;
  }
  queue<int> que;
  rep(i,N) if(cnt[i]==0) que.push(i);
  vector<int> V;
  while(que.size()){
    int v=que.front(); que.pop();
    V.push_back(v);
    for(int u:G[v]){
      cnt[u]--;
      if(cnt[u]==0) que.push(u);
    }
  }
  int ans=0;
  for(int v:V) for(int u:G[v]){
    dp[u]=max(dp[u],dp[v]+1);
    ans=max(ans,dp[u]);
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 7032
import numpy as np
n = int(input())
A = list(map(int,input().split()))
A.sort()
Amax = A[-1]

A = np.array(A)

judge = np.zeros(Amax+1,int)
judge[A]=1

for i in range(n):
    if not judge[A[i]]: continue
    if i<n-1 and A[i]==A[i+1]:
        judge[A[i]] = 0
    judge[np.arange(2,Amax//A[i]+1) * A[i]] = 0

print(judge.sum())

Measured memory_bytes: 51632
use std::cmp;

struct MyIo{

}

impl MyIo{
    fn readline()->Vec<String>{
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let ret:Vec<String> = buf.split_whitespace().map(|c|c.to_string()).collect();
        ret
    }
}


fn main() {

    let mut input = MyIo::readline().into_iter();
    let N = input.next().unwrap().parse::<u32>().unwrap();
    let mut values = MyIo::readline().into_iter();
    let max = values.clone().map(|v| v.parse::<u32>().unwrap()).fold(0,|acc ,x| cmp::max(acc,x));
    let min = values.map(|v| v.parse::<u32>().unwrap()).fold(1000000000,|acc ,x| cmp::min(acc,x));
    println!("{:?}",max-min);

}

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

int in[100001] = {}, out[100001] = {};

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

    int l, r;
    for(int i = 0; i < n; i++){
        cin >> l >> r;
        in[l]++;
        out[r]++;
    }

    int inshop = 0;
    int ans = 0;
    for(int i = 0; i <= t; i++){
        inshop += in[i] - out[i];
        ans = max(ans, inshop);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3872
def xor_one(a):
    k=change_binary(a)

    if k[len(k)-1]=="0":
        ad="1"

    else:
        ad="0"
    m="0b"+k[:len(k)-1]+ad
    return int(m,0)
    
    

def binary_fanction(a):
    r=(a+1)//2
    if (a+1)%2==0:
        return r%2
    else:
        k=change_binary(a)
        if r%2==0:
            return a
        else :
            return xor_one(a)

def change_binary(a):
    k=str(bin(a)).replace("0b","")
    return k

def exclusive_or(a,b):
    big_bin=change_binary(max(a,b))
    small_bin=change_binary(min(a,b))
    small_bin="0"*(len(big_bin)-len(small_bin))+small_bin
    k=""
    

    for i in range(len(small_bin)):
        k=k+str(int(big_bin[i])^int((small_bin[i])))
        
    k="0b"+k
    return int(k,0)

a,b=map(int,input().split())
print(exclusive_or(binary_fanction(a-1),binary_fanction(b)))

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <cstdio>
#include <iomanip>

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;(i)>=0;(i)--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())

typedef long long ll;

int main(){

    
    string s;
    cin>>s;
    REP(i,s.size())s[i]=(char)((s[i]-'A'-3+26)%26 + 'A');
    cout<<s<<endl;
    
    return 0;
    
}

Measured memory_bytes: 3112
#include <iostream>
#include <cmath>

using namespace std;

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

  if(abs(A - B) > (long long)pow(10,18)){
    cout << "Unfair" <<endl;
    return 0;
  }
  if(K % 2 == 0){
    cout << A-B <<endl;
  }
  else{
    cout << B-A <<endl;

  }

  return 0;
}


Measured memory_bytes: 256
function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  if(a+b>=24){
    console.log(a+b-24);
  }else{
    console.log(a+b);
  }
}



main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

#define ll long long
#define pi pair<int,int>
#define x first
#define y second

ll in() {ll x=0;int o=0,c=char();for(;!isdigit(c);c=getchar()) o=c=='-';for(;isdigit(c);c=getchar()) x=x*10+c-'0';return o?-x:x;}
char inchar() {char c=getchar();while(c==' '||c=='\n') c=getchar();return c;}
#define in in()
#define inchar inchar()

#define FOR(i,a,b) for(int i=a,_=b;i<=_;i++)
#define ROF(i,a,b) for(int i=b,_=a;_<=i;i--)
#define FR(i,n) FOR(i,1,n)
#define RR(x,a,b) {cout<<#x<<": ";FOR(__,a,b) cout<<x[__]<<" ";cout<<"\n";}
#define rr(x) " "<<#x<<'='<<(x)<<" "

template<typename A,typename B>A min(A a,B b){return a<b?a:b;}
template<typename A,typename B>A max(A a,B b){return a>b?a:b;}
template<typename A,typename B>bool Min(A &a,B b){if(a<b) return 0;a=b;return 1;}
template<typename A,typename B>bool Max(A &a,B b){if(a>b) return 0;a=b;return 1;}

#define VEC(i,a) for(auto&i:a)
#define pb push_back
#define vall(a) a.begin(),a.end()
#define fiv(a) (int)a.size()-1

#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))
#define mu2(x) (1ll<<x)
#define bitnum(x) __builtin_popcountll(x)

#define freopen(x,o) freopen(x".inp","r",stdin);if(o) freopen(x".out","w",stdout);
#define false(x) if(!(x))
#define middle(a,b) (a+(b-(a))/2)
#define memset(x,a) memset(x,a,sizeof x)
//}

const int N=5e5+5;
int n,q;
string s[N];

int t[N][30],w[N][30],T;
int sum[N][30][30];
int intc(char c)
{
    if(c=='#') return 0;
    return c-'a'+1;
}
void ADD_TRIE(int S)
{
    int x=0;
    FOR(i,0,fiv(s[S]))
    {
        int c=intc(s[S][i]);
        if(t[x][c]==0) t[x][c]=++T;
        w[x][c]++;

        x=t[x][c];
    }
}

void BIL_TRIE(int S)
{
    int x=0;
    FOR(i,0,fiv(s[S]))
    {
        int c=intc(s[S][i]);
        FOR(i,0,26) if(t[x][i]) sum[S][c][i]+=w[x][i];

        x=t[x][c];
    }
}
main()
{
    //freopen("hz",0);
    n=in;
    FOR(i,1,n) cin>>s[i],s[i]+='#';
    FOR(i,1,n) ADD_TRIE(i);
    FOR(i,1,n) BIL_TRIE(i);
    FOR(i,1,in)
    {
        int k=in;string a;

        ll res=0;
        cin>>a;a="#"+a;
        FOR(i,0,fiv(a)) FOR(j,0,i-1) res+=sum[k][intc(a[i])][intc(a[j])];
        cout<<res+1<<"  \n";
    }
}


Measured memory_bytes: 417536
#include "bits/stdc++.h"
#include<random>
using namespace std; typedef unsigned long long _ulong; typedef long long int lint; typedef pair<lint, lint> plint; typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define endk '\n'
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; }
const lint mod = 1e9 + 7, INF = 1e18;
lint dx[8] = { 0, -1, 1, 0, 1, -1, 1, -1 }, dy[8] = { 1, 0, 0, -1, -1, -1, 1, 1 };
typedef pair<double, lint> Pa;
typedef pair<plint, lint> tlint;
struct edge {
	lint cost;
	lint u, v;
};

string s, t;
int main() {
	cin >> s >> t;
	lint minv = SZ(s);
	REP(i, SZ(s) - SZ(t) + 1) {
		lint cnt = 0;
		REP(j, SZ(t)) {
			if (s[i + j] != t[j]) cnt++;
		}
		chmin(minv, cnt);
	}
	cout << minv << endk;
}


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

int main() {
	int a, b;

	cin >> a >> b;

	if ((a * b) % 2 == 0) {
		cout << "Even" << endl;
	}
	else {
		cout << "Odd" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, f, n) for (ll i = (f); i < (n); i++)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
ll const INF = 1LL << 60;
ll const MAX_N = 510000;
ll const MOD = 1000000007;

int main() {
    vector<ll> P(3);
    cin >> P[0] >> P[1] >> P[2];

    cout << min(min(P[0] + P[1], P[0] + P[2]), P[1] + P[2]) << endl;

    return 0;
}

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

int main() {

	int n, k;
	cin >> n >> k;

	if(n >= k && (n+1) / 2 >= k){
		cout << "YES" << endl;
	}
	else{
		cout << "NO" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mp make_pair
#define eb emplace_back
#define f first
#define s second
#define sz(x) (ll)x.size()
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> osSet;

using pll = pair<ll, ll>;

const ll maxN = 1e7;
const ll INF = 1e17;
const ll MOD = 1e9 + 7;

ll xs[] = {-1, 1, 0, 0, -1, 1, 1, -1};
ll ys[] = {0, 0, -1, 1, -1, 1, -1, 1};

ll segtree[maxN << 2];
ll lazy[maxN << 2];
ll A[maxN];

inline ll left(ll x){
	return x << 1;
}

inline ll right(ll x){
	return (x<<1) + 1;
}

ll func(ll x){
	return (x*(x+1))/2;
}

ll _pow(ll b, ll p){
	if(p == 0) return 1;
	if(p == 1) return b;
	ll exB = b*b;
	if(p&1) return b*_pow(exB, p/2);
	return _pow(exB, p/2);
}

int main(){
	cin.sync_with_stdio(false);
	cin.tie(0);
	ll n, m, d;
	cin >> n >> m >> d;
	ll a[n][m];
	pll P[(n*m)+1];
	for(ll i=0; i<n; i++){
		for(ll j=0; j<m; j++){
			cin >> a[i][j];
			P[a[i][j]] = mp(i+1, j+1);
		}
	}
	vector<ll> pref((n*m)+1, 0);
	for(ll i=1; i<=d; i++){
		ll li = P[i].f, lj = P[i].s;
		for(ll j=i; j<=(n*m)+1; j+=d){
			if(j == i)
				pref[j] = 0;
			else{
				pref[j] = pref[j-d] + abs(li-P[j].f) + abs(lj-P[j].s);
				li = P[j].f, lj = P[j].s;
			}
		}
	}
	ll t;
	cin >> t;
	while(t--){
		ll x, y;
		cin >> x >> y;
		cout << pref[y]-pref[x] << "\n";
	}
	return 0;
}

Measured memory_bytes: 6092
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

lli n;
vector<pair<lli, lli>> v;
int main() {
  cin >> n;
  init_n(v, n);
  for (lli i=0; i<n; ++i) {
    lli a, b;
    cin >> a >> b;
    v[i].first = a+b; v[i].second = a;
  }
  sort(begin(v), end(v), greater<pair<lli,lli>>());
  lli sa = 0, sb = 0;
  bool o=true;
  for (lli i=0; i<n; ++i) {
    if (o) {
      sa += v[i].second;
    } else {
      sb += v[i].first - v[i].second;
    }
    o = !o;
  }
  cout << (sa - sb) << endl;
  return 0;
}



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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    int d; cin >> d;

    vector<int> c(26);
    for (int i = 0; i < 26; ++i) {
        cin >> c[i];
    }

    vector<vector<int>> s(d, vector<int>(26));
    for (int i = 0; i < d; ++i) {
        for (int j = 0; j < 26; ++j) {
            cin >> s[i][j];
        }
    }

    vector<int> t(d);
    for (int i = 0; i < d; ++i) {
        int tc; cin >> tc;
        tc--;
        t[i] = tc;
    }

    int score = 0;
    vector<int> last(26, 0);
    for (int i = 0; i < d; ++i) {
        score += s[i][t[i]];
        last[t[i]] = i + 1;

        int j = i + 1;

        for (int k = 0; k < 26; ++k) {
            score -= c[k] * (j - last[k]);
        }

        cout << score << endl;
    }
}

Measured memory_bytes: 3688
def main():
    n, x = map(int, input().split())
    a = list(map(int, input().split()))

    a.sort()

    i = 0
    while i < n - 1 and x >= a[i]:
        x -= a[i]
        i += 1

    if i == n - 1 and a[i] == x:
        i += 1

    print(i)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <map>
#include <set>

using namespace std;

typedef long long ll;

const int MAXN = 8005;
const int MAXM = 205;
const ll MOD = 998244353;
const ll g = 3;

int n,m,N;
int rev[MAXN << 2];

ll ans,Inv;
ll fac[MAXN];
ll inv[MAXN];
ll f[2][MAXN];
ll a[MAXN << 2];
ll b[MAXN << 2];
ll c[MAXN << 2];
ll wn[2][MAXN << 2];

ll power(ll a,ll b)
{
	ll res = 1;
	while (b)
	{
		if (b & 1)
			(res *= a) %= MOD;
		(a *= a) %= MOD;
		b >>= 1;
	}
	return res;
}

void init()
{
	fac[0] = 1;
	for (int i = 1;i <= n;i++)
		fac[i] = fac[i - 1] * i % MOD;
	inv[n] = power(fac[n],MOD - 2);
	for (int i = n;i >= 1;i--)
		inv[i - 1] = inv[i] * i % MOD;
	N = 1;
	while (N < (n << 1))
		N <<= 1;
	Inv = power(N,MOD - 2);
	int half = N >> 1;
	for (int i = 1;i < N;i++)
		rev[i] = (rev[i >> 1] >> 1) + (i & 1) * half;
	for (int i = 0;i < half;i++)
	{
		wn[0][i + half] = power(g,(MOD - 1) * i / N);
		wn[1][i + half] = power((MOD + 1) / g,(MOD - 1) * i / N);
	}
	for (int i = half - 1;i >= 0;i--)
	{
		wn[0][i] = wn[0][i << 1];
		wn[1][i] = wn[1][i << 1];
	}
}

void NTT(ll *v,bool inv)
{
	for (int i = 0;i < N;i++)
		if (i < rev[i])
			swap(v[i],v[rev[i]]);
	for (int i = 1;i < N;i <<= 1)
		for (int j = 0;j < N;j += i << 1)
		{
			ll *l = v + j,*r = v + j + i,*w = wn[inv] + i,A;
			for (int k = 0;k < i;k++,l++,r++,w++)
			{
				A = *r * *w;
				*r = (*l - A) % MOD;
				*l = (*l + A) % MOD;
			}
		}
	if (inv)
	{
		for (int i = 0;i < N;i++)
			(v[i] *= Inv) %= MOD;
	}
}

int main()
{
	scanf("%d%d",&n,&m);
	init();
	f[0][0] = 1;
	for (int i = 1;i <= m;i++)
	{
		memset(f[i & 1],0,sizeof(f[i & 1]));
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		for (int j = 0;j <= n - 2;j++)
		{
			a[j] = inv[j + 2];
			b[j] = inv[j] * (f[~i & 1][j] + f[~i & 1][j + 1] * 2 + f[~i & 1][j + 2]) % MOD;
		}
		NTT(a,0);
		NTT(b,0);
		for (int j = 0;j < N;j++)
			c[j] = a[j] * b[j] % MOD;
		NTT(c,1);
		for (int j = 0;j <= n;j++)
		{
			f[i & 1][j] = (f[~i & 1][j] + j * (f[~i & 1][j - 1] + f[~i & 1][j])) % MOD;
			if (j >= 2)
				(f[i & 1][j] += fac[j] * c[j - 2]) %= MOD;
		}
	}
	for (int i = 0;i <= n;i++)
		(ans += f[m & 1][i] * fac[n] % MOD * inv[i] % MOD * inv[n - i]) %= MOD;
	printf("%lld\n",(ans + MOD) % MOD);
	return 0;
}


Measured memory_bytes: 1408
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        for (int i = 0; i < s.length(); i += 2) {
            System.out.print(s.charAt(i));
        }
        System.out.print("\n");
    }
}


Measured memory_bytes: 33072
class UnionFind:
    def __init__(self, n=1):
        self.parent = [i for i in range(n)]
        self.rank = [0] * n
    
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.parent[y] = x
    
    def is_same(self, x, y):
        return self.find(x) == self.find(y)


N, M = map(int, input().split())
uf = UnionFind(N)
for i in range(M):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)

for i in range(N):
    uf.find(i)

print(len(set([uf.find(i) for i in range(N)])) - 1)

Measured memory_bytes: 22552
#include <stdio.h>

int main(void){
    int N;
    char S[51];
    char A[] = {"ABC"};
    //printf("%s\n",A);
    int count=0;
    scanf("%d %s",&N,S);
    for(int i=0; i<=N-3; i++){
        for(int j=0; j<3; j++){
            //printf("i=%d j=%d S[i+j]=%c A[j]=%c\n",i,j,S[i+j],A[j]);
            if(S[i+j] == A[j]){
                if(j==2) count++;
            }else{
                break;
            }
        }
    }
    printf("%d",count);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define rrep(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;


int main()
{
    ll A, B, ans;
    scanf("%ld %ld", &A, &B);

    ans = A*(A-1)/2 + B*(B-1)/2;

    printf("%ld", ans);

    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>

using namespace std;

template<class T> void gc(T &x)
{
    char c;
    int s = 0;
    x = 0;

    c = getchar_unlocked();

    if (c == '-') s = 1;
    else if ('0' <= c && c <= '9')  x = c - '0';

    while (true)
    {
        c = getchar_unlocked();

        if (c < '0' || c > '9') break;
        x = x * 10 + (c - '0');
    }

    if (s) x = -x;
}

int main()
{
    int N, T;
    gc(N);
    gc(T);

    int bk, t;
    gc(t);
    bk = t;

    long long int overlap = 0LL;

    for (int i = 1; i < N; i++)
    {
        gc(t);

        int dif = T - (t - bk);

        overlap = dif < 0 ? overlap : overlap + dif;

        bk = t;
    }

    printf("%lld\n", (long long int)N * T - overlap);
    return 0;
}


Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
abc = [list(map(int, input().split())) for _ in range(n)]

dp = [[0, 0, 0] for _ in range(n)]
dp[0] = abc[0]
for i in range(1, n):
    dp[i][0] = abc[i][0] + max(dp[i-1][1], dp[i-1][2])
    dp[i][1] = abc[i][1] + max(dp[i-1][0], dp[i-1][2])
    dp[i][2] = abc[i][2] + max(dp[i-1][0], dp[i-1][1])
print(max(dp[-1]))


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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
//#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

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;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vin(Vi &v){REP(i,0,(v).size()) cin>>v[i];}
void vin(Vi &v,Vi &v2){REP(i,0,(v).size()) cin>>v[i]>>v2[i];}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
void accum(Vi &v){REP(i,1,(v).size()) v[i]+=v[i-1];}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long M){
    if(N==M) cout<<YES<<endl;
    else cout<<NO<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
signed main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


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

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

    if (A + B == C + D)
    {
        cout << "Balanced" << endl;
    } else if (A + B > C + D)
    {
        cout << "Left" << endl;
    } else {
        cout << "Right" << endl;
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		//test
		Scanner sc = new Scanner(System.in);
		String s[] = sc.nextLine().split(" ");
		int N = Integer.parseInt(s[0]);
		int X = Integer.parseInt(s[1]);
		int T = Integer.parseInt(s[2]);

		int result = 0;
		if (N % X == 0) {
			result = ( N / X ) * T ;
		} else {
			result = ( N / X + 1) * T;
		}

		System.out.println(result );
	}

}


Measured memory_bytes: 35708
#include <bits/stdc++.h>
#define N 405
#define M 100050
using namespace std;
int F[N][N],imp[N],a[M],b[M],n,m;
inline int rd() {int r;scanf("%d",&r);return r; }
int main() {
	n = rd(), m = rd();
	for (int _=1;_<=m;_++) a[_] = rd(), b[_] = rd();

	for (int x=1;x<=n;x++) {
		F[x][x] = 1;
		for (int _=m;_>=1;_--) {
			if (!F[x][a[_]] && !F[x][b[_]]) continue;
			if (F[x][ a[_] ] && F[x][ b[_] ]) {imp[x] = 1; break;}
			if (F[x][ a[_] ])
				F[x][ b[_] ] = 1;
			else
				F[x][ a[_] ] = 1;
		}
	}
	
	int ans = 0;
	for (int i=1;i<=n;i++)
		for (int j=i+1;j<=n;j++) if (!imp[i] && !imp[j]) {
			int flag = 1;
			for (int _=1;_<=n;_++) if (F[i][_] && F[j][_]) flag = 0;
			ans += flag;
		}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <sstream>
#include <set>
#include <map>
#define LLMAX 9223372036854775807

using namespace std;
using ll = long long;

int main() {
	ll argX, argY, argZ, argK;
	cin >> argX >> argY >> argZ >> argK;

	vector<ll> argA(argX);
	for (auto itr = argA.begin(); itr != argA.end(); ++itr) {
		cin >> *itr;
	}

	vector<ll> argB(argY);
	for (auto itr = argB.begin(); itr != argB.end(); ++itr) {
		cin >> *itr;
	}

	vector<ll> argC(argZ);
	for (auto itr = argC.begin(); itr != argC.end(); ++itr) {
		cin >> *itr;
	}

	sort(argA.begin(), argA.end(), greater<ll>());
	sort(argB.begin(), argB.end(), greater<ll>());
	sort(argC.begin(), argC.end(), greater<ll>());

	vector<ll> ret;
	for (ll i = 0; i < argA.size(); ++i) {
		for (ll j = 0; j < argB.size(); ++j) {
			for (ll k = 0; k < argC.size(); ++k) {
				if ((i + 1) * (j + 1) * (k + 1) > argK) {
					break;
				}
				ret.push_back(argA.at(i) + argB.at(j) + argC.at(k));
			}
		}
	}

	sort(ret.begin(), ret.end(), greater<ll>());
	for (ll i = 0; i < argK; ++i) {
		cout << ret.at(i) << endl;
	}
}

Measured memory_bytes: 1404
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s = "";
  int m, h;
  cin >> s;
  while (s != "-")
  {
    cin >> m;
    for (int i = 0; i < m; i++)
    {
      cin >> h;
      for (int j = 0; j < h; j++)
      {
        char g = s.at(0);
        s = s.substr(1, s.size() - 1) + g;
      }
    }
    cout << s << endl;

    cin >> s;
  }
}



Measured memory_bytes: 3076
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int N, A, B;
    cin >> N >> A >> B;
    if ((B-A)%2 == 0) cout << "Alice" << endl;
    else cout << "Borys" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll          long long int
#define uu          first
#define vv          second
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define INF         1e9
#define fastRead    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;

const int MAX = 1e6 + 6;
int main()
{
    fastRead;
    map<int,int>mp;
    int x, n;
    cin>>x>>n;
    for(int i =1 ; i <= n ; i++ ) {
        int tmp;
        cin>>tmp;
        mp[tmp] = 1;
    }
    
    int num = -200;
    
    for(int i = -200 ; i <= 200 ; i++ ) {
        
        if(mp[i]) continue;
        if(abs(i - x) < abs(num-x)) {
            num = i;
        }
    }
    cout<<num<<'\n';
    return 0;
    
}

Measured memory_bytes: 3672
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#define Mod1(x) (x>=mod?x-mod:x)
#define Mod2(x) (x<0?x+mod:x)
#define ll long long
#define maxn 3010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static int buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
int a[maxn],p[maxn],ans[maxn];
int x[maxn],y[maxn];
int n,mod;
ll power(ll a,ll b)
{
	ll ans=1;
	for(;b;b>>=1,a=a*a%mod)
		if(b&1)ans=ans*a%mod;
	return ans;
}
void mul(int* a,ll k)
{
	for(int i=n;i;i--)
		a[i]=(a[i-1]+a[i]*k)%mod;
	a[0]=a[0]*k%mod;
}
void div(int* a,ll k)
{
	if(!k){
		for(int i=1;i<=n;i++)
			a[i-1]=a[i];
		a[n]=0;
	}
	else{
		ll inv=power(k,mod-2);
		a[0]=a[0]*inv%mod;
		for(int i=1;i<=n;i++)
			a[i]=(a[i]-a[i-1]+mod)*inv%mod;
	}
}
ll query(int* a,int k)
{
	ll cur=0;
	for(int i=n;i>=0;i--)
		cur=(cur*k+a[i])%mod;
	return cur;
}
int main()
{
	n=read(); mod=n;
	for(int i=0;i<n;i++)
		a[i]=read();
	p[0]=1;
	for(int i=0;i<n;i++){
		mul(p,Mod2(-i));
		// for(int j=0;j<=n;j++)writesp(p[j]); puts("");
	}
	for(int i=0;i<n;i++){
		if(!a[i])continue;
		div(p,Mod2(-i));
		ll t=power(query(p,i),mod-2);
		for(int j=0;j<=n;j++)
			ans[j]=(ans[j]+t*p[j])%mod;
		// for(int j=0;j<n;j++)writesp(p[j]); puts("");
		mul(p,Mod2(-i));
	}
	for(int i=0;i<n;i++)
		writesp(ans[i]);
	putchar('\n');
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);

using namespace std;

const int N = 1e6+7;
int m, d;

int32_t main()
{
	fast;

	int ans = 0;
	cin >> m >> d;
	for(int i = 1; i <= m; i++)
	{
		for(int j = 2; j <= 9; j++)
		{
			// cout << i << " " << j << endl;
			if(i % j == 0 && (i/j) >= 2 && (i/j) <= 9 && ((j*10)+(i/j)) <= d)
				ans++;
		}
	}
	cout << ans;
	return 0;
}

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

int main (){
    int n,a=1000,d=0;
    cin>>n;
    int i;
    int b=n,c=0;
    while(b!=0){
        b/=10;
        c++;
    }

    for(i=0;i<c;i+=2){
        if(n/pow(10,(double)i+1)>=1){
            if(i==0)d+=9;
            else{
            d+=pow(10,(double)i+1)-pow(10,(double)i);
            }
        }
        else if(n/pow(10,(double)i)>=1){
            d+=n-pow(10,(double)i)+1;
        }
    }
    cout << d;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdint>
#include <set>
#include <vector>
#include <algorithm>

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

  std::vector<intmax_t> L;
  std::set<intmax_t> A;
  for (size_t i = 0; i < N; ++i) {
    intmax_t a;
    scanf("%jd", &a);
    if (A.count(a)) {
      A.erase(a);
      L.push_back(a);
    } else {
      A.insert(a);
    }
  }
  std::sort(L.rbegin(), L.rend());
  if (L.size() < 2) {
    puts("0");
  } else {
    printf("%jd\n", L[0]*L[1]);
  }
}


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

const int M = 2019;

int main() {
  std::string s;
  std::cin >> s;
  std::reverse(s.begin(), s.end());
  std::vector<int> count(M);
  long ans = 0;
  int x = 1, total = 0;
  for (auto &c : s) {
    count[total]++;
    total += (c - '0') * x;
    total %= M;
    ans += count[total];
    x = x * 10 % M;
  }
  std::cout << ans << std::endl;
}


Measured memory_bytes: 3360
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#define MN 101000

typedef long long ll;

int h[MN], nxt[2 * MN], to[2 * MN], K = 0;
int n, m, fa[MN]; 
int a[MN], c[MN], p[MN];
std::vector<int> e[MN];
ll sum[MN];
bool vis[MN];
ll Ans = 1e18;

void ins(int u, int v) {nxt[++K] = h[u]; h[u] = K; to[K] = v;} 

int Find(int x) {return fa[x] == x ? x : fa[x] = Find(fa[x]);}

bool cmp(int a, int b) {return c[a] < c[b];}

void dfs(int x)
{
	sum[x] = a[x] - c[x];
	for(int i = h[x]; i; i = nxt[i])
		dfs(to[i]), sum[x] += sum[to[i]];
}

void solve(int x, ll w)
{
	Ans = std::min(Ans, std::max((ll)c[x], w - sum[x]));
	for(int i = h[x]; i; i = nxt[i])
	{
		ll d = std::max(w - (sum[x] - sum[to[i]]), (ll)c[x]);
		solve(to[i], d);
	}
}

int main()
{
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++)
	{
		int a, b; scanf("%d%d", &a, &b);
		a = std::max(a, b);
		::a[i] = a; c[i] = a - b;
		fa[i] = i; p[i] = i;
	}
	for(int i = 1; i <= m; i++)
	{
		int u, v; scanf("%d%d", &u, &v);
		e[u].push_back(v);
		e[v].push_back(u);
	}

	std::sort(p + 1, p + n + 1, cmp);
	
	for(int i = 1; i <= n; i++)
	{
		int x = p[i]; vis[x] = 1;
		for(int j = 0; j < e[x].size(); j++)
		{
			if(vis[e[x][j]])
			{
				int y = Find(e[x][j]);
				if(x != y)
				{
					ins(x, y);
					fa[y] = x;
				}
			}
		}
	}
	
	dfs(p[n]);
	solve(p[n], 0);
	
	printf("%lld\n", Ans + sum[p[n]]); 
}

Measured memory_bytes: 12284
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;

#define MOD 998244353


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

bool primeNumber(ll n){
    if(n < 2) return false;
    else{
        for(ll i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
  
  

int main(){
    ll n,x;
    cin>>n>>x;
    vector <ll> l(n);
    for (ll i =0; i < n; i++){
        cin>>l[i];
    }
    
    ll ans = 1;
    ll p = 0;
    
    for (ll i =0; i < n; i++){
        p += l[i];
        if(p <= x)ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256