akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
const int MAX = 510000;
const int MOD = 1000000007;

     signed main(){
int n;
cin>>n;
vector<int> hen[n];int v,w;
for(int i=0;i<n-1;i++){
  cin>>v>>w;v--;w--;
  hen[v].push_back(w);
  hen[w].push_back(v);
}
int oya[n];bool used[n]={};fill(oya,oya+n,-1);
int t,s=-1;queue<int> que;
que.push(0);used[0]=true;
while(!que.empty()){
  t=que.front();que.pop();
  for(auto&& i :hen[t])if(!used[i]){
    used[i]=true;
    que.push(i);
  }
}
fill(used,used+n,false);
que.push(t);used[t]=true;
while(!que.empty()){
  t=que.front();que.pop();
  for(auto&& i :hen[t])if(!used[i]){
    oya[i]=t;
    used[i]=true;
    que.push(i);
  }
}
fill(used,used+n,false);
vector<int> ans,ans2;w=1;
while(t!=-1){
  used[t]=true;
 v=w;w++;
 for(auto&& i :hen[t])if(!used[i]&&i!=oya[t]){
   used[i]=true;
   ans.push_back(w);
   w++;
 }
 ans.push_back(v);
swap(oya[t],s);
swap(t,s);

}
w=1;
swap(s,t);
fill(used,used+n,false);
while(t!=-1){
  used[t]=true;
 v=w;w++;
 for(auto&& i :hen[t])if(!used[i]&&i!=oya[t]){
   used[i]=true;
   ans2.push_back(w);
   w++;
 }
 ans2.push_back(v);
swap(oya[t],s);
swap(t,s);

}
if(ans.size()!=n){cout<<-1<<endl;return 0;}
for(int i=0;i<n;i++){
  if(ans[i]>ans2[i]){ans.swap(ans2);break;}
if(ans[i]<ans2[i])break;
}

 for(auto&& i :ans)cout<<i<<' ';

 cout<<endl;


 }

 


 






    





      

        


Measured memory_bytes: 10868
#include <bits/stdc++.h>
using namespace std;
 
bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}
 
long long n,m;

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

    long long ans = 0;
    ans = min(n, m/2);
    ans = max(ans + (m-2*n)/4, ans);

    cout << ans << endl;
}

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

using ll = long long;
// #define int long long

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))

bool IsPrime(int);

/***** MAIN *****/
signed main() {
  int a, b;
  cin >> a >> b;
  int min, max;
  min = b - (a-1);
  max = b + (a-1);
  REPS(i, min, max) {
    cout << i << " ";
  }
  cout << max;
  cout << "\n";
  return 0;
}
/***** MAIN *****/

bool IsPrime(int a) {
  if(a <= 1) return false;
  if(a == 2) return true;
  if(a%2 == 0) return false;
  for(int i = 3; i*i <= a; i+=2) {
    if(a%i==0) return false;
  }
  return true;
}

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

int main() {
    string a, b, c;
    cin >> a >> b >> c;
    int ae = a.size();
    int be = b.size();

    if(a.at(ae-1) == b.at(0) && b.at(be-1) ==c.at(0)) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }



    return 0;
}

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

void print_vec(vector<int> vec) {
  cout << "[";
  for (int i = 0; i < vec.size(); i++) {
    if (i) {
      cout << ", ";
    }
    cout << vec.at(i);
  }
  cout << "]...size: " << vec.size() << endl;
}

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

  int taro_score = 0;
  int hanako_score = 0;

  rep(i, n) {
    string taro, hanako;
    cin >> taro >> hanako;

    if (taro > hanako) {
      taro_score += 3;
    } else if (taro < hanako) {
      hanako_score += 3;
    } else {
      taro_score++;
      hanako_score++;
    }
  }

  printf("%d %d\n", taro_score, hanako_score);
}



Measured memory_bytes: 3268
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
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; }

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) do{}while(0)
#endif



ll n;



int main(){
	cin >> n;
	map<ll,ll> m;
	
	rep(i,n){
		ll a;
		cin >> a;
		m[a]++;
	}
	
	vector<pll> v;
	for ( auto it : m ){
		v.push_back(it);
	}
	
	bool ok = false;
	if ( v.size() == 1 ){
		if ( v[0].first == 0 )
			ok = true;
	}
	else if ( v.size() == 2 ){
		if ( v[0].first == 0 && v[0].second*2 == v[1].second )
			ok = true;
		if ( v[1].first == 0 && v[1].second*2 == v[0].second )
			ok = true;
	} else if ( v.size() == 3 ){
		if ( v[0].second == v[1].second && v[1].second == v[2].second && (v[0].first^v[1].first) == v[2].first )
			ok = true;
	}
	cout << (ok ? "Yes" : "No") << endl;
	
	
	return 0;
}




Measured memory_bytes: 10128
program sum_of_gcd_of_tuples
  implicit none
  integer :: n = 3, k, i, j
  integer(8) :: m = 0, x(100000) = 0
  read(*,*) k
  do i = k, 1, -1
    x(i) = (k / i) ** n
    do j = 2 * i, k, i
      x(i) = x(i) - x(j)
    end do
  end do
  do i = 1, k
    m = m + x(i) * i
  end do
  write(*,'(i0)') m
end program sum_of_gcd_of_tuples

Measured memory_bytes: 2992
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>

