akhauriyash/Code-Regression huggingface dataset:
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

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

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;






int main(void) {
	LL N;
	cin >> N;

	for(LL h=1; h<=3500; h++ ) {
		for(LL n=1; n<=3500; n++ ) {
			if((4 * h * n - N * n - N * h) <= 0 ) continue;
			if( (N * h * n) % (4 * h * n - N * n - N * h) == 0 ) {
				LL w = (N * h * n) / (4 * h * n - N * n - N * h); 
				if (w > 0) {
					cout << h << " " << n << " " << w << endl;
					return 0;
				}
			}	
		}	
	}

	return 0;
}


Measured memory_bytes: 256
S = input()
N = len(S) + 1
A = [0]*N

cnt = 0
for i in range(N):
    A[i] = cnt
    if i == N-1:
        break
    if S[i] == "<":
        cnt += 1
    else:
        cnt = 0

cnt = 0
for i in range(N)[::-1]:
    A[i] = max(A[i], cnt)
    if i == 0:
        break
    if S[i-1] == ">":
        cnt += 1
    else:
        cnt = 0

print(sum(A))

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

int main() {

    int N;
    cin >> N;

    string S, T;
    cin >> S >> T;

    string ans = "";
    rep(i, N) {
        ans += S[i];
        ans += T[i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);

        int num = 0;
        int min = 0;
        int max = 0;
        min = scan.nextInt();
        scan.nextInt();
        scan.nextInt();
        scan.nextInt();
        max = scan.nextInt();
        int k = scan.nextInt();
        
        if ((max - min) > k){
            System.out.println(":(");
        } else {
            System.out.println("Yay!");
        }
    }
}

Measured memory_bytes: 22740
#include <iostream>

using namespace std;

int main() {
    uint16_t H, W;

    while (cin >> H >> W) {
        if (H == 0 && W == 0)
            break;

        for (uint16_t i = 0; i < H; i++) {
            for (uint16_t j = 0; j < W; j++)
                cout << "#";

            cout << endl;
        }

        cout << endl;
    }

    return 0;
}

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

using namespace std;

string s; 

int main()
{
	cin>>s;
	if(s[s.length()-1]=='s')
	{
		s=s+"es";
	}
	else
	{
		s=s+"s";
	}
	cout<<s;
	return 0;
}


Measured memory_bytes: 3632
///#pragma GCC optimize("O3,unroll-loops")
///#pragma GCC target("avx,avx2,fma")

#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define ull unsigned long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 200005
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d\n", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d: ", t)
#define pii pair<int, int>
#define MOD 1000000007
#define mod 998244353
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(ll N, ll pos){return (bool)(N & (1LL<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

const int N = 1000006;
ll inv[N], cnt[N], ans[N], sum[N], sq[N];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    FASTIO;
    double r;
    cin>>r;
    cout<<fixed<<setprecision(15)<<(2.0*PI*r)<<endl;

    //End();
    return 0;
}


Measured memory_bytes: 3776
////ABC 079
#include "bits/stdc++.h"
#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define ALL(obj) (obj).begin(),(obj).end()

using namespace std;

const int INF = 99999999;
const ll LINF = 9999999999999;

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
int vx[4] = { 0,1,0,-1 };
int vy[4] = { 1,0,-1,0 };
ll maryoku[10][10];
ll h, w;
ll ba[210][210];

signed main() {

	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	cin >> h >> w;
	REP(i, 10) {
		REP(j, 10) {
			//i行j列
			cin >> maryoku[i][j];
		}
	}

	REP(i, h) {
		REP(j, w) {
			cin >> ba[i][j];
		}
	}

	//最短経路求める
	REP(i, 10) {//経由する頂点
		REP(j, 10) {//開始頂点
			REP(k, 10) {//終端
				maryoku[j][k] = min(maryoku[j][i] + maryoku[i][k], maryoku[j][k]);
			}
		}
	}

	

	//後は実際に変える
	ll cost = 0;
	REP(i, h) {
		REP(j, w) {
			if (ba[i][j] == -1 || ba[i][j]==1) {
				continue;
			}
			else {
				cost += maryoku[ba[i][j]][1];
			}
		}
	}

	cout << cost;

	return 0;
}

Measured memory_bytes: 640
N = list(str(input()))
A = int(N[0])
B = int(N[1])
C = int(N[2])
D = int(N[3])

if A + B + C + D == 7:
    print(A, end="+")
    print(B, end="+")
    print(C, end="+")
    print(D, end="=7")
elif A - B + C + D == 7:
    print(A, end="-")
    print(B, end="+")
    print(C, end="+")
    print(D, end="=7")
elif A + B - C + D == 7:
    print(A, end="+")
    print(B, end="-")
    print(C, end="+")
    print(D, end="=7")
elif A + B + C - D == 7:
    print(A, end="+")
    print(B, end="+")
    print(C, end="-")
    print(D, end="=7")
elif A - B - C + D == 7:
    print(A, end="-")
    print(B, end="-")
    print(C, end="+")
    print(D, end="=7")
elif A + B - C - D == 7:
    print(A, end="+")
    print(B, end="-")
    print(C, end="-")
    print(D, end="=7")
elif A - B + C - D == 7:
    print(A, end="-")
    print(B, end="+")
    print(C, end="-")
    print(D, end="=7")
elif A - B - C - D == 7:
    print(A, end="-")
    print(B, end="-")
    print(C, end="-")
    print(D, end="=7")

Measured memory_bytes: 3188
module Main where

import Debug.Trace
import Data.List
import qualified Data.Sequence as S
import qualified Data.ByteString.Char8 as B
import Data.Int
import Data.Char
import Data.Array
import Data.Maybe
import qualified Data.Map as M
import Data.Ord
import Data.Functor
import Control.Applicative
import Control.Monad
import Text.Printf

data Tree = Nil | Node Int Tree Tree deriving (Eq, Show)

solve :: [Int] -> [Int] -> [Int]
solve pro ino = iter root where
    iter Nil = []
    iter (Node id left right) = iter left ++ iter right ++ [id]    

    root = iter pro ino where
        iter [] [] = Nil
        iter (p:pol) iol = Node p (iter lpro lino) (iter rpro rino) where
            (lino, ri) = break (==p) iol
            rino = drop 1 ri
            lpro = intersect pol lino
            rpro = intersect pol rino

            
readIntLn:: IO Int
readIntLn = (fst . fromJust . B.readInt) <$> B.getLine

readIntList:: IO [Int]
readIntList = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

print':: [Int] -> IO ()
print' [x] = putStrLn (show x)
print' (x:xs) = do
    putStr $ show x ++ " "
    print' xs

main :: IO() 
main = do
    _ <- readIntLn
    l <- readIntList
    m <- readIntList
    print' $ solve l m



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

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

	vector<int> t(100000, 0);

	for (int x = 1; x <= 100; ++x) {
		for (int y = 1; y <= 100; ++y) {
			for (int z = 1; z <= 100; ++z) {
				t[x*x + y * y + z * z + x * y + y * z + z * x]++;
			}
		}
	}


	for (int i = 1; i <= n; ++i) {
		cout << t[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 3700
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
typedef long long ll;
using namespace std;
int N, K;
int A[100003];

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

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

  cin >> N >> K;
  int f = 0;
  rep(i, N) cin >> A[i];
  rep(i, N){
    if (A[i] == K) {
      f = 1;
      break;
    };
    if (A[i] > K) {
      f = 2;
      continue;
    }
  }
  if (f==0){
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  if (f==1){
    cout << "POSSIBLE" << endl;
    return 0;
  }

  vector<int> B;
  rep(i, N-1){
    if (A[i+1] == A[i]) continue;
    B.push_back(abs(A[i+1] - A[i]));
  }
  
  int g = B[0];
  rep(i, B.size()){
    if (g == 1) break;
    g = gcd(g, B[i]);
  }
  if (g==K){
    cout << "POSSIBLE" << endl;
    return 0;
  }
  
  bool flag = false;
  rep(i, N){
    if(abs(A[i]-K)%g==0){
      flag = true;
      break;
    }
  }
  string ans = flag?"POSSIBLE":"IMPOSSIBLE";
  cout << ans << endl;
  return 0;
}

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

# define rep(i, n) for(int(i)=0;(i)<(n);(i)++)
# define reps(i, n) for(int(i)=1;(i)<=(n);(i)++)
# define rrep(i, n) for(int i=((int)(n)); i>0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>=0; --i)
# define ALL(v) v.begin(), v.end()
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<typename T> void dump(T e){std::cout << e << std::endl;}
template<typename T> void dump(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void dump(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ dump(v); } }
typedef long long ll;


int main(){
  int n; cin >> n;
  vector <string> data1(n),data2(n);
  rep(i,n) {
    cin >> data1[i];
    data2[i] = data1[i];
  }
  
  rep(i, data1.size()) {
    for (int j=n-1; j>i;j--) {
    //for (int j=i+1; j<n; j++) {
      //dump(j);
      //dump(data1[j]);
      //dump("--");
      //dump(j-1);
      //dump(data1[j-1]);
      //dump("======");
      if (data1[j][1] < data1[j-1][1]) swap(data1[j],data1[j-1]);
    }
  }
  
  rep(i, data2.size()) {
    int mini = i;
    for (int j=i; j<n; j++) {
      if (data2[j][1] < data2[mini][1]) mini = j;
    }
    if(i!=mini) swap(data2[i], data2[mini]);
  }
  

  rep(i,data1.size()) cout << (i!=0? " ":"") << data1[i];
  cout << endl << "Stable" << endl;

  rep(i,data2.size()) cout << (i!=0? " ":"") << data2[i];
  cout << endl;
  if (data1 == data2) {
    cout << "Stable" << endl;
  } else {
    cout << "Not stable" << endl;
  }
}



Measured memory_bytes: 3192
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#ifdef DAIJOBU
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}

int main(){
	FIO

	long long h, w;cin >> h >> w;
	if(w == 1 || h == 1){cout << 1;return 0;}
	long long x = ceil(h / 2.0), y = ceil((w - 1) / 2.0), z = ceil(w / 2.0);
	cout << x * z + (h - x) * (y);
	#ifdef DAIJOBU
	cerr << "\n\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	#endif
	return 0;
}


Measured memory_bytes: 256
n = int(input())
A = sorted(list(map(int,input().split())),reverse=True)
k = 10**10
for i in range(1,n):
    k = min(k,abs(A[0]/2 -A[i]))
    if k == abs(A[0]/2 -A[i]):
        ans = [A[0],A[i]]
print(ans[0],ans[1])

Measured memory_bytes: 14432
#include <vector>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <functional>
#include <map>
#include <array>
#include <cmath>

long long PRIME = 1000000007;
using namespace std;

struct LRBlock{
    LRBlock(){
        num_R = 0;
        num_L = 0;
    }

    int num_R;
    int num_L;
};

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

    vector<LRBlock> blocks;

    char prev = 'R';
    LRBlock block;

    for(int i = 0; i < S.size(); ++i){
        if(S[i] == 'L'){
            block.num_L++;
        }
        else{
            if(prev == 'R'){
                block.num_R++;
            }
            else{
                blocks.push_back(block);
                block.num_L = 0;
                block.num_R = 1;
            }
        }
        prev = S[i];
    }

    blocks.push_back(block);

    for(auto & block : blocks){
        int base_num = min(block.num_R, block.num_L);
        int turn = base_num - 1;
        int rest = max(block.num_R, block.num_L) - base_num;

        for(int i = 0; i < block.num_R - 1; ++i){
            cout << 0 << " ";
        }

        base_num += rest / 2;

        if(rest % 2 == 0){
            cout << base_num << " " << base_num << " ";
        }
        else{
            turn += rest;

            if(turn % 2 == 0){
                if(block.num_R > block.num_L){
                    cout << base_num + 1 << " " << base_num << " ";
                }
                else{
                    cout << base_num  << " " << base_num + 1 << " ";
                }
            }
            else{
                if(block.num_R > block.num_L){
                    cout << base_num << " " << base_num + 1 << " ";
                }
                else{
                    cout << base_num + 1 << " " << base_num << " ";
                }
            }
        }

        for(int i = 0; i < block.num_L - 1; ++i){
            cout << 0 << " ";
        }

    }

}



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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 1e9+7;


int main(){
	//ios_base::sync_with_stdio(false);
	ll X, Y, ans=0;

	cin >> X >> Y;

	ll cur = X;
	while(cur <= Y){
		ans++;
		cur *= 2;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(S: str):
    print(S.count("+") - S.count("-"))


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include<stdio.h>
#include<math.h>

struct Point{
  double x,y;
};

void koch(int n,struct Point a,struct Point b){
  if(n==0)return;
  struct Point s,t,u;
  double th=M_PI*60.0/180.0;

  s.x=(2.0*a.x+1.0*b.x)/3.0;
  s.y=(2.0*a.y+1.0*b.y)/3.0;
  t.x=(1.0*a.x+2.0*b.x)/3.0;
  t.y=(1.0*a.y+2.0*b.y)/3.0;
  u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
  u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;

  koch(n-1,a,s);
  printf("%.8f %.8f\n",s.x,s.y);
  koch(n-1,s,u);
  printf("%.8f %.8f\n",u.x,u.y);
 koch(n-1,u,t);
  printf("%.8f %.8f\n",t.x,t.y);
   koch(n-1,t,b);
  
}

int main(){
struct Point a,b;
  int n;

  scanf("%d",&n);

  a.x=0;
  a.y=0;
  b.x=100;
  b.y=0;

  printf("%.8f %.8f\n",a.x,a.y);
  koch(n,a,b);
  printf("%.8f %.8f\n",b.x,b.y);
  
  return 0;
}



Measured memory_bytes: 2104
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
#include <numeric>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265359;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };




signed main() {
	string s;

	cin >> s;

	if (s.length() >= 4 && s[0]=='A') {
		int cnt = 0, index;

		for (int i = 2; i < s.length() - 1; i++) {
			if (s[i] == 'C') {
				index = i;
				cnt++;
			}
		}

		bool flag = false;

		if (cnt == 1) {
			for (int i = 0; i < s.length(); i++) {
				if (i == 0 || i == index)continue;
				if (!(s[i] >= 'a' && s[i] <= 'z')) {
					flag = true;
				}
			}

			if (flag == false) {
				cout << "AC" << endl;
				return 0;
			}
		}
	}

	cout << "WA" << endl;


	return 0;
}

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

int main(){
	int A,B,K;
	cin>>A>>B>>K;
	
	for(int i=A;i<B+1;i++){
		if(A<=i&&i<A+K){
			cout<<i<<endl;
		}else if(B-K<i&&i<=B){
			cout<<i<<endl;
		}
	}
	
	
	
	/*vector<int>N;
	rep(i,K){
		//cout<<A+i<<endl;
		N.at(A+i)++;
	}
	rep(i,K){
		//cout<<B-K+i+1<<endl;
		N.at(B-K+i+1)++;
	}
	rep(i,N.size()){
		if(N.at(i)>0){
			cout<<i<<endl;
		}
	}*/
return 0;}

/*compile
g++ code.cpp
./a.out
run*/

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 ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, 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 1; } return 0; }

//行く先のindex, その前に訪問した頂点
typedef pair<int,int> P;


int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>>graph(N);
    vector<int>arrows(N,-1);

    for (int i=0; i<M; i++){
        int ai, bi;
        cin >> ai >> bi;
        ai--;
        bi--;
        graph[ai].push_back(bi);
        graph[bi].push_back(ai);
    }
    queue<P> que;
    for (int i=0; i<graph[0].size(); i++){
        que.push(P(graph[0][i], 0));
    }    
    map<int,bool>queued;

    while (que.size()){
        P pr = que.front(); que.pop();
        int next = pr.first;
        int last = pr.second;

        if (arrows[next] == -1)arrows[next] = last;
        for (int i=0; i<graph[next].size(); i++){
            if (arrows[graph[next][i]] == -1 and queued[graph[next][i]] == false){
                que.push(P(graph[next][i], next));}
                queued[graph[next][i]] = true;
        }        
    }
    cout << "Yes" << endl;
    for (int i=1; i<N; i++){
        cout << arrows[i]+1 << endl;
    }   
}

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

int main()
{
    string str;
    cin >> str;
    char c = str[0];
    int ans = 0;
    for(int i = 1; i < str.length(); c = str[i], i++)
        if(str[i] != c)
            ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    int n = s.size();
    int ans = 0;
    if(n%2==0){
        for(int i=0; i<=(n/2)-1; i++){
            if(s[i]!=s[n-i-1]){
                ans++;
            } 
        }
    }else{
        for(int i=0; i<=((n-1)/2)-1; i++){
            if(s[i]!=s[n-i-1]){
                ans++;
            } 
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
# include <iostream>
typedef long long ll;
using namespace std;
int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int gcd3(int a, int b, int c) {
    int res = gcd(a, b);
    return gcd(res, c);
}
int main() {
    ll k;
    cin >> k;
    ll sum(0);
    for (int i = 1; i <= k; i++) {
        for (int j = 1; j <= k ; j++) {
             for (int m = 1; m <= k; m++) {
                 sum += gcd3(i, j, m);
             }
        }
    }
    cout << sum << "\n";
    return 0;
}

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

int main()
{
    int N;
    cin >> N;
    int result[N];
    for (int i = 0; i < N; i++)
    {
        int num;
        cin >> num;
        result[num - 1] = i + 1;
    }
    for (int i = 0; i < N; i++)
    {
        cout << result[i] << " ";
    }
    cout << endl;
}


Measured memory_bytes: 1152
#include<iostream>
using namespace std;
int main(){
    int a, b, x;
    cin >> a >> b >> x;
    bool judge = false;
    if(x >= a && (x - a) <= b ){
        judge = true;
    }
    if(judge){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const int64_t INF = 1e9 + 7;

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

    vector<int> vec(N);
    for(int i = 0; i < N; ++i){
        int A;
        cin >> A;
        if(0 <= A && A <= N){
            vec[A]++;
        }
    }

    bool check = true;
    for(int i = 0; i < N; ++i){
        if(N % 2 != i % 2){
            if(i != 0 && vec[i] != 2){
                check = false;
                break;
            }
        }
    }

    if(!check){
        cout << 0 << endl;
        return 0;
    }
    
    int64_t ans = 1;
    for(int i = 0; i < N / 2; ++i){
        ans *= 2;
        ans %= INF;
    }
    cout << ans << endl;

}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(x) cout<<#x<<":";cout<<x<<endl;
#define debugs(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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;}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    ll n,m;cin>>n>>m;
    if(n%2){
        ll l=1,r=n-1;
        rep(i,m){
            cout<<l<<" "<<r<<endl;
            l++,r--;
        }
        return 0;
    }
    else{
        ll l=1,r=n;
        if((n/2)%2){
            rep(i,m){
                cout<<l<<" "<<r<<endl;
                l++,r--;
                if(r-l==n/2){
                    r--;
                }
            }
        }
        else{
            ll l=1,r=n;
            set<pair<ll,ll>> st;
            bool f=true;
            rep(i,m){
                cout<<l<<" "<<r<<endl;
                l++,r--;
                ll x=r-l;ll y=n-x;
                if(f and st.count(make_pair(max(x,y),min(x,y)))){
                    r--;f=false;
                }
                st.insert(make_pair(max(x,y),min(x,y)));
            }
        }
        return 0;
    }

    return 0;
}


Measured memory_bytes: 7872
#include <bits/stdc++.h>
using namespace std;
int main(){
int N;
   cin>>N;
vector<int>gusu(N);
  
  for(int i=0;i<N;i++){
  	cin>>gusu.at(i);
  }
 int ans=0;
  while(true){
  bool odd =false;
  for(int i=0;i<N;i++){
  	if(gusu.at(i)%2 == 1){
    odd =true;
     }
   }
  if(odd){
   break;
  }
  ans++;
    for(int i=0;i<N;i++){
    	 gusu.at(i)/=2;
    }
    
  }
cout<<ans<<endl;

}

Measured memory_bytes: 256
#include <stdio.h>
#define number 1000000
 
char prime[number];
 
int gcd(int n, int m) {
    if(!m) return n;
    else gcd(m, n%m);
}
 
void Eratosthenes(char prime[]) {
    long i, j;
    prime[1] = 1;
    for(i = 2; i < number; i++ ) {
        if(!prime[i]) {
            //printf("%d\n",i);
            for(j = 2; j*i < number; j++ ) {
                prime[i*j] = 1;
            }
        }
    }
}
 
int main(void) {
    int a, d, n, i, count = 0;
    Eratosthenes(prime);
    while(scanf("%d%d%d",&a,&d,&n), a+d+n) {
        count = 0;
        for(i = 0; a + i*d < number; i++ ) {
            if(!prime[a + i*d]) {
                count++;
                if(count == n) {
                    printf("%d\n",a + i*d);
                    break;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1576
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if (n >= 400 && n <= 599) {
			System.out.println("8");
		} else if (n >= 600 && n <= 799) {
			System.out.println("7");
		} else if (n >= 800 && n <= 999) {
			System.out.println("6");
		} else if (n >= 1000 && n <= 1199) {
			System.out.println("5");
		} else if (n >= 1200 && n <= 1399) {
			System.out.println("4");
		} else if (n >= 1400 && n <= 1599) {
			System.out.println("3");
		} else if (n >= 1600 && n <= 1799) {
			System.out.println("2");
		} else if (n >= 1800 && n <= 1999) {
			System.out.println("1");
		}
	}
}


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

int main()
{
	unsigned long long int a, bb;
	string b;
	cin >> a >> b;
	bb = (b[0] - '1' + 1)*100 + (b[2] - '1' + 1)*10 + (b[3] - '1' + 1);
	cout << (long long int)(a * bb) / 100 << endl;
	return 0;
}

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

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int num=0;
		String s=sc.nextLine(),t=sc.nextLine();

		for(int i=0;i<s.length();i++){
			if(s.charAt(i)!=t.charAt(i))num++;
		}
		System.out.print(num);
		sc.close();
	}
}


Measured memory_bytes: 42240
N = int(input())
A = [[0]*10 for _ in range(10)]
for i in range(1,N+1):
  a = i%10 #1の位
  b = i // (10**(len(str(i))-1))
  if a!= 0:
    A[a][b] += 1
t = 0
for i in range(1,10):
  s = A[i][i]
  if s != 0:
    t += int(s + (s*(s-1)))
for i in range(1,9):
  for j in range(i+1,10):
    t += A[i][j] * A[j][i]*2
print(t)

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

int max(int x, int y)
{
    if (x>=y) return x;
    else return y;
}

int main()
{
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    int maxnum = max(a, max(b, c));
    int ans = a + b + c + maxnum*9;
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 128
'use strict';
process.stdin.resume();
process.stdin.setEncoding('utf8');

// Your code here!
const max = (a)=>{
    let i = a.length;
    let max=-Infinity;
    while (i--) {
        if (a[i] > max)max = a[i];
    }
    return max;
}
const min = (a)=>{
    let i = a.length;
    let max=Infinity;
    while (i--) {
        if (a[i] < max)max = a[i];
    }
    return max;
}
const Main = (p)=>{
	p = p.split("\n");//2 or more
	//const H=p[0];
	//const N=p[1];
	//const N = parseInt(p[0]);//N
    const H = parseInt(p[0].split(" ")[0]);//N M
	const N = parseInt(p[0].split(" ")[1]);//N M
	//let h = (p[1].split(" ").map(Number));//a1 a2 a3...
	let A=new Array(N+10);
	let B=new Array(N+10);
	let w = new Array(N+10);
	for(let i=1;i<=N;i++){
	    let t=p[i].split(" ").map(Number);
	    A[i]=t[0];
	    B[i]=t[1];
	    w[i]=new Array(H).fill(Infinity);
	}
	for(let i=1;i<=H;i++)w[1][i]=Math.ceil(i/A[1])*B[1];
    
    for(let i=2;i<=N;i++){
	    for(let j=1;j<=H;j++){
	        let mp=Math.ceil(j/A[i])*B[i];
	        w[i][j]=Math.min(w[i-1][j],mp);
	        if(j>A[i]){
	            w[i][j]=Math.min(w[i][j],w[i][j-A[i]]+B[i]/*dam*/);
	        }
	    }   
	}
	console.log(w[N][H])
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


Measured memory_bytes: 223648
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+b,(a).begin()+c // コンテナ a の 要素 b から c へのイテレータ
#define MOD 1000000007
#define INF 1000000000
typedef pair<int64_t, int64_t> PII;
typedef vector<int64_t> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

int N, M; cin >> N >> M;
VI x(M), y(M); rep(i, 0, M) cin >> x[i] >> y[i];
VI nball(N+1, 1); // ボールの個数
vector<bool> proball(N+1, false); // ボールがある可能性のある箱
proball[1] = true;

rep(i, 0, M){
    if (proball[x[i]]) {
        proball[y[i]] = true;
        if (nball[x[i]] == 1)
            proball[x[i]] = false;
    }
    --nball[x[i]];
    ++nball[y[i]];
}
cout << accumulate(ALL(proball), 0) << endl;
}

// 境界，出力文字列 チェック
// 可読性優先．高速化次点．
// まずは全探索，分割統治，次にDP
// 制限を見る．境界に注意．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり



Measured memory_bytes: 2688
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

string s;
ll dp[2][5][105];
int n,k;

int main(){
	cin>>s; n = s.size(); cin>>k;
	dp[0][0][0] = 1;
	rep(i,n){
		int nxt = s[i]-'0';
		rep(k,4){
			//dp[0][k][i]
			rep(j,nxt+1){
				dp[j!=nxt][k+!!j][i+1] += dp[0][k][i];
			}
			//dp[1][k][i]
			rep(j,10){
				dp[1][k+!!j][i+1] += dp[1][k][i];
			}
		}
	}
	cout<<(dp[0][k][n]+dp[1][k][n])<<endl;
}

Measured memory_bytes: 256
n = int(input())
d = list(map(int, input().split()))

i = 0
j = 0
p = 0

while i < n - 1:
    while j < n - 1:
        p += d[i] * d[j + 1]
        j = j + 1 
    i = i + 1
    j = i
print(p)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};

const int MAX=510000;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int n,l;
  cin >> n >> l;
  int sum = 0;
  rep(i,n){
    sum+=l+i;
  }
  int ans = 0;
  int g=MAX;
  rep(i,n){
    int res = 0;
    rep(j,n){
      if(i==j)continue;
      res+=l+j;
    }
    if(abs(sum-res)<g){
      g=abs(sum-res);
      ans=res;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#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 rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
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; }


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n,k;cin>>n>>k;
    string s; cin>>s;

    int cnt=0;
    for(int i=0; i<n-1; i++){
        if(s[i]==s[i+1]) cnt++;
    }
    int ans = min(cnt+2*k,n-1);
    cout<<ans<<endl;
    }

Measured memory_bytes: 3760
#include <bits/stdc++.h>
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
 
using namespace std;
 
typedef unsigned long long ll;
typedef pair<ll, ll> pair_;
 
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
 
int main(){

  vector<int> a_ = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K;
    cin >> K;
    cout << a_[K-1];

   
    return 0;
 
}

Measured memory_bytes: 256
N = int(input())
li = [1]

six = 1
while six <= N:
    six = six*6
    li.append(six)

nine = 1
while nine <= N:
    nine = nine*9
    li.append(nine)

INF = 10**10

dp = [INF for i in range(N+1)]
dp[0] = 0

for i in range(N):
    for num in li:
        if i+num <= N:
            dp[i+num] = min(dp[i+num], dp[i] + 1)
print(dp[N])


Measured memory_bytes: 3864
def selection_sort! size, target_array
  count = 0
  size.times {|i|
    unsorted = target_array[i..(size - 1)]
    min = unsorted.min
    index_min = unsorted.index(min)
    if min < target_array[i]
      target_array[i], target_array[i + index_min] = target_array[i + index_min], target_array[i]
      count += 1
    end
  }
  count
end


size = STDIN.gets.chomp.to_i
target_array = STDIN.gets.chomp.split(' ').map{|n|n.to_i}

count = selection_sort!(size, target_array)
puts target_array.join ' '
puts count

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

int N, M;

int exp(int x, int n) {
    int ret = 1;
    while(n) {
        if(n & 1) ret = 1LL * ret * x % M;
        x = 1LL * x * x % M;
        n >>= 1;
    }
    return ret;
}
int inv(int x) {
    return exp(x, M - 2);
}
int po1[3010], po2[3010], ppo[3010], fact[3010], invf[3010], prec[3010][3010];
int comb(int n, int k) {
    return 1LL * fact[n] * invf[k] % M * invf[n - k] % M;
}

int X;

int cc[3010][3010];
int dp(int n, int k) {
    int &ret = cc[n][k];
    if(ret != -1) return ret;
    if(n == 0) return ret = k == 0;

    ret = 0;
    if(k) {
        ret += dp(n - 1, k - 1);
        ret %= M;
    }
    ret += 1LL * dp(n - 1, k) * k % M;
    ret %= M;
    return ret;
}

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

    po1[0] = 1;
    for(int i = 1; i < 3010; i++) {
        po1[i] = 1LL * po1[i - 1] * 2 % M;
    }
    po2[0] = 1;
    for(int i = 1; i < 3010; i++) {
        po2[i] = 1LL * po2[i - 1] * 2 % (M - 1);
    }
    for(int i = 0; i < 3010; i++) {
        ppo[i] = exp(2, po2[i]);
    }
    fact[0] = 1;
    for(int i = 1; i < 3010; i++) {
        fact[i] = 1LL * fact[i - 1] * i % M;
    }
    for(int i = 0; i < 3010; i++) {
        invf[i] = inv(fact[i]);
    }
    for(int i = 0; i < 3010; i++) {
        prec[i][0] = 1;
        for(int j = 1; j < 3010; j++) {
            prec[i][j] = 1LL * prec[i][j - 1] * po1[i] % M;
        }
    }

    memset(cc, -1, sizeof(cc));

    int ans = 0;
    for(int i = 0; i <= N; i++) {
        X = N - i;

        int tmp = 0;
        if(!i) tmp++;
        for(int j = 1; j <= i; j++) {
            tmp += 1LL * dp(i, j) * prec[X][j] % M;
            tmp %= M;
            tmp += 1LL * dp(i, j) * j % M * prec[X][j - 1] % M;
            tmp %= M;
        }

        //cout << ppo[X] << ' ' << comb(N, i) << ' ' << tmp << endl;

        if(i % 2) {
            ans += M - 1LL * ppo[X] * comb(N, i) % M * tmp % M;
            ans %= M;
        }
        else {
            ans += 1LL * ppo[X] * comb(N, i) % M * tmp % M;
            ans %= M;
        }
    }

    printf("%d", ans);
}


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

#define N 100000

int main(void){
    vector<bool> prime(N+1,true);
    prime[0]=prime[1]=false;
    for (size_t i = 2; i <= sqrt(N); i++)
    {
        if (prime[i])
        {
            for (size_t j = 2; i*j <= N; j++)
            {
                prime[i*j]=false;
            }
        }
    }
    int likeCnt[N+1];
    for (size_t i = 3; i <= N; i+=2)
    {
        likeCnt[i]=likeCnt[i-1];
        if (i%2==1&&prime[i]&&prime[(i+1)/2]) likeCnt[i]++;
        likeCnt[i+1]=likeCnt[i];
    }
    /**************************************/
    int q;
    scanf("%d", &q);
    int l,r;
    for (size_t i = 0; i < q; i++)
    {
        scanf("%d%d", &l, &r);
        printf("%d\n", likeCnt[r] - likeCnt[l-1]);
    }
    return 0;
}

Measured memory_bytes: 1024
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numberOfMonsters = scanner.nextInt();
        int numberOfSpecialAttacks = scanner.nextInt();

        List<Integer> monsters = new ArrayList<>();
        for (int i = 0; i < numberOfMonsters; i++) {
            monsters.add(scanner.nextInt());
        }
        Collections.sort(monsters);

        long sum = 0;
        for (int i = 0; i < (monsters.size() - numberOfSpecialAttacks); i++) {
            sum += monsters.get(i);
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 92904
#include <bits/stdc++.h>
using namespace std;
#define r(i,n) for(auto i=0;i<n;i++)
#define s(c) static_cast<int>((c).size())

int partition(int A[], int p, int r){
	int x = A[r];
	int i = p-1;
	for(int j = p; j < r; j++){
		if(A[j] <= x){
			i++;
			swap(A[i], A[j]);
		}
	}
	i++;
	swap(A[i], A[r]);
	return i;
}

int main(){
	int n;
	cin >> n;
	int A[n];
	r(i, n){
		cin >> A[i];
	}
	int i, p = partition(A, 0, n-1);
	r(i, p)
		cout << A[i] << ' ';
	cout << '[' << A[p] << ']';
	for(i = p+1; i < n; i++)
		cout << ' ' << A[i];
	cout << endl;
	return 0;
}


Measured memory_bytes: 3448
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define sort(s) sort(s.begin(),s.end())
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<int>>
constexpr auto mod = 1000000007;
 
 
//2のn乗を求めるよ！！！
int ni(int n) {
	if (n == 0)return 1;
	int x = ni(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;
}
 
//フィボナッチ数列のx番目を求めるよ！
int f(int x,vector<int> s) {
	if (x == 0)return 0;
	if (x == 1)return 1;
	if (s[x] != 0)return s[x];
	s[x] = f(x - 1,s) + f(x - 2,s);
	return s[x];
}
 
//aとｂの最大公約数を求めるよ！
int gcd(int a, int b) {
	if (a < b)swap(a, b);
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
 
 
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
 
// mod. m での a の逆元 a^{-1} を計算するよ！
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
 
 
//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b,ll int m) {
	ll int ans = 1;
	for (ll int i = 0; i < b; i++) {
		ans *= a - i;
		ans %= m;
	}
	for (ll int i = 1; i <= b; i++) {
		ans *= modinv(i, m);
		ans %= m;
	}
	return ans;
}
 
//2進数のn桁を全列挙やで
llint dfs(string s,int n) {
	llint sum = 0;
	stack<string> st;
	st.push("");
	while (!st.empty()) {
		string now = st.top();
		st.pop();
		if (now.size() == n) {
			ll ans=0;
			string t;
			for (int j = 0; j < n; j++) {
				t+=s[j];
				if (now[j]-'0' == 1)ans+=stoll(t),t="0";
			}
			t += s[n];
			ans += stoll(t);
			sum += ans;
			ans = 0;
		}
		else {
			for (int i = 1; i >= 0; i--) {
				string next = now + to_string(i);
				st.push(next);
			}
		}
	}
	return sum;
}
 
 
 
int  main() {
	string s;
	cin >> s;
	int a = s.size() - 1;
	llint ans=dfs(s, a);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [n, m] = input[0].split(" ").map((x: string): number => +x);

const result = (n * m) % 2 === 0 ? 'Even' : 'Odd'

console.log(result);

Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main() {
    string s, t;
    cin >> s >> t;
    int a, b; cin >>a >> b;
    string u; cin >> u;

    if(u == s) a--;
    else b--;

    cout << a << " " << b << endl;
}

Measured memory_bytes: 256
void main() {
	auto ip = readAs!(int[]), N = ip[0], M = ip[1];
	ulong[ulong] a;
	foreach(i; 0..N) {
		auto arr = readAs!(int[]);
		auto K = arr[0];
		auto A = arr[1..$];
		foreach(j; A) a[j]++;
	}
	ulong cnt;
	foreach(i, v; a) {
		if(v == N) cnt++;
	}
	cnt.writeln;
}

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

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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



class Program
{
    const int MOD = 1000000007;
    const int INF = 1 << 30;

    static void Main(string[] args)
    {
        Solve();
    }

    //static long GCD(long x,long y)
    //{
    //    if (y == 0) return x;
    //    return GCD(y, x % y);
    //}

    //static long LCM(long x,long y)
    //{
    //    return x * y / GCD(x, y);
    //}

    //static int keta(int x)
    //{
    //    string s = x.ToString();
    //    return s[s.Length - 1]-'0';
    //}

    static void Solve()
    {
        Scan sc = new Scan();
        write wr = new write();

        var x = sc.intarr;
        int N = x[0];
        int K = x[1];

        if (N % K == 0) wr.wri(0);
        else wr.wri(1);
    
        
    }


}
    




class Scan
{
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
    public char[] chararr => str.ToArray();


}



class write
{
    public void wri<Type>(Type x)
    {
        Console.WriteLine(x);
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
const int INF = 1 << 20;

typedef long long ll;




int main(){
  ll n,m;
  cin >> n >> m;
  ll sum = 0;
  if(n == 1 || m == 1){
    if(n == 1 && m == 1)
      sum = 1;
    else{
      sum = max(n,m) - 2;
    }
  }
  else if(n == 2 || m == 2){
    sum = 0;
  }
  else{
    sum = (n-2) * (m-2);
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256