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

#define IOS cin.tie(0);ios::sync_with_stdio(false)

#define ll      long long
#define Fi      first
#define Se      second
#define Pb      push_back
#define vi      vector<int>
#define vs      vector<string>
#define vp      vector<pair<int,int>>
#define vvi     vector<vector<int>>
#define vvp     vector<vector<pair<int,int>>>
using Graph  =  vector<vector<int>>; //Caution!! Segmentation Fault!! Don't forget to add +1!

#define sz(x) (int)x.size()
#define all(v) v.begin(),v.end()
#define output_s(s) printf("%s\n",(s).c_str())

#define rep(i,n)        for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m)      for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m)     for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m)    for(int i=(int)(n);i>=(int)(m);i--)
#define SRepS(i,n,m)     for(int i=(int)(n);i*i<=(int)(m);i++)
#define RepA(x)         for(auto &item:(x))

void CINT(){} //@shibh308's template
template<class Head,class... Tail> void CINT(Head&& head,Tail&&... tail){cin>>head; CINT(move(tail)...);}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define VCIN(x) for(auto &item:x) cin>>item

void OUT(){}
template<class Head,class...Tail> void OUT(Head&& head,Tail&&...tail){cout<<head<<(sizeof...(tail)?' ':'\n'); OUT(move(tail)...);}
#define COUT(...) OUT(__VA_ARGS__)

template<typename TypeInt>TypeInt GCD(TypeInt a,TypeInt b){return a%b==0?b:GCD(b,a%b);} //最大公約数
template<typename TypeInt>TypeInt LCM(TypeInt a,TypeInt b){return a*b/GCD(a,b);} //最小公倍数
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}
template<class T>bool comp(T a,T b){return abs(a)<abs(b);} //比較関数

void YES(bool f){printf(f?"YES\n":"NO\n");}
void Yes(bool f){printf(f?"Yes\n":"No\n");}
void Possible(bool f){printf(f?"Possible\n":"Impossible\n");}
void POSSIBLE(bool f){printf(f?"POSSIBLE\n":"IMPOSSIBLE\n");}

//----------------------library------------------------//

//const int dx[4]={1,0,-1,0};
//const int dy[4]={0,1,0,-1};
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int NMAX = 200;
const int INF = 1e9;
const int MOD = 1e9+7;
bool flag;

//----------------------Global-------------------------//

signed main(){
    LCIN(N,M);
    ll ans;
    if(N*2>=M)ans=M/2;
    else{
        ans=(N*2+M)/4;
    }
    printf("%lld\n",ans);

    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);

        while(true){
            int i,j;
            int n=sc.nextInt();
            if(n==0 ){
                break;
            }
            int[] num=new int[n];
            int max=0,min=0;
            int sum=0;

            for(i=0;i<n;i++){
                num[i]=sc.nextInt();
                sum+=num[i];
                if(num[max]<num[i]){
                    max=i;
                }
                if(num[min]>num[i]){
                    min=i;
                }
            }

            sum=sum-num[max]-num[min];

            System.out.println(sum/(n-2));
        }
        sc.close();
    }
}


Measured memory_bytes: 29180
////=====BIsmillahir Rahmanir Rahim =====////

/*                        ______
 _______   /\     |``\   |        |  /
    |     /  \    |__/   |____    |/
    |    / _ _\   |  \   |        |\
    |   /      \  |   \  |______  |  \

            Dept. of CSE
         Comilla University

*/
#include<bits/stdc++.h>
#define fi 2*acos(0.0)
#define ll  long long
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Node struct node
#define spc " "
#define  E  2.71828182845904523536
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
#define valid(nx,ny) nx>=0 && nx<n && ny>=0 && ny<m
#define edl "\n"
#define infinity 1e6
#define mod 1000000007
#define cn continue
using namespace std;
typedef pair<int, int> pi;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<pi> vpi;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a <<","<< spc;
    err(++it, args...);
    cout<<edl;
}
///Bit manipulation

bool checkbit(int mask,int bit){return mask & (1<<bit);}
int setbit(int mask,int bit){ return mask | (1<<bit) ; }
int clearbit(int mask,int bit){return mask & ~(1<<bit);}
int togglebit(int mask,int bit){return mask ^ (1<<bit);}
int bitno(int mask) {return (int)__builtin_popcount(mask);}

int fx[]={0,0,+1,-1};
int fy[]={+1,-1,0,0};

/// KNIGHT MOVE

int x_move[] = {2, 1, -1, -2, -2, -1, 1, 2};
int y_move[] = {1, 2, 2, 1, -1, -2, -2, -1};

///=====================================///

const int maX=2000+5;
vector<int>Graph[maX];
///check n=1;
///check corner case;

int main()
{
    ll n;
    cin>>n;
    ll x=n%1000;
    if(x==0)x=1000;
    cout<<1000-x<<endl;
}


Measured memory_bytes: 3668
object Main extends App {
	val n = scala.io.StdIn.readInt
	val s = Array.ofDim[Char](n,n)
	val t = Array.ofDim[Char](n,n)

	for(i<-0 until n){
		s(i) = scala.io.StdIn.readLine.toList.toArray
	}

	var ans = 0

	for(i<-0 until n){
		for(j<-0 until n){
			for(k<-0 until n){
				t(j)(k) = s(j)((k+i)%n)
			}
		}

		ans += check()
	}

	println(ans * n)


	def check(): Int = {
		var flag = true

		for(i<-0 until n){
			for(j<-i+1 until n){
				if(t(i)(j) != t(j)(i)){
					flag = false
				}
			}
		}

		if(flag) return 1
		else return 0
	}
}

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

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

    int n;
    cin >> n;
    vector<int> as(n);
    map<int, int> cnt;
    for (int i = 0; i < n; i++) {
        cin >> as[i];
        cnt[as[i]]++;
    }
    long long ans = 0;
    for (auto& p : cnt) {
        ans += 1LL * p.second * (p.second - 1) / 2;
    }
    for (int i = 0; i < n; i++) {
        int a = cnt[as[i]];
        cout << ans - 1LL * a * (a - 1) / 2 + 1LL * (a - 1) * (a - 2) / 2 << endl;
    }
}


Measured memory_bytes: 8320
import sys
row = sys.stdin.readline
def read_int(row):
    return int(row().rstrip())

def read_strings(row):
    return list(map(str, row().split()))

N = read_int(row)
S,T= read_strings(row)

st = ""
for i in range(N *2):
    if i%2 == 0:
        st +=S[i//2]
    else:
        st +=T[i//2]
print(st)

Measured memory_bytes: 3060
#pragma GCC target ("sse4")
char S[12];
char out[2<<20];
int outsz,Slen;
main()
{
	int N,K;
	scanf("%d%d ",&N,&K);
	gets(S);
	Slen=strlen(S);
	S[Slen++]='\n';
	for(int i=0;i<K;i++)
	{
		memcpy(out+i*Slen,S,Slen);
	}
	outsz=K*Slen;
	N-=K;
	for(int i=0;i<N;i++)
	{
		out[outsz+i*2]='7';
		out[outsz+i*2+1]='\n';
	}
	write(1,out,outsz+N*2);
}

Measured memory_bytes: 2304
s = list(str(input()))
s = list(map(int, s))
k = int(input())

flag = True
for i in range(min(len(s),k)):
    if s[i] != 1:
        flag = False
    else:
        pass

if flag:
    print(1)
else:
    for i in range(len(s)):
        if s[i] != 1:
            print(s[i])
            break

Measured memory_bytes: 3060
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static int[] DY = { 1, 0, -1, 0 };
	static int[] DX = { 0, -1, 0, 1 };
	static int W, H;
	static char[][] mapL, mapR;

	public static void main(String[] args) {
		while (true) {
			W = sc.nextInt();
			H = sc.nextInt();
			if (W == 0) break;
			mapL = new char[H][];
			mapR = new char[H][];
			for (int i = 0; i < H; ++i) {
				mapL[i] = sc.next().toCharArray();
				mapR[i] = sc.next().toCharArray();
			}
			System.out.println(solve() ? "Yes" : "No");
		}
	}

	static boolean solve() {
		boolean[] visited = new boolean[H * W * H * W];
		int pos = 0;
		for (int i = 0; i < H; ++i) {
			for (int j = 0; j < W; ++j) {
				if (mapL[i][j] == 'L') {
					pos |= (i << 18) | (j << 12);
				}
				if (mapR[i][j] == 'R') {
					pos |= (i << 6) | j;
				}
			}
		}
		visited[posToIdx(pos)] = true;
		Queue<Integer> q = new ArrayDeque<Integer>();
		q.add(pos);
		while (!q.isEmpty()) {
			int p = q.poll();
			int y1 = p >> 18;
			int x1 = (p >> 12) & 0x3F;
			int y2 = (p >> 6) & 0x3F;
			int x2 = p & 0x3F;
			for (int i = 0; i < 4; ++i) {
				int ny1 = y1 + DY[i];
				int nx1 = x1 + DX[i];
				int ny2 = y2 + DY[i];
				int nx2 = x2 - DX[i];
				if (ny1 < 0 || H <= ny1 || nx1 < 0 || W <= nx1 || mapL[ny1][nx1] == '#') {
					ny1 = y1;
					nx1 = x1;
				}
				if (ny2 < 0 || H <= ny2 || nx2 < 0 || W <= nx2 || mapR[ny2][nx2] == '#') {
					ny2 = y2;
					nx2 = x2;
				}
				boolean goalL = mapL[ny1][nx1] == '%';
				boolean goalR = mapR[ny2][nx2] == '%';
				if (goalL && goalR) {
					return true;
				}
				if (!goalL && !goalR) {
					int np = (ny1 << 18) | (nx1 << 12) | (ny2 << 6) | nx2;
					int ni = posToIdx(np);
					if (!visited[ni]) {
						visited[ni] = true;
						q.add(np);
					}
				}
			}
		}
		return false;
	}

	static int posToIdx(int p) {
		int y1 = p >> 18;
		int x1 = (p >> 12) & 0x3F;
		int y2 = (p >> 6) & 0x3F;
		int x2 = p & 0x3F;
		return (y1 * W + x1) * H * W + (y2 * W + x2);
	}

}

Measured memory_bytes: 103700
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define ull unsigned long long
#define for_list(a) for(auto i:a)
#define f(s,a) for(int i=0;i<s;i++) cin>>a[i];
int count = 0;
template<typename T>
void show2d(T a[][1000000],T b,T c){
    for (T i = 0; i < b; ++i)
    {
        for (T j = 0; j < c; ++j)
        {
            cout << a[i][j] << " ";
        }
        cout << endl;
    }
}
template<typename T>
void show1d(T a[],T b){
    for (T i = 0; i < b; ++i)
    {
        cout << a[i] << " ";
    }
    cout << endl;
}
void debug(int a){
    cout << " DEBUG: "<<a << endl;
}

template<typename T>
vector<int> maxmin_list(T a){
    int l = INT_MIN,p = INT_MAX;
    for_list(a){
        l = max(l,i);
        p = min(i,p);
    }
    vector<int> v = {l,p};
    return v;
}

ll power(ll a,ll b){
    ll s;
    if(b == 0)
        return 1;
    if(b == 1)
        return a;
    if(b%2 == 0){
        s = power(a,b/2);
        return s*s;
    }
    else{
        s = power(a,(b-1)/2);
        return a*s*s;
    }
}

int randomize(){
    return (rand()%10000);
}

int main()
{
    srand(time(NULL));
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
    // cout <<fixed;
    // cout << setprecision(2);
    ll n;cin >> n;
    ll k;cin >> k;
    ll a[n+1][2];
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i][0];
        cin >> a[i][1];
    }
    ll dp1[n+1][k+1];
    for (int i = 0; i <= n; ++i)
    {
        for (int j = 0; j <= k; ++j)
        {
            if(i == 0 || j  == 0)
                dp1[i][j] = 0;
            else if(a[i-1][0] <= j){
                dp1[i][j] = max(a[i-1][1] + dp1[i-1][j-a[i-1][0]],dp1[i-1][j]);
            }
            else{
                dp1[i][j] = dp1[i-1][j];
            }
        }
    }
    cout << dp1[n][k] << endl;
    // for (int i = 0; i <= n; ++i)
    // {
    //     show1d(dp1[i],k+1);
    // }
}

Measured memory_bytes: 79232
import collections
n = int(input())
a = [int(i) for i in input().split()]
acc = [0]
for i in range(n):
    acc.append(acc[-1] + a[i])
dic = collections.defaultdict(int)
for i in range(n+1):
    dic[acc[i]] += 1
ans = 0
for key in dic.keys():
    ans += ((dic[key] * (dic[key]-1)) / 2)
print(int(ans))


Measured memory_bytes: 144452
Imports System

Module Program
    Sub Main(args As String())

        Dim ABCK() As Integer = Console.ReadLine().Split(" ").Select(Function(x) Integer.Parse(x)).ToArray()

        Dim wk As Integer = ABCK(3)
        Dim ans As Integer = 0
        If ABCK(0) <= wk Then
            ans += ABCK(0)
            wk -= ABCK(0)
            wk -= ABCK(1)
            If 0 < wk Then
                If ABCK(2) <= wk Then
                    ans -= ABCK(2)
                Else
                    ans -= wk
                End If
            End If
        Else
            ans += wk
        End If

        Console.WriteLine(ans)

    End Sub
End Module


Measured memory_bytes: 28164
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <functional>
#define REP(i, n) for(int i = 0; i < n; i++)
using ll = long long;
using namespace std;
const int mod = 1000000007;

int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);

  ll n,k,ans=0, tmp;
  cin >> n >> k;
 
  for(ll i = k; i < n+2; i++){
    tmp = (i * (n-i + 1) + 1) % mod;
    ans += tmp;
  }
  
  cout << ans%mod << endl;
      
}


Measured memory_bytes: 3644
////////////////////////////////////////////////////////////////////
// This source code is for Visual Studio
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>
#include <assert.h>

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		UINT64_MAX
#define Rep(i,n) for(int i = 0; i < (n); ++i )

using namespace std;

typedef vector< vector<int> > MAT;
typedef pair<int, int> PINT;
typedef long long ll;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t s32;
typedef int64_t s64;

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

int main()
{
	ll N = 0;
	ll M = 0;
	ll X = 0;
	ll ans = 0;

	cin >> N >> M >> X;
	vector<ll> A(M);
	Rep(i, M) {
		cin >> A[i];
	}

	// solve
	ll tmp = 0;
	for (ll x = X; x >= 0; --x) {
		Rep(i, M) {
			if (A[i] == x) {
				tmp++;
			}
		}
	}
	ans = tmp;

	tmp = 0;
	for (ll x = X; x <= N; ++x) {
		Rep(i, M) {
			if (A[i] == x) {
				tmp++;
			}
		}
	}
	ans = min(ans, tmp);

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
fn main() {
    proconio::input! {
        h: usize,
        w: usize,
        m: usize,
        hws: [(usize, usize); m],
    }
    let mut h_boms = vec![0usize; h];
    let mut w_boms = vec![0usize; w];
    for (h, w) in &hws {
        h_boms[h - 1] += 1;
        w_boms[w - 1] += 1;
    }
    let hnum = h_boms.iter().max().unwrap();
    let wnum = w_boms.iter().max().unwrap();
    let max_boms_hs = h_boms
        .iter()
        .enumerate()
        .filter(|x| x.1 == hnum)
        .map(|x| x.0)
        .collect::<Vec<_>>();
    let max_boms_ws = w_boms
        .iter()
        .enumerate()
        .filter(|x| x.1 == wnum)
        .map(|x| x.0)
        .collect::<Vec<_>>();
    let hws = hws.iter().collect::<std::collections::HashSet<_>>();
    for mh in &max_boms_hs {
        for mw in &max_boms_ws {
            if !hws.contains(&(mh + 1, mw + 1)) {
                let ans = hnum + wnum;
                println!("{}", ans);
                return;
            }
        }
    }
    let ans = hnum + wnum - 1;
    println!("{}", ans);
}


Measured memory_bytes: 24580
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<double> p(n);
  for (int i = 0; i < n; i++)
    cin >> p[i];
  double dp[n + 1][n + 1];
  for (int i = 0; i <= n; i++)
    dp[i][0] = dp[0][i] = 0.;
  dp[0][0] = 1.0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      if (j > i) {
        dp[i][j] = 0.0;
        continue;
      }
      if (j == 0) {
        dp[i][j] = dp[i - 1][j] * (1 - p[i - 1]);
      } else {
        dp[i][j] = dp[i - 1][j] * (1 - p[i - 1]) + dp[i - 1][j - 1] * p[i - 1];
      }
    }
  }
  double ans = 0.0;
  for (int i = (n + 1) / 2; i <= n; i++) {
    ans += dp[n][i];
  }
  printf("%.12lf\n", ans);
  return 0;
}


Measured memory_bytes: 70528
#include<stdio.h>

int main(){
  
  int A,B;
  scanf("%d%d",&A,&B);
  
  int max = A + B;
  if(A - B > max) max = A - B;
  if(A * B > max) max = A * B;
  
  printf("%d",max);
  return 0;
  
}

Measured memory_bytes: 128
#include <stdio.h>

int main(){
	int n;
	int i, j=0;
	int a;
	int b;
	int A[100]={};
	int B[100]={};
	while(1){
		scanf("%d", &n);
		if(n==0){
			break;
		}
		for(i=0;i<n;i++){
			scanf("%d%d", &a, &b);
			if(a<b){
				B[j]+=a+b;
			}else if(a>b){
				A[j]+=a+b;
			}else{
				A[j]+=a;
				B[j]+=b;
			}
		}
		j++;
	}
	for(i=0;i<j;i++){
		printf("%d %d\n", A[i], B[i]);
	}
	return 0;
}

Measured memory_bytes: 600
#include<stdio.h>

int check(int x, int y) {
  if (x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) {
	if (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12) {
	  return 1;
	}
	else {
	  return 0;
	}
  }
  if (x == 4 || x == 6 || x == 9 || x == 11) {
	if (y == 4 || y == 6 || y == 9 || y == 11) {
	  return 1;
	}
	else {
	  return 0;
	}
  }
  if (x == 2) {
	if (y == 2) {
	  return 1;
	}
	else {
	  return 0;
	}
  }
}

int main() {
  int a, b,flag;
  scanf("%d %d", &a, &b);

  flag = check(a,b);
  if (flag == 0) {
	printf("No\n");
  }
  else if(flag == 1){
	printf("Yes\n");
  }

  return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(a) a.begin(), a.end()
typedef long long int ll;
using namespace std;

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

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

    if (a <= 8 && b <= 8)
        cout << "Yay!" << endl;
    else
        cout << ":(" << endl;

    return 0;
}

Measured memory_bytes: 256
/*  ***  In The Name of God ... ***  */ 
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define int long long
#define all(v) v.begin() , v.end()
#define pb push_back
#define endl '\n' 
template<typename T> inline bool smin(T &a, const T &b){ return b < a ? a = b,1:0;}
template<typename T> inline bool smax(T &a, const T &b){ return a < b ? a = b,1:0;}

string s ;


int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> s ;
	int ans = ( int ) s . size ( ) ; 
	for ( int i = 0 ; i < ( int ) s . size ( ) - 1 ; ++ i ) {
		if ( s [ i ] != s [ i + 1 ] ) {
			smin ( ans , max ( i + 1 , ( int ) s . size ( ) - i - 1 ) ) ; 
		}
	}
	cout << ans << '\n' ; 
}


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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int64 N, K;
	cin >> N >> K;
	cout << N-K+1 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

int main() {
    int c[4][4];
    
    for (int i=1; i<=3; i++){
        for (int j=1; j<=3; j++) cin >> c[i][j];
    }

    for (int i=1; i<=2; i++){
        if ((c[i][1] - c[i+1][1] != c[i][2] - c[i+1][2]) || (c[i][1] - c[i+1][1] != c[i][3] - c[i+1][3])) {
            cout << "No" << endl;
            return 0;
        }
    }

    for (int j=1; j<=2; j++){
        if ((c[1][j] - c[1][j+1] != c[2][j] - c[2][j+1]) || (c[1][j] - c[1][j+1] != c[3][j] - c[3][j+1])) {
            cout << "No" << endl;
            return 0;
        }
    }

        cout << "Yes" << endl;

}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
template<typename T> bool chmax(T &a, T b) {if(a <= b){a = b; return true;}return false;}
template<typename T> bool chmin(T &a, T b) {if(a >= b){a = b; return true;}return false;}


int main(void){
    string s;
    cin >> s;
    int n = s.length();
    int n0 = 0, n1 = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == '0'){
            n0++;
        }else{
            n1++;
        }
    }
    cout << min(n0, n1) * 2 << endl;
}

Measured memory_bytes: 512
import numpy
import re
import math

def main():
	"""
	テストコード実行
	:return:
	"""
	h, w = map(int, input().split())
	src = [list(input()) for i in range(h)]
	dxy = [(-1, 0), (1, 0), (0, -1), (0, 1)]  # 4近傍

	for y in range(h):
		for x in range(w):
			if src[y][x] is "#":
				for dx, dy in dxy:
					#if x + dx < 0 or x + dx > w - 1 or y + dy < 0 or y + dy > h - 1 or src[y + dy][x + dx] is "#": continue
					if 0 <= x + dx < w and 0 <= y < h and src[y + dy][x + dx] is "#": break
				else:
					print("No")
					exit()
	print("Yes")



if __name__ == '__main__':
	main()


Measured memory_bytes: 13256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
const int INF_INT = 2147483647;
const long long INF_LONG = 9223372036854775807;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
     
int main() {
  string s, t;  
  cin >> s >> t;
  int d = s.size();
  int ans=0;

  rep (i, d) {
    if (s[i] != t[i]) ++ans;
  }
 
  cout << ans << endl;
}

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

using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) begin(v), end(v)
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define sz(v) (int)(v).size()

bool dfs(int a, int L, vector<vi>& g, vi& btoa, vi& A, vi& B) {
  if (A[a] != L) return 0;
  A[a] = -1;
  for (int b : g[a]) if (B[b] == L + 1) {
    B[b] = 0;
    if (btoa[b] == -1 || dfs(btoa[b], L + 1, g, btoa, A, B))
      return btoa[b] = a, 1;
  }
  return 0;
}

int hopcroftKarp(vector<vi>& g, vi& btoa) {
  int res = 0;
  vi A(g.size()), B(btoa.size()), cur, next;
  for (;;) {
    fill(all(A), 0);
    fill(all(B), 0);
    /// Find the starting nodes for BFS (i.e. layer 0).
    cur.clear();
    for (int a : btoa) if(a != -1) A[a] = -1;
    rep(a,0,sz(g)) if(A[a] == 0) cur.push_back(a);
    /// Find all layers using bfs.
    for (int lay = 1;; lay++) {
      bool islast = 0;
      next.clear();
      for (int a : cur) for (int b : g[a]) {
        if (btoa[b] == -1) {
          B[b] = lay;
          islast = 1;
        }
        else if (btoa[b] != a && !B[b]) {
          B[b] = lay;
          next.push_back(btoa[b]);
        }
      }
      if (islast) break;
      if (next.empty()) return res;
      for (int a : next) A[a] = lay;
      cur.swap(next);
    }
    /// Use DFS to scan for augmenting paths.
    rep(a,0,sz(g))
      res += dfs(a, 0, g, btoa, A, B);
  }
}

int main(int argc, char const *argv[])
{
#ifdef LOCAL
  freopen("in", "r", stdin);
#endif
  int n; scanf("%d", &n);
  vector<vi> li(n-1), g(n);
  for(int i = 0; i < n-1; ++i) {
    int k; scanf("%d", &k);
    li[i] = vi(k);
    for(int& x : li[i]) {
      scanf("%d", &x);
      x--;
      g[x].push_back(i);
    }
  }
  vi vis(2*n-1);
  function<void(int)> dfs0 = [&](int u) {
    vis[u] = 1;
    if(u >= n) {
      for(int& v : li[u-n]) {
        if(!vis[v]) dfs0(v);
      }
    } else {
      for(int& v : g[u]) {
        if(!vis[v+n]) dfs0(v+n);
      }
    }
  };
  dfs0(0);
  if(count(all(vis), 1) != 2*n-1) {
    return puts("-1"), 0;
  }
  vi g0 = g[0], btoa(n-1, -1);
  g[0].clear();
  hopcroftKarp(g, btoa);
  g[0] = g0;
  if(count(all(btoa), -1)) {
    return puts("-1"), 0;
  }
  vi atob(n, -1);
  vector<ii> ans(n-1);
  for(int i = 0; i < n-1; ++i) {
    if(~btoa[i]) atob[btoa[i]] = i;
  }
  vis.assign(n, 0);
  function<void(int)> dfs = [&](int u) {
    vis[u] = 1;
    for(int& m : g[u]) if(m != atob[u]) {
      int v = btoa[m];
      if(!vis[v]) {
        ans[m] = {u, v};
        dfs(v);
      }
    }
  };
  dfs(0);
  for(int i = 0; i < n-1; ++i) {
    printf("%d %d\n", ans[i].first+1, ans[i].second+1);
  }
  return 0;
}

Measured memory_bytes: 20836
/*Points to be noted :
1)Don't be afraid to fail.
2)Never give up easily,keep trying.
3)Don't care about other ppl's progress.
4)Spend much time on each problem & keep trying. I WILL DO IT!💯*/

// Mere bas ka nahi hai
// still i'm trying
// apna time aayega
//
//        .--------------.  
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |  
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'                          		  
//


#include<bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#define int long long int
#define ld long double
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define r0 return 0;
#define tc int t;cin>>t;while(t--)
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define vi vector<int>
#define vii vector<long long int>
#define SORT(v) sort(v.begin(),v.end());
#define PI 3.1415926535897932384626433832795
#define mod 1000000007
#define md 998244353
#define inf 1000000000000000 //1e15
#define gcd __gcd
#define lcm(a,b) ((a)*(b))/gcd(a,b)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define crap ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
int min(int a,int b){
    return (a<b)?a:b;
}
int max(int a,int b){
    return (a>b)?a:b;
}
int fp(int a,int b){
    if(b==0) return 1;
    int x=fp(a,b/2);
    x=(x*x)%mod;
    if(b&1) x=(x*a)%mod;
    return x;
}
int factorial(int n)
{
    int fact=1;
    for(int i=2;i<=n;i++)
    fact=fact*i;
    
    return fact;
}
int ncr(int n,int r)
{
    return factorial(n)/(factorial(r)*factorial(n-r));
}
int binomialCoeff(int n,int k)
{
    int dp[k+1];
    memset(dp,0,sizeof(dp));
    dp[0]=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=min(i,k);j>0;j--)
        dp[j]=(dp[j]+dp[j-1])%mod;
    }
    return dp[k]%mod;
    
}
void c_p_c()
{
    crap;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int solve(int n)
{
    int sum=7;
    for(int i=0;i<1000000;i++)
    {
        if(sum%n==0)
            return i+1;
        sum=sum*10;
        sum%=n;
        sum+=7;
        sum%=n;
    }
    return -1;
}
signed main()
{
    c_p_c();
    int n;
    cin>>n;
    cout<<solve(n)<<endl;
}

Measured memory_bytes: 3680
#include <iostream>

using namespace std;

int main() {
	int n;
	string s;
	bool hasFour = false;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s;
		if (s == "Y") {
			hasFour = true;
		}
	}

	if (hasFour) {
		cout << "Four" << endl;
	}
	else {
		cout << "Three" << endl;
	}

}

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

int main() {
  int N; cin >> N;
  int min = 1001, max = -1;
  int a[N]; for(int i = 0; i < N; i++) cin >> a[i];
  for(int i = 0; i < N; i++) {
    if(a[i] <= min) min = a[i];
    if(max <= a[i]) max = a[i];
  }
  cout << max - min << endl;

  return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
int sum[2000005];
int k, n;
int main()
{
 	ios::sync_with_stdio(0);
 	cin >> n >> k;
 	for (int i = 1;i <= n;++i)
 	{
		int x;
		cin >> x;
		sum[i] = sum[i - 1] + x;
	}
	int maxx = 0;
	for (int i = k;i <= n;++i)
	{
		if (sum[i] - sum[i - k] > maxx)
			maxx = sum[i] - sum[i - k];
	}
	printf("%.6lf", (maxx + k) * 0.5);
	return 0;
}



Measured memory_bytes: 1024
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int x = sc.nextInt();
      	int y = sc.nextInt();
     	int z = sc.nextInt();
		int ans = 0; 
		for(int i=x;i<=y;i++){
          if( i%z==0 )
            ans++;
		}
		System.out.println(ans);    	
	}
}

Measured memory_bytes: 27072
#include<cstdio>

const int MAX_N = 1e5, A = 1e9 + 7;
int n;
int x[MAX_N], y[MAX_N];

int po(int x, int y) {
    int ans = 1;
    while (y > 0) {
        if (y & 1) ans = static_cast<long>(ans) * x % A;
        x = static_cast<long>(x) * x % A;
        y >>= 1;
    }
    return ans;
}

int fac[MAX_N + 1], inv[MAX_N + 1], fra[MAX_N + 1];
int z[MAX_N];

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

    fac[0] = 1;
    for (int i = 1; i <= n; i++) {
        fac[i] = static_cast<long>(fac[i - 1]) * i % A; 
    }
    inv[n] = po(fac[n], A - 2);
    for (int i = n - 1; i >= 0; i--) {
        inv[i] = static_cast<long>(inv[i + 1]) * (i + 1) % A;
    }
    fra[0] = 1;
    for (int i = 1; i <= n; i++) fra[i] = po(i, A - 2);
    
    for (int i = 1; i < n; i++) {
        z[i] = (z[i - 1] + static_cast<long>(fac[n - 1])
             * fra[i] % A) % A;
    }
    int ans = 0;
    for (int i = 1; i < n; i++) {
        ans = (ans + static_cast<long>(z[i]) * (x[i] - x[i - 1]) % A) % A;
    }
    printf("%d\n", ans);
    return 0;
}


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






Measured memory_bytes: 3628
/*
 ============================================================================
 Name        : AtCoder_B.c
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int A=0,B=0,K=0;

	int i;
	scanf("%d",&A);
	scanf("%d",&B);
	scanf("%d",&K);

	if( (A+K-1)>= (B-K+1)){
		for(; A<=B; A++){
			printf("%d\n",A);
		}
	}else{
		for(i=A;i<A+K;i++ ){
			printf("%d\n",i);
		}
		for(i= B-K+1; i<=B; i++){
			printf("%d\n",i);
		}
	}
	return EXIT_SUCCESS;
}


Measured memory_bytes: 128
import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

void main() {
    int n;
    scan(n);

    int ds = digsum(n);

    writeln(n % ds == 0 ? "Yes" : "No");
}

int digsum(int n) {
    return n > 0 ? digsum(n / 10) + (n % 10) : 0;
}


void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

Measured memory_bytes: 256
n=int(input())
la=[]
lb=[]
for i in range(n):
  a,b=map(int,input().split())
  la.append(a)
  lb.append(b)
la=la[::-1]
lb=lb[::-1]
now=0
count=0
for i in range(n):
  if (lb[i]-now-la[i])%lb[i]==0:
    pass
  else:
    count+=(lb[i]-now-la[i])%lb[i]
    now+=(lb[i]-now-la[i])%lb[i]
print(count)

Measured memory_bytes: 11804
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define endl '\n'

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

    vector<int> d(n);
    vector<vector<int> > G(n);

    for(int i = 0; i < n; i++) {
        int itr,m;
        cin >> itr >> m;
        for (int j = 0; j < m; j++) {
            int v;
            cin >> v;
            G[itr-1].push_back(v-1);
        }
    }
    const int N = 110;
    rep(i,n) d[i] = N;
    queue<int> Q;
    Q.push(0);
    d[0] = 0;
    while(!Q.empty()){
        int x = Q.front();
        Q.pop();
        for(int j = 0; j < G[x].size(); j++){
            int to = G[x][j];
            if(d[to] == N) {
                Q.push(to);
                d[to] = min(d[to], d[x] + 1);
            }
        }
    }

    for(int i = 0; i < n; i++){
        int v = d[i];
        if(v == N) v = -1;
        cout << i + 1 << " " << v << endl;
    }
}



Measured memory_bytes: 3160
void main() {
    long x = readln.chomp.to!long;
    long result = x / 11 * 2;
    long r = x % 11;
    if (r > 0) ++result;
    if (r > 6) ++result;
    result.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int yy = n/100;
		int mm = n%100;
		boolean m = false;
		boolean y = false;
		String ans = "NA";
		if(mm > 0 && mm <= 12) {
			m = true;
		}
		if(yy > 0 && yy <= 12) {
			y = true;
		}
		if(m && y) {
			ans = "AMBIGUOUS\r\n" + 
					"";
		}else if(m) {
			ans = "YYMM";
		}else if(y) {
			ans = "MMYY";
		}
		System.out.println(ans);
		sc.close();
	}
}


Measured memory_bytes: 21844
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define ALL(a) a.begin(), a.end()
typedef long long ll;
using namespace std;

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

    int D, G;
    vector<pair<int, int>> A;
    cin >> D >> G;
    A.resize(D);
    REP(i, D) cin >> A[i].first >> A[i].second;

    int ans = 1E9;
    REP(bit, (1 << D)) {
        int count = 0;
        int sum   = 0;
        REP(i, D) {
            if (bit & (1 << i)) {
                sum += 100 * (i + 1) * A[i].first + A[i].second;
                count += A[i].first;
            }
        }

        if (sum >= G)
            ans = min(ans, count);
        else {
            RREP(i, D - 1) {
                if (bit & (1 << i))
                    continue;
                REP(j, A[i].first) {
                    if (sum >= G)
                        break;
                    sum += 100 * (i + 1);
                    count++;
                }
            }
            ans = min(ans, count);
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
from collections import deque
K = int(input())


q = deque()
for i in range(1, 10):
    q.append(i)

count = 100000

while K > 0:
    a = q.popleft()

    if count > 0:
        if a % 10 == 0:
            q.append(10 * a)
            q.append(10 * a + 1)
            count -= 2
        elif a % 10 == 9:
            q.append(10*a + 8)
            q.append(10*a + 9)
            count -= 2
        else:
            b = a % 10
            q.append(10*a + b-1)
            q.append(10*a + b)
            q.append(10*a + b+1)
            count -= 3
    K -= 1
print(a)


Measured memory_bytes: 5996
def main():
  N=int(input())
  A=list(map(int,input().split()))
  mod=10**9+7
  ans=1
  A.sort()
  if N%2==0:
    for i in range(0,N,2):
      if A[i]!=A[i+1] or A[i]!=i+1:
        print(0)
        exit()
      ans=ans*2%mod
    print(ans)
  else:
    if A[0]!=0:
      print(0)
      exit()
    ans=1
    for i in range(1,N,2):
      if A[i]!=A[i+1] or A[i]!=i+1:
        print(0)
        exit()
      ans=ans*2%mod
    print(ans)
if __name__=='__main__':
  main()

Measured memory_bytes: 20652
n=int(input())
j=True
x=0
for i in range(len(str(n))):
    if str(n)[i]!='9':
        j=False
        x=i
if x==0:
    print(int(str(n)[0])+9*(len(str(n))-1))
else:
    print(int(str(n)[0])+9*(len(str(n))-1)-1)

Measured memory_bytes: 3060
import sys
from math import ceil
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, x, t = MI()
    ans = ceil(n/x)*t
    print(ans)

if __name__ == '__main__':
    main()

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

long long n, m, sum, mx=-9e20, a[1005][3], s[1005];

int main() {
	int i, j, k;
	cin>>n>>m;

	for(i=0; i<n; i++) cin>>a[i][0]>>a[i][1]>>a[i][2];

	for(k=0; k<8; k++) {

        //それぞれのケーキに対して、そのケーキを食べた時の絶対値の合計の変化を見る
		for(i=0; i<n; i++) {
			s[i] = 0;

            //kをbit列に直し、xyzに対応させる。1であれば値をそのままの値を足し込み、0であれば
            //マイナスをかけた値を足し込む。
            //つまり、1のときは正の値の絶対値を考え、0のときは負の値の絶対値を考える。
			for(j=0; j<3; j++) s[i] += (k>>j&1 ? a[i][j] : -a[i][j]);
		}

        //昇順にソートし、答えの候補を計算する。
		sort(s, s+n);
		sum = 0;
		for(i=n-1; i>=n-m; i--) sum += s[i];
		mx = max(mx, sum);
	}

	cout<<mx;
	return 0;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author emli
 */


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class B0Or1Swap {
public:
    void solve(std::istream& cin, std::ostream& cout) {
		ios::sync_with_stdio(false);
        cin.tie(nullptr);

        int n;
        cin >> n;
        vector<int> a(n),b;

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

        b = a;

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

        int k = 0;
        for(int i = 0; i < n; i++){
            if (a[i] != b[i]){
                k++;
            }
        }
        if (k == 2 || k == 0){
            cout << "YES" << endl;
        }else {
            cout << "NO" << endl;
        }
	}
};


int main() {
	B0Or1Swap solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    int n=readI();
    int a[]=new int[n];
    int xor=0;
    for(int i=0;i<n;i++){
      a[i]=readI();
      xor=xor^a[i];
    }
    pr((a[0]^xor)+"");
    for(int i=1;i<n;i++){
      pr(" "+(a[i]^xor));
    }
    pl("");
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String read(){
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static char readC(){
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static long readLong(){
    return stol(readS());
  }
  public static long stol(String s){
    return Long.parseLong(s);
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
}


Measured memory_bytes: 58856
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
namespace AGC001_C2
{
    class Edge
    {
        public int t;
        public int w;
        public Edge(int t)
        {
            this.t = t;
            w = 1;
        }
    }

    class Program
    {
        const int MAX = 3000;
        const int INF = 1 << 30;
        static int N, K;
        static int[] d;
        static List<Edge>[] G = Enumerable.Range(0, MAX).Select(i => new List<Edge>()).ToArray();
        

        static void Main(string[] args)
        {
            var H = new List<Pair>();

            var t = scan;
            N = t[0]; K = t[1];
            for (int i = 0; i < N - 1; i++)
            {
                t = scan; t[0]--; t[1]--;
                G[t[0]].Add(new Edge(t[1]));
                G[t[1]].Add(new Edge(t[0]));
                H.Add(new Pair(t[0], t[1]));
            }

            int ans = int.MaxValue;

            if (K % 2 == 0)
            {
                for (int i = 0; i < N; i++)
                {
                    bfs(i);
                    //Console.WriteLine(string.Join(" ", d));
                    ans = Math.Min(ans, d.Count(s => s > K / 2));
                }
            }
            else
            {
                foreach (var h in H)
                {
                    bfs(h.Key, h.Value);
                    //Console.WriteLine(string.Join(" ", d));
                    ans = Math.Min(ans, d.Count(s => s > K / 2));
                }
            }
            Console.WriteLine(ans);
            
        }
        static void bfs(int s)
        {
            d = Enumerable.Repeat(INF, N).ToArray();
            var Q = new Queue<int>();
            Q.Enqueue(s);
            d[s] = 0;
            int u;
            while (Q.Any())
            {
                u = Q.Dequeue();
                for (int i = 0; i < G[u].Count; i++)
                {
                    Edge e = G[u][i];
                    if (d[e.t] == INF)
                    {
                        d[e.t] = d[u] + e.w;
                        Q.Enqueue(e.t);
                    }
                }
            }
        }
        static void bfs(int s, int s2)
        {
            d = Enumerable.Repeat(INF, N).ToArray();
            var Q = new Queue<int>();
            Q.Enqueue(s);
            d[s] = 0;
            Q.Enqueue(s2);
            d[s2] = 0;
            int u;
            while (Q.Any())
            {
                u = Q.Dequeue();
                for (int i = 0; i < G[u].Count; i++)
                {
                    Edge e = G[u][i];
                    if (d[e.t] == INF)
                    {
                        d[e.t] = d[u] + e.w;
                        Q.Enqueue(e.t);
                    }
                }
            }
        }
        static int[] scan { get { return Array.ConvertAll(Console.ReadLine().Split(), int.Parse); } }
    }
}


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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

static const ll INF = 1e15;

int main(void)
{
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	swap(a[0], a[1]);
	swap(a[0], a[2]);
	rep(i, 3) {
		cout << a[i] << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256