int main(void)
{
  int A,B,C,D;

  scanf("%d %d %d %d",&A,&B,&C,&D);

  while(1)
  {
    C-=B;
    if(C<=0)
    {
      printf("Yes");
      break;
    }

    A-=D;
    if(A<=0)
    {
      printf("No");
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 1720
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

ctr = Counter(s)

for val in t:
    if not val in ctr:
        continue
    ctr[val] -= 1

ans = ctr.most_common()[0][1]
if ans >= 0:
    print(ans)
else:
    ans = 0
    print(ans)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int N,M,Q;
vector<tuple<int,int,int,int>> vQ;
int64_t ans=0;

void dfs(vector<int> A,int idx){
    if(idx>=N+1){
        int64_t _ans=0;
        for(auto q:vQ){
            if(A.at(get<1>(q))-A.at(get<0>(q))==get<2>(q)) _ans+=get<3>(q);
        }
        ans=max(ans,_ans);
        return;
    }
    
    rep(i,A.at(idx-1),M+1){
        A.at(idx)=i;
        dfs(A,idx+1);
    }
}

int main(){
    cin>>N>>M>>Q;
    rep(q,0,Q){
        int a,b,c,d; cin>>a>>b>>c>>d;
        vQ.push_back(make_tuple(a,b,c,d));
    }

    vector<int> A(N+1,0);
    A.at(0)=1;
    dfs(A,1);

    cout<<ans<<endl;
}

Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    int n;
    cin >> n;

    constexpr int K = 10;

    unordered_map<ll, int> um;
    for (int i = 0; i < n; i++) {
        char c[K + 1];
        cin >> c;

        ll t = 0;
        sort(c, c + K);
        for (int j = 0; j < K; j++) {
            t <<= 5;
            t += c[j] - 'a';
        }
        um[t]++;
    }

    ll r = 0;
    for (const auto &p : um) {
        ll t = p.second;
        r += t * (t - 1) / 2;
    }

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 4388
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int n;
int main(){
    string s1;
    string s2;
    cin >> n >> s1 >> s2;

    long long ans;
    int i;
    if (s1[0] == s2[0]) {ans = 3; i = 1;} else {ans = 6; i = 2;}
    bool lastv = s1[0] == s2[0] ? true : false; 
    for (; i < n; ++i) {
        if (s1[i] == s2[i]) {
            if (lastv) ans *= 2;
            lastv = true;
        } else {
            if (lastv) ans *= 2;
            else ans *= 3;
            i++;
            lastv = false;
        }
        ans %= 1000000007LL;
    }
    cout << ans << 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;

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
typedef long long ll;
bool canbuy[100010];
int main() {
  canbuy[100]=true;
  canbuy[101]=true;
  canbuy[102]=true;
  canbuy[103]=true;
  canbuy[104]=true;
  canbuy[105]=true;
  for (int i=106;i<100009;i++){
    if(canbuy[i-100])canbuy[i]=true;
    else if(canbuy[i-101])canbuy[i]=true;
    else if(canbuy[i-102])canbuy[i]=true;
    else if(canbuy[i-103])canbuy[i]=true;
    else if(canbuy[i-104])canbuy[i]=true;
    else if(canbuy[i-105])canbuy[i]=true;
    }
  int a,n,b,h,w,k,f=0,ans=0;
  string word;
  bool flag;
  cin>>a;
  if(canbuy[a])cout<<1<<endl;
  else cout<<0<<endl;
  vector<vector<int>> sss(h,vector<int>(w));
  //vector<int> a(k),b(k);
  char x;
}


Measured memory_bytes: 384
import java.util.*;
public class Main {
    public static void main(String[] args){
      // 入力
      Scanner sc = new Scanner(System.in);
      int A = sc.nextInt();
      int B = sc.nextInt();
      
      // 条件を満たす値段の探索
      int result = -1;
      for(int i = 0; i < 2000; i++){
        int tax8 = getTax(i, 8);
        int tax10 = getTax(i, 10);
        
        // 条件に一致した場合
        if(tax8 == A && tax10 == B){
          result = i;
          break;
        }
        
      }
      
      // 出力
      System.out.println(result);
    }
    
    // 消費税を計算する関数
    public static int getTax(int base, int rate){
      return base * rate / 100;
    }
    


}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(ll i = (begin); i < (end); i++)
#define rep(i, n) FOR(i, 0, n)
using ll = long long;
using namespace std;
#define all(x) (x).begin(),(x).end()
using pii = pair<int, int>; using vi = vector<int>; using vl = vector<ll>;

vi to[100002];
vi mem(100002, -1);

int dfs(int v) {
    if(mem[v] != -1) return mem[v];
    int sum = 0;
    for(int u : to[v]) {
        // if(u==p) continue;
        sum = max(sum, 1 + dfs(u));
    }
    return mem[v] = sum;
}

signed main() {
    int n, m;
    cin>>n>>m;
    rep(i,m) {
        int x, y;
        cin>>x>>y;
        --x; --y;
        to[x].push_back(y);
    }
    int ans = 0;
    rep(i,n) {
        ans = max(ans, dfs(i));
    }
    cout << ans << endl;
    
    return 0;
}

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

int N, M, Q;
int a[50], b[50], c[50], d[50];
int ans;

void dfs(vector<int> A){
    if(A.size() == N+1){
        int score = 0;
        for(int i = 0; i < Q; i++){
            if(A[b[i]] - A[a[i]] == c[i]) score += d[i];
        }
        ans = max(ans, score);
        return;
    }

    A.push_back(A.back());
    while(A.back() <= M){
        dfs(A);
        A.back()++;
    }
}

int main(){
    cin >> N >> M >> Q;
    for(int i = 0; i < Q; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
    dfs(vector<int>(1,1));
    cout << ans << endl;
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
#define pb push_back
#define pf push_front

using namespace std;	
typedef long long int lli;
lli n,k,s,m,t,a,b,l,r,v,h,u,temp1,temp2,x,y,temp,q,d,mod=1e9+7,w,p,c,z;
lli grid[2000][2000],dp[2000][2000];

lli rec(lli i,lli j)
{
	if(grid[i][j]==1)
	{
		dp[i][j]=0;
	}
	
	if(i==1&&j==1)
	{
		dp[i][j]=1;
	}
	
	if(dp[i][j]!=-1)
	{
		return dp[i][j];
	}
	
	dp[i][j]=(rec(i-1,j)%mod+rec(i,j-1)%mod)%mod;
	
	return dp[i][j];
}

int main()
{
	
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    cin>>n>>m;
    char ch;
    
    for(int i=1;i<=n;i++)
    {
    	for(int j =1;j<=m;j++)
    	{
    		cin>>ch;
			
			if(ch=='.')
			{
				grid[i][j]=0;
			}	
			else
			{
				grid[i][j]=1;
			}
			
			dp[i][j]=-1;
    	}
    }
    
    rec(n,m);
    cout<<dp[n][m]<<endl;
    
}

Measured memory_bytes: 27352
def sn(a):
    return ord(a) - ord("a")

def isok(idx,prev):##適宜変更
    return prev>=idx+n*loops


def bisect(ls,val): ##valの関数isok(x,val)がTrueとなる一番右のindex を返す 全部Falseなら-1
    ok = -1
    ng = len(ls)
    x = (ok+ng)//2
    while ng-ok>1:
        num = ls[x]
        if isok(num,val):
            ok = x
        else:
            ng = x
        x = (ok+ng)//2
    return ok ##一番右のTrueのindex  Trueの個数はok+1こ

S = input()
T = input()
lt = list(T)
ls = list(S)
set_s = set(list(S))
set_t = set(lt)
if not set_t <= set_s:
    print(-1)
    exit()
cnts = [[] for i in range(26)]
cnts_idx = [0]*26
for i,w in enumerate(ls):
    cnts[sn(w)].append(i)

loops = 0
n = len(S)
prev = -1
for t in lt:
    idx = bisect(cnts[sn(t)],prev)+1
    if idx==len(cnts[sn(t)]):
        loops+=1
        idx = 0
    prev = cnts[sn(t)][idx] + loops*n

print(prev+1)


Measured memory_bytes: 10980
#include<bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;

int N, M, B[100000];
int dp[100000][4];

int rec(int idx, int dir)
{
  if(idx < 0 || idx >= N) return(INF);
  if(~dp[idx][dir + 1]) return(dp[idx][dir + 1]);
  if(B[idx])   return(0);
  return(dp[idx][dir + 1] = rec(idx + dir, dir) + 1);
}

int main()
{
  fill_n(*dp, 4 * 100000, -1);

  cin >> N >> M;
  for(int i = 0; i < M; i++) {
    int A;
    cin >> A;
    B[--A] = true;
  }
  int ret = 0;
  for(int i = 0; i < N; i++) {
    ret = max(ret, min(rec(i, -1), rec(i, +1)));
  }
  cout << ret << endl;
}

Measured memory_bytes: 4284
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] ch = s.toCharArray();
		int[] a = new int[4];
		for (int i = 0; i < 4; i++) {
			a[i] = Integer.parseInt("" + ch[i]);
		}
		int tmp = 7 - a[0];
		if (a[1] + a[2] + a[3] == tmp) {
			System.out.println(a[0]+"+"+a[1]+"+"+a[2]+"+"+a[3]+"=7");
			return;
		} else if (a[1] + a[2] - a[3] == tmp) {
			System.out.println(a[0]+"+"+a[1]+"+"+a[2]+"-"+a[3]+"=7");
			return;
		} else if (a[1] - a[2] + a[3] == tmp) {
			System.out.println(a[0]+"+"+a[1]+"-"+a[2]+"+"+a[3]+"=7");
			return;
		} else if (a[1] - a[2] - a[3] == tmp) {
			System.out.println(a[0]+"+"+a[1]+"-"+a[2]+"-"+a[3]+"=7");
			return;
		} else if (-a[1] + a[2] + a[3] == tmp) {
			System.out.println(a[0]+"-"+a[1]+"+"+a[2]+"+"+a[3]+"=7");
			return;
		} else if (-a[1] + a[2] - a[3] == tmp) {
			System.out.println(a[0]+"-"+a[1]+"+"+a[2]+"-"+a[3]+"=7");
			return;
		} else if (-a[1] - a[2] + a[3] == tmp) {
			System.out.println(a[0]+"-"+a[1]+"-"+a[2]+"+"+a[3]+"=7");
			return;
		} else if (-a[1] - a[2] - a[3] == tmp) {
			System.out.println(a[0]+"-"+a[1]+"-"+a[2]+"-"+a[3]+"=7");
			return;
		}
	}
}


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

typedef long long int ll;

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n, x, y;
    cin >> n >> x >> y;
    
    int jump = y - x;

    vector<int> cnts(n + 5, 0);
    for (int i = 1; i < n; ++i)
    {
        for (int j = i + 1; j <= n; ++j)
        {
            int diff;
            if (i <= x)
            {
                if (j >= y)
                {
                    diff = j - i - jump + 1;
                }
                else
                {
                    diff = min(x - i + j - x, x - i + 1 + y - j);
                }
            }
            else
            {
                diff = min(j - i, i - x + 1 + abs(y - j));
            }
            
            cnts[diff]++;
        }
    }
    
    for (int diff = 1; diff < n; ++diff)
        cout << cnts[diff] << "\n";

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int h = int.Parse(Console.ReadLine());

            Console.WriteLine((a + b) * h / 2);

            Console.Out.Flush();
        }
    }
    


    public class Calculation
    {
        
    }

    public class Graph
    {

    }
}
    

Measured memory_bytes: 11220
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanInit()

	a := nextInt()
	b := nextInt()
	c := nextInt()
	if a%2 == 0 || b%2 == 0 || c%2 == 0 {
		fmt.Println(0)
		return
	}

	fmt.Println(min(min(a*b, b*c), c*a))

}
func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

// ---- readfunc
var sc = bufio.NewScanner(os.Stdin)

func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1776
#line 2 "header.hpp"

//%snippet.set('header')%
//%snippet.fold()%
#ifndef HEADER_H
#define HEADER_H

// template version 2.0
using namespace std;
#include <bits/stdc++.h>

// varibable settings
const long long INF = 1e18;
template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _rrep(i, n) rrepi(i, 0, n)
#define rrepi(i, a, b) for (ll i = (ll)((b)-1); i >= (ll)(a); --i)
#define r_rep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(i, a) for (auto &&i : a)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
#define ub upper_bound
#define lb lower_bound
#define lpos(A, x) (lower_bound(all(A), x) - A.begin())
#define upos(A, x) (upper_bound(all(A), x) - A.begin())
template <class T> inline void chmax(T &a, const T &b) { if ((a) < (b)) (a) = (b); }
template <class T> inline void chmin(T &a, const T &b) { if ((a) > (b)) (a) = (b); }
template <typename X, typename T> auto make_table(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto make_table(X x, Y y, Z z, Zs... zs) { auto cont = make_table(y, z, zs...); return vector<decltype(cont)>(x, cont); }

#define cdiv(a, b) (((a) + (b)-1) / (b))
#define is_in(x, a, b) ((a) <= (x) && (x) < (b))
#define uni(x) sort(all(x)); x.erase(unique(all(x)), x.end())
#define slice(l, r) substr(l, r - l)

typedef long long ll;
typedef long double ld;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
void check_input() { assert(cin.eof() == 0); int tmp; cin >> tmp; assert(cin.eof() == 1); }

#if defined(PCM) || defined(LOCAL)
#else
#define dump(...) ;
#define dump_1d(...) ;
#define dump_2d(...) ;
#define cerrendl ;
#endif

#endif /* HEADER_H */
//%snippet.end()%
#line 2 "solve.cpp"
template<class T=ll> using vec = vector<T>;
struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;


int solve() {
    ll a,b;cin>>a>>b;
    cout << a*b << endl;
    return 0; 
}


int main(){/*{{{*/
    solve();
    check_input();
    return 0;
}/*}}}*/


Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include <random>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  int n;
  cin >> n;
  ll a[n];
  bool used[n]={};
  rep(i,n){
    cin >> a[i];
  }
  sort(a,a+n);
  ll ans=0;
  ll x[31]={};
  x[0]=1;
  rep(i,30)x[i+1]=2*x[i];
  for(int i=30;i>=0;i--){
    int left=0,right=n-1;
    while(left<right){
      if(used[left]){
        left++;
        continue;
      }
      if(used[right]){
        right--;
        continue;
      }
      if(a[left]+a[right]==x[i]){
        used[left]=true;
        used[right]=true;
        left++;
        right--;
        ans++;
      }
       if(a[left]+a[right]<x[i]){
         left++;
       }
       if(a[left]+a[right]>x[i]){
         right--;
       }
    }
  }
  cout << ans << endl;
return 0;}

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

int main()
{
	int n;
	cin >> n;
	vector<string> w(n), list;
	for (int i=0; i<n; i++) {
		cin >> w.at(i); 
	}
	list.push_back(w.at(0));
	for (int i=1; i<n; i++) {
		if (find(list.begin(), list.end(), w.at(i)) != list.end()) {
			cout << "No" << endl;
			return 0;
		} else {
			list.push_back(w.at(i));
		}
		if (w.at(i).front() != w.at(i-1).back()) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;

	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);
		String strWord = sc.next().toLowerCase();
		int count = 0;
		if(strWord.length() <= 10) {
			String strT = new String();
			while(true) {
				strT = sc.next();
				if(strT.toLowerCase().equals(strWord)) {
					count++;
				}
				if(strT.equals("END_OF_TEXT")) {
					break;
				}
			}
		}
		System.out.println(count);
		sc.close();
	}
}



Measured memory_bytes: 26148
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		while (N-- > 0) {
			double xa = sc.nextDouble();
			double ya = sc.nextDouble();
			double ra = sc.nextDouble();

			double xb = sc.nextDouble();
			double yb = sc.nextDouble();
			double rb = sc.nextDouble();

			double ABAB = (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb);
			if ( ABAB > (ra+rb)*(ra+rb) ) {
				System.out.println(0);
			} else if ( (rb-ra)*(rb-ra) > ABAB ) {
				if (rb > ra) System.out.println(-2);
				else System.out.println(2);
			} else {
				System.out.println(1);
			}
		}
	}

}

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

// types
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<pll> vpl;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

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


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

  ll h,w,k;
  cin >> h >> w >> k;
  vector<string> s(h);
  REP(i, h)
    cin >> s[i];

  vector<vll> t(h, vll(w, 0));
  REP(i, h){
    REP(j, w)
      t[i][j]=0;
  }

  ll cnt=0;
  REP(i, h){
    ll a = 0;
    REP(j, w){
      if(s[i][j]=='#')
        a++;
    }
    if(a==0)
      continue;

    cnt++;
    REP(j, w){
      t[i][j] = cnt;
      if(s[i][j]=='#'){
        a--;
        if(a!=0)
          cnt++;
      }
    }
  }


  REP(i, h){
    if(t[i][0]==0)
      continue;

    for(ll j = i-1; j>=0; j--){
      if(t[j][0]==0){
          t[j] = t[j+1];
      }
    }
    for(ll j = i+1; j<h; j++){
      if(t[j][0]==0){
        t[j] = t[j-1];
      }
    }
  }

  REP(i, h){
    cout << t[i][0];
    REP1(j, w)
      cout << " " << t[i][j];
    cout << endl;
  }
}


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

using I = long long;
using U = unsigned long long;

using F = long double;

template <typename T> using Vec = vector<T>;
template <typename K, typename V> using HashMap = unordered_map<K, V>;
template <typename T> using HashSet = unordered_set<T>;
template <typename T> using PQueue = priority_queue<T>;
template <typename T> using Uq = unique_ptr<T>;

using StrView = string_view;

auto factor(I n) -> HashMap<I, int> {
  HashMap<I, int> r{};
  for (I i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      ++r[i];
      n /= i;
    }
  }
  if (n != 1) {
    r[n] = 1;
  }
  return r;
}

auto solve(I const N) -> void {
  HashMap<I, int> f = factor(N);
  int mx = 0;
  for (auto& e : f) {
    int ec = e.second;
    if (mx < ec) {
      mx = ec;
    }
  }

  Vec<Vec<I>> dp;
  for (I i = 0; i <= mx; ++i) {
    dp.emplace_back(mx + 1, -1);
  }
  dp[0][0] = 0;

  for (I i = 0; i < mx; ++i) {
    for (I j = 0; j <= mx; ++j) {
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
      if (i + 1 <= j) {
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - i - 1] + 1);
      }
    }
  }

  I count = 0;
  for (auto& e : f) {
    count += dp[mx][e.second];
  }

  cout << count << "\n";
}

auto main() -> int {
  I N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}


Measured memory_bytes: 3696
#include <iostream>
#include <vector>
#include <cmath>
#define MAX 15
using namespace std;
typedef pair<int,int> p;

bool contain(vector<int>,int);
int numberOne(int);

int main(void){
  int N;
  cin >> N;
  vector<p> v[MAX]; 
  for(int i=0;i<N;i++){
    int A;
    cin >> A;
    for(int n=0;n<A;n++){
      int x,y;
      cin >> x >> y;
      p tmp(x-1,y);
      v[i].push_back(tmp);
    }
  }
  int status = 0;
  int maxCount = pow(2,N);
  int max = 0;

  for(int status=1;status<maxCount;status++){
    int tmp = status;
    vector<int> right;
    bool contradict = true;
    for(int n=0;n<N;n++){
      if(tmp%2 == 1){
	right.push_back(n);
      }
      tmp = tmp >> 1;
    }
    //cout << "sta:" << status << endl;
    // rightには正直者が入っている
    for(int n=0;n<right.size();n++){
      //正直者の分だけやればいい
      //cout << right[n] << endl;
      vector<p> witness = v[right[n]];
      for(int m=0;m<witness.size();m++){
	p wit = witness[m];
	//正直者
	bool flag;
	if(wit.second == 1){
	  flag = contain(right,wit.first);
	}else{
	  //適当野郎
	  flag = contain(right,wit.first);
	  flag = !flag;
	}
	// 矛盾があったら
	if(!flag){
	  contradict = false;
	  //cout << status << endl;
	}
      }
    }
    if(contradict){
      int value = numberOne(status);
       if(value > max){
         max = value;
      }    
    }
  }
  cout << max << endl;
  return 0;
}


bool contain(vector<int> v,int num){
  for(int n=0;n<v.size();n++){
    if(num == v[n]){
      return true;
    }
  }
  return false;
}

int numberOne(int num){
  int sum=0;
  for(int i=0;i<MAX;i++){
    if(num%2 == 1){
      sum++;
    }
    num = num >> 1;
  }
  return sum;
}


Measured memory_bytes: 256
using System;

class Program {
    static void Main (string[] args) {
        int[] input = Array.ConvertAll (Console.ReadLine ().Split (' '), int.Parse);
        int a = input[0];
        int b = input[1];
        int h = input[2];
        int m = input[3];
        double hKakudo = 360 / 12 * h + 0.5 * m;
        double mKakudo = 360 / 60 * m;
        double minKakudo = Math.Min (hKakudo, mKakudo);
        double maxKakudo = Math.Max (hKakudo, mKakudo);
        double kakudo = Math.Min (maxKakudo - minKakudo, minKakudo + 360 - maxKakudo);
        double ans = a * a + b * b - 2 * a * b * Math.Cos (kakudo * Math.PI / 180);
        Console.WriteLine (Math.Sqrt (ans));
    }
}

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

#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN];
int head,tail,n;

void enqueue(P x){
  Q[tail] = x;
  tail = (tail+1) % LEN;
}

P dequeue(){
  P x= Q[head];
  head= (head+1)%LEN;
  return x;
}

int min(int a, int b){return a <b ? a: b;}

int main(){
  int elaps = 0, c;
  int i,q;
  P u;
  scanf("%d %d",&n,&q);
  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  head=1; tail = n+1;


while(head!=tail){
  u=dequeue();
  c=min(q, u.t);
  u.t -= c;
  elaps += c;
  if(u.t>0) enqueue(u);
  else{
    printf("%s %d\n",u.name,elaps);
  }
}
 return 0;
}

Measured memory_bytes: 10756
N,X,Y = map(int,input().split())

ans = [0]*N

for i in range(1,N):
    for j in range(i+1,N+1):
        road = min(abs(j-i),abs(X-i)+abs(j-Y)+1,abs(Y-i)+abs(j-X)+1)
        ans[road] += 1

for i in range(1,N):
    print(ans[i])


Measured memory_bytes: 3444
n=int(input())
xy=[[0]*2]*n #二次配列
for i in range(n):
	xy[i] = [int(kyori) for kyori in input().split()]
	
dis = 0 #各町間の距離の総和
for i in range(n):
	xi = xy[i][0]
	yi = xy[i][1]
	for j in range(i+1,n):
		xj = xy[j][0]
		yj = xy[j][1]
		dis += ((xi-xj)**2 + (yi-yj)**2)**0.5
		
print(dis*2/n)

Measured memory_bytes: 3064
n = int(input())
a, b = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]

cnt = [0] * 3

for p in P:
    if p <= a:
        cnt[0] += 1
    elif p <= b:
        cnt[1] += 1
    else:
        cnt[2] += 1

print(min(cnt))

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

using ll =  long long;
using pint =  pair<int,int>;

#define INF 99999999
#define rep(i,n) for(int (i)=0,temp=(int)(n);(i)<temp;++(i)) 
#define repi(i,start,end) for(int (i)=(start),temp=(int)(end);i<(end);++(i))
#define rfor(v,x) for(const auto& (x) : (v)) //xは値を表す
#define all(x) (x).begin(),(x).end()
#define SORT(v, n) sort((v), (v)+(n))
#define vsort(v) sort((v).begin(), (v).end())
#define vfsort(v,lambda) sort(all((v)),(lambda))
#define vint vector<int>
#define vvint vector<vector<int>> //vvint v(n,vint(n))のように宣言できる
#define vin(v) rep(i,(v).size()) {cin >> (v)[i];}
//最終奥義(使うときはINFも書き換えろ!!)
//#define int long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int ctoi(char c) {return c-'0';}
//lambda式 -> [&](int x, int y){return x<y;}
//vector内の重複を削除-> v.erase(unique(all(v)),v.end());

signed main(void){
  int n;cin>>n;
  if(n==1){
    cout << 1 << endl;
    return 0;
  }
  int ans=0,c=0;
  repi(i,1,n+1){
    int t=i,cnt=0;
    while(t%2==0){
      cnt++;
      t/=2;
    }
    if(c<cnt){
      ans=i;
      c=cnt;
    }
  }
  cout << ans << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(n) for(int i=0;i<n;++i)
typedef long long ll;
typedef vector<int> vi;
ll i,j=0;

int main(){
    ll n,k;cin>>n>>k;
    ll t = n%k;
    cout << min(t,abs(k-t)) << endl;
}


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

using namespace std;

int main()
{
	int i, n;
	long long x[100010], prod = 1;
	
	scanf ("%d", &n);
	
	for (i = 0; i < n; i++)
	{
		scanf ("%lld", &x[i]);
		
		if (x[i] == 0)
		{
			printf ("0\n");
			return 0;
		}
	}
	
	for (i = 0; i < n; i++)
	{
		if (x[i] <= 1000000000000000000/prod)
			prod *= x[i];
			
		else
		{
			printf ("-1\n");
			return 0;
		}
	}
	
	printf ("%lld\n", prod);	
	
	return 0;
}


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

int main(void) {
  int n;
  int a[200000];
  cin >> n;
  
  if(n < 2) return 1;
  
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  
  int max, semi_max;
  if(a[0] > a[1]) {
    max = a[0];
    semi_max = a[1];
  } else {
    max = a[1];
    semi_max = a[0];
  }
  
  for(int i = 2; i < n; i++) {
    if(a[i] > max) {
      semi_max = max;
      max = a[i];
    } else if(a[i] > semi_max) {
      semi_max = a[i];
    }
  }
  
  for(int i = 0; i < n; i++) {
    if(a[i] == max) {
      cout << semi_max << endl;
    } else {
      cout << max << endl;
    }
  }
  
  return 0;
}

Measured memory_bytes: 2432
import java.util.*;
 
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int sum = 0;
        int num = 0;
        int v = B - A;
        
        for(int i = 0; i < v; i++) {
            sum += i;
        }
        System.out.println(sum - A);
    }
}

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

int main()
{
    cout << setprecision(10) ;
double x1,x2,y1,y2;
double xd ,yd;
cin >> x1 >> y1 >> x2 >> y2;
xd = x2 - x1;
yd = y2 - y1;
xd = xd * xd;
yd = yd * yd;
cout << sqrt(xd + yd) << endl;
return 0;
}




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

int main() {
  string a,b,c;
  cin >> a >> b >> c;

  transform(a.begin (), a.end(), a.begin (), ::toupper);
  transform(b.begin (), b.end(), b.begin (), ::toupper);
  transform(c.begin (), c.end(), c.begin (), ::toupper);

  cout << a[0] << b[0] << c[0] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0);
#define endl '\n'
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
int main() {
#ifdef LOCAL
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
    fastIO;
#endif
    int a, b, k;
    cin >> a >> b >> k;
    for (int i = a; i <= min(a + k - 1, b); i++) {
        cout << i << endl;
    }
    for (int i = max(a + k, b - k + 1); i <= b; i++) {
        cout << i << endl;
    }
    return 0;
}

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=0,a[ohara],b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

      
      cin>>n;
      a[0]=0;
      a[n+1]=0;
      rep(i,n){
        cin>>a[i+1];
      }
      rep(i,n+1){
        pos+=abs(a[i+1]-a[i]);
      }
      //Cout(pos);
      rep(i,n){
        cmp=abs(a[i+1]-a[i])+abs(a[i+2]-a[i+1]);
        cmp-=abs(a[i+2]-a[i]);
        Cout(pos-cmp);
      }
     

       
return 0;
}


Measured memory_bytes: 2176
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String line[] = null;
        int n = Integer.parseInt(bf.readLine());
        int ar [] =  new int[n];
        int br [] =  new int[n];
        int cr [] =  new int[n];

        for(int i=0;i<n;++i) {
            line = bf.readLine().split("\\s");
            ar[i] = Integer.parseInt(line[0]);
            br[i] = Integer.parseInt(line[1]);
            cr[i] = Integer.parseInt(line[2]);
        }
        int[][]dp = new int[n][3];
        dp[0][0] = ar[0];
        dp[0][1] = br[0];
        dp[0][2] = cr[0];

        for(int i=1; i<n;i++) {
            dp[i][0] = Math.max(dp[i-1][1], dp[i-1][2]) + ar[i];
            dp[i][1] = Math.max(dp[i-1][0], dp[i-1][2]) + br[i];
            dp[i][2] = Math.max(dp[i-1][0], dp[i-1][1]) + cr[i];
        }
        System.out.println(Math.max(dp[n-1][0], Math.max(dp[n-1][1], dp[n-1][2])));


    }
}


Measured memory_bytes: 64732
import sys
from fractions import gcd
import bisect
from operator import itemgetter

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]



n = ni()
r_list = list()


for i in range(n):
    s_i, p_i = ns().split(" ")
    r_list.append((s_i, int(p_i), i+1))

r_list.sort(key=lambda x:x[1],reverse=True)

r_list.sort(key=lambda x:x[0])
for i in range(n):
    print(r_list[i][2])

Measured memory_bytes: 66156
#include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;++i)
#define all(v) v.begin(), v.end()
typedef long long int ll;
typedef unsigned long long ull;
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 pair<ll,ll> P;
const long long MOD = 1e9+7;
const ll INF = 1LL << 60;

int main(){
    int a,b;
    cin >> a >> b;
    cout << a*b <<" " << 2*(a+b) << endl;
}


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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define debug(vec) for(auto v : vec) cout << v << " "; cout << endl;

using namespace std;

typedef long long ll;

const long long int INF = 1 << 30; //10^10
//const ll MOD = 998244353;
const ll MOD = 1000000007;

inline void maxch(int& a, int b) { if (a < b) a = b; }



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

	for (char c : s) {
		cout << static_cast<char>('A' + ((c+n-'A') % 26));
	}
	cout << endl;
}

Measured memory_bytes: 256
import java.io.*;

class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] str = br.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int k = Integer.parseInt(str[1]);
    
    str = br.readLine().split(" ");
    
    double count;
    if(n - k > 0) {
      count = Math.ceil((double)(n - k) / (k - 1));
    }
    else {
      count = 0;
    }
    
    System.out.println(Math.round(count) + 1);
  }
}


Measured memory_bytes: 33500
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		if (sc.nextInt()==1) {
			System.out.println("Hello World");
		} else {
			System.out.println(sc.nextInt()+sc.nextInt());
		}




	}
}

Measured memory_bytes: 21716
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll extgcd(ll a, ll b, ll& x, ll& y) {//ax+by=1
  if (b == 0) {
    x = 1, y = 0; return a;
  }
  ll q = a/b, g = extgcd(b, a - q*b, x, y);
  ll z = x - q * y;
  x = y;
  y = z;
  return g;
}

ll invmod (ll a, ll m) { // a^-1 mod m
  ll x, y;
  extgcd(a, m, x, y);
  x %= m;
  if (x < 0) x += m;
  return x;
}

ll nCk(ll n, ll k, ll mod) {
  ll ans = 1;
  for (ll i = n, j = 1; j <= k; i--, j++) ans = (((ans * i) % mod) * invmod(j, mod)) % mod;
  return ans;
}
ll N,M;
int main(){
    cin>>N>>M;
    map<ll,ll> factor;
    ll now=M;
    for(ll i=2;i*i<=M;i++){
        while(now%i==0){
            factor[i]++;
            now/=i;
        }
    }
    factor[now]++;
    ll ans=1;
    for(auto f:factor){
        if(f.first==1)continue;
        ans=(ans*nCk(f.second+N-1,f.second,MOD))%MOD;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
c = 0
N = int(input())

num = list(map(int, input().split()))

for i in range(N - 1):
    for j in reversed(range(i + 1, N)):
        if num[j - 1] > num[j]:
            p = num[j]
            num[j] = num[j - 1]
            num[j - 1] = p
            c += 1

print(" ".join(map(str, num)))
print(c)



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


int main(){
    string S;
    cin>>S;
    int o=0,x=0;
    for(int i=0;i<S.size();i++){
        if(S[i]=='0')o++;
        else x++;
    }
    cout<<2*min(o,x)<<endl;
}

Measured memory_bytes: 512
s = int(input())

MOD = 10 ** 9 + 7


fact = [0] * 4400
invfact = [0] * 4400

fact[0] = 1
for i in range(1, 4400):
    fact[i] = fact[i-1] * i % MOD

invfact[4400 - 1] = pow(fact[4400 - 1], MOD - 2, MOD)

for i in range(4400 - 1, 0, -1):
    invfact[i-1] = invfact[i] * i % MOD


def nCk(n, k):
    return fact[n] * invfact[k] * invfact[n-k] % MOD


ans = 0
for n in range(1, s):
    if 3 * n > s:break
    ans += nCk(s - 3*n + n - 1, n-1)
    ans %= MOD
print(ans)

Measured memory_bytes: 9388
#include<bits/stdc++.h>
#define MAXN 100010
using namespace std;
const int MOD=1e9+7;
int n,A[MAXN],lcm=1,ans;
int has[MAXN*10];
int Quick_Pow(int a,int p){
	int res=1;
	while(p){
		if(p&1)res=1LL*res*a%MOD;
		a=1LL*a*a%MOD;
		p>>=1;
	}
	return res;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&A[i]);
	for(int i=1;i<=n;i++){
		int x=A[i];
		for(int j=2;j*j<=x;j++){
			if(x%j==0){
				int tmp=0;
				while(x%j==0)x/=j,tmp++;
				has[j]=max(has[j],tmp);
			}
		}
		if(x!=1)has[x]=max(has[x],1);
	}
	for(int i=2;i<=1000000;i++)if(has[i])lcm=1LL*lcm*Quick_Pow(i,has[i])%MOD;
	for(int i=1;i<=n;i++){
		ans=(ans+1LL*lcm*Quick_Pow(A[i],MOD-2)%MOD)%MOD;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 4096
#include <stdio.h> 
int main(void) { 
int a,b,i;
char op; 
for(i=1;i>0;i++){ 
	scanf("%d %c %d",&a,&op,&b); 
	if (op=='+') {
		printf("%d\n",a+b);
	} else if(op=='-') {
		printf("%d\n",a-b);
	} else if(op=='*') {
		printf("%d\n",a*b); 
	} else if(op=='/') { 
		printf("%d\n",a/b); 
	} else if(op=='?') { 
		break; 
	} 
} 
return 0; } 


Measured memory_bytes: 2104
N = gets.to_i
arr_h = gets.split(' ').map(&:to_i)

dp = Hash.new
N.times do |ind|

  if ind == 0 
    dp[0] = 0
  elsif ind == 1
    dp[1] = (arr_h[ind] - arr_h[ind - 1]).abs
  else
    a = dp[ind - 1].to_i + (arr_h[ind] - arr_h[ind - 1]).abs
    b = dp[ind - 2].to_i + (arr_h[ind] - arr_h[ind - 2]).abs

    if a <= b
        dp[ind] = a
    else 
        dp[ind] = b
    end       

  end

end

p dp[N-1]

Measured memory_bytes: 14476
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    cin >> str;

    char c[10];
    strcpy(c, str.c_str());

    sort(c, c+4);

    if(c[0] == c[1] && c[2] == c[3] && c[1] != c[2]){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

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

int main(){

    int n, q;
    cin >> n >> q;

    vector<queue<int>> que(n);
    for(int i = 0; i < q; ++i){
        int com, t;
        cin >> com >> t;
        if(com == 0){
            int x;
            cin >> x;
            que[t].push(x);
        }
        else if(com == 1){
            if(!que[t].empty()){
                cout << que[t].front() << endl;
            }
        }
        else if(com == 2){
            if(!que[t].empty()){
                que[t].pop();
            }
        }
    }
    return 0;
}


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

using namespace std;

vector<vector<int> > mult(vector<vector<int> > mat1,vector<vector<int> > mat2,int m){
    int size = mat1.size();
    vector<vector<int> > mul(size,vector<int>(size,0));
    for(int i=0;i<size;i++){
        for(int j=0;j<size;j++){
            for(int k=0;k<size;k++){
                mul[i][j]+=mat1[i][k]*mat2[k][j];
                mul[i][j]%=m;
            }
        }
    }
    return mul;
}

vector<vector<int> > repeat_pow(vector<vector<int> > mat,int t, int m){
    if(t==0){
        int size = mat.size();
        vector<vector<int> > ide(size,vector<int>(size,0));
        for(int i=0;i<size;i++){
            ide[i][i]=1;
        }
        return ide;
    }
    if(t%2==0){
        mat = repeat_pow(mat,t/2,m);
        return mult(mat,mat,m); 
    }else{
        return mult(mat,repeat_pow(mat,t-1,m),m);
    }
}

int main(){
    int n,m,a,b,c,t;
    while(cin >> n >> m >> a >> b >> c >> t,n|m|a|b|c|t){
        vector<int> s(n);
        for(int i=0;i<n;i++){
            cin >> s[i];
        }
        vector<vector<int> > mat(n,vector<int>(n,0));
        for(int i=0;i<n;i++){
            mat[i][i]=b;
            if(i+1<n)mat[i][i+1]=c;
            if(i-1>=0)mat[i][i-1]=a;
        }
        vector<vector<int> > mat_pow(n,vector<int>(n));
        mat_pow = repeat_pow(mat,t,m);
        vector<int> ans(n);
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                ans[i] += s[j] * mat_pow[i][j];
                ans[i]%=m;
            }
        }
        for(int i=0;i<n;i++){
            if(i==0)cout << ans[i];
            else cout << " " << ans[i];
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3516