akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>

int main(){
		int n,m,i,x,y,tmp;
		scanf("%d%d%d%d",&n,&m,&x,&y);
		for(i=0;i<n;i++){
				scanf("%d",&tmp);
				if(x<tmp)x=tmp;
		}
		for(i=0;i<m;i++){
				scanf("%d",&tmp);
				if(tmp<y)y=tmp;
		}
		if(x>=y)puts("War");
		else puts("No War");
		return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const double EPS = 1e-9;
FILE *fp;

void init();
void last();

//#define MYLOCAL

void init() {
#ifdef MYLOCAL
    fp = freopen("/Users/sekiya9311/Documents/comp_programming/comp_programming/in.txt", "r", stdin);
    if (fp == NULL) assert(false);
#endif
    string S, T;
    cin >> S >> T;
    const int L = S.length();
    string s[2];
    fill(s, s + 2, "");
    for (int i = 0; i < L; i++) {
        s[i % 2] += S[i];
    }
    int j[2];
    fill(j, j + 2, 0);
    for (int i = 0; i < 2; i++) {
        for (char c : s[i]) {
            while (j[i] < L && c != T[j[i]]) j[i]++;
            j[i]++;
        }
    }
    puts(j[0] < L || j[1] < L ? "Yes" : "No");
    last();
}

void last() {
#ifdef MYLOCAL
    fclose(fp);
#endif
    exit(0);
}

void solve(int n) {
    
    last();
}

signed main(void) {
    LL n, m, p, a, b, c, x, y, z, q;
    string s;
    bool f = false;
    init();
    while (cin >> n, n) {
        solve(n);
        //return 0;
    }
    last();
}

Measured memory_bytes: 3180
from collections import defaultdict
 
n = int(input())
S = [input() for i in range(n)]
 
counter = [defaultdict(lambda: 0) for i in range(n)]
for i in range(n):
    for c in S[i]:
        counter[i][c] += 1
        
all_counter = defaultdict(lambda: 0)
for s in counter[0]:
    all_counter[s] += counter[0][s]
    
for i in range(n):
    for s in all_counter:
        all_counter[s] = min(counter[i][s], all_counter[s])
 
for s in sorted(all_counter, key=lambda x: x[0]):
    print(s* all_counter[s], end='')    

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



int main() {
  
  string N; 
  int i=0;
  cin >> N;
  
  i = count(N.begin(),N.end(),'7');
  
  if(i != 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  

}


Measured memory_bytes: 3628
S = input()
Q = int(input())
head, tail = "", ""
reverse = False
for _ in range(Q):
    cmd = input().split()
    if cmd[0] == "1":
        reverse = not reverse
    else:
        top = (cmd[1] == "1") ^ reverse
        if top:
            head += cmd[2]
        else:
            tail += cmd[2]
print(tail[::-1] + S[::-1] + head) if reverse else print(head[::-1] + S + tail)

Measured memory_bytes: 4340
n = int(input())
dic = {"AC":0,"WA":0,"TLE":0,"RE":0}

for i in range(n):
    s = input()
    dic[s] += 1


print("AC x {}".format(dic["AC"]))
print("WA x {}".format(dic["WA"]))
print("TLE x {}".format(dic["TLE"]))
print("RE x {}".format(dic["RE"]))


Measured memory_bytes: 9204
import sys
for x in sys.stdin.readlines():
    n=int(x)
    if(n>36):
        n=0
    elif(n>18):
        n=38-n
    else:
        n=n+2

    if(n>11):
        m=n-10
    else:
        m=0
    print (n**3-n-4*(m**3)+4*m)/6

Measured memory_bytes: 5948
<?php

// ??´??° x, y ???????????????x ??\ y ????????° 
// x ??¨ y ????????§??¬?´???°??? y ??¨ x % y ????????§??¬?´???°???????????????
    $nums = trim(fgets(STDIN));
    $array = explode(' ',$nums);
    if ($array[0] != $array[1]) {
        $small_num = $array[0] > $array[1] ? $array[1] : $array[0];
        $big_per_small = ($array[0] > $array[1] ? $array[0] : $array[1]) % $small_num;
        $small_num_cp = $big_per_small;
        while (true) {
            if ((($big_per_small % $small_num_cp) == 0) && (($small_num % $small_num_cp) == 0)) {
                echo $small_num_cp, PHP_EOL;
                break;
            } else $small_num_cp--;
        }
    } else echo $array[0], PHP_EOL;
    

Measured memory_bytes: 15384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    string s, t;
    int a[100005] = {}, b[100005] = {}, q, x, y, u, v;
    cin >> s >> t;
    for (int i = 1; i <= (int)s.length(); i++) a[i] = a[i - 1] + (s[i - 1] == 'A');
    for (int i = 1; i <= (int)t.length(); i++) b[i] = b[i - 1] + (t[i - 1] == 'A');
    cin >> q;
    while (q--) {
        cin >> x >> y >> u >> v;
        int c = a[y] - a[x - 1], d = y - x + 1 - c, e = b[v] - b[u - 1], f = v - u + 1 - e;
        c %= 3; d %= 3; e %= 3; f %= 3;
        if ((c + 3 - d) % 3 == (e + 3 - f) % 3) cout << "YES\n";
        else cout << "NO\n";
    }
    /*
     AB/BA->X->AB/BA
     AABB->AAAAB->AB->X
     A->BB->AAAA->A
     A->BB->BAA->BABB->AAABB->AAAAAB->AAB
     AB->BBB->BBAA->BAAAA->BA
     1,0->0,2->2,1->4,0->1,0
     1,0->0,2->2,1->1,3->3,2->5,1->2,1
     0,0 1,1 2,2
     0,1 2,0 1,2
     1,0 0,2 2,1
     */
}


Measured memory_bytes: 1744
# 8m AC
import math
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, d = LI()
x = LIR(n)
ans = 0
dists = []
for i in range(n - 1):
    for j in range(i + 1, n):
        dis = 0
        for k in range(d):
            dis += (x[i][k] - x[j][k]) ** 2
        for l in range(1, dis + 1):
            if l ** 2 == dis:
                ans += 1
                break
print(ans)


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e5+23;

int a[N];

void solve() {
  int n; scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a+i);
  }
  sort(a, a+n);
  int left = a[0], right = a[0];
  long long sum = 0;
  for (int i = 1, j = n-1, left = a[0], right = a[0];;) {
    sum += abs(a[j]-left);
    left = a[j--];
    if (i > j) break;
    sum += abs(a[j]-right);
    right = a[j--];
    if (i > j) break;
    sum += abs(a[i]-left);
    left = a[i++];
    if (i > j) break;
    sum += abs(a[i]-right);
    right = a[i++];
    if (i > j) break;
  }
  long long ans = sum; sum = 0;
  for (int i = 0, j = n-2, left = a[n-1], right = a[n-1];;) {
    sum += abs(a[i]-left);
    left = a[i++];
    if (i > j) break;
    sum += abs(a[i]-right);
    right = a[i++];
    if (i > j) break;
    sum += abs(a[j]-left);
    left = a[j--];
    if (i > j) break;
    sum += abs(a[j]-right);
    right = a[j--];
    if (i > j) break;
  }
  printf("%lld", max(sum, ans));
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 640
def perl():
        for i in range(4):
                for j in range(3):
                        print "",
                        for k in range (10):
                                print l[i][j][k],
                        print
                if i != 3:
                        print "####################"

n=int(raw_input())
l=[[[0 for k in range(10)]for j in range(3)]for i in range(4)]
for N in range(n):
        e=map(int,raw_input().split())
        b=e[0]-1
        f=e[1]-1
        r=e[2]-1
        l[b][f][r]+=e[3]
perl()

Measured memory_bytes: 4252
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int,int>;

const long long INFLL = 1LL << 60;
const int INFI = 1000000000;


int main(){
    int N,L; cin >> N >> L;
    vector<string> s(N);
    for(int i=0;i<N;i++) cin >> s[i];
    sort(s.begin(), s.end());
    string ans = "";
    for(int i=0;i<N;i++){
        ans += s[i];
    }
    cout << ans << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define BeatMeScanf ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define sz 150010
const int mod=1000000007;

int main(){
    BeatMeScanf;
    string s;
    while(cin>>s){
        int len=s.size(),cnt=0;
        for(int i=0;i<len/2;i++){
            if(s[i]!=s[len-i-1]) cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}


Measured memory_bytes: 384
import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Main {
    static MyReader in = new MyReader();

    public static void main(String[] args) {
        int M = 1000000;
        long n = in.l();
        int ans = 0;
        for (int i = 2; i < M; i++) {
            int c = 0;
            while (n % i == 0) {
                c++;
                n /= i;
            }
            int j = 1;
            for (int s = 0; s + j <= c; s += j++);
            ans += j - 1;
        }

        out.println(n > 1 ? ans + 1 : ans);
    }
}

class MyReader extends BufferedReader {
    char[] cbuf = new char[1024];
    int head = 0;
    int tail = 0;

    MyReader() {
        super(new InputStreamReader(System.in));
    }

    char next() {
        if (head == tail) {
            try {
                tail = super.read(cbuf, 0, cbuf.length);
            } catch (IOException e) {
                e.printStackTrace();
            }
            head = 0;
        }
        return cbuf[head++];
    }

    void back() {
        head--;
    }

    boolean minus() {
        boolean minus;
        while (true) {
            char c = next();
            if (!isDelimiter(c)) {
                if (!(minus = c == '-')) back();
                return minus;
            }
        }
    }

    void skip() {
        while (isDelimiter(next()));
        back();
    }

    char[] s(int N) {
        char[] cbuf = new char[N];
        read(cbuf, 0, N);
        return cbuf;
    }

    public int read(char[] cbuf, int off, int len) {
        skip();
        int i;
        for (i = 0; i < cbuf.length; i++) {
            char c = next();
            if (isDelimiter(c)) {
                break;
            }
            cbuf[i] = c;
        }
        return i;
    }

    boolean isDelimiter(char c) {
        return c == ' ' || c == '\n' || c == '\r';
    }

    int i() {
        boolean minus = minus();
        int n = 0;
        while (true) {
            int k = next() - '0';
            if (k < 0 || 9 < k) break;
            n = 10 * n + k;
        }
        return minus ? -n : n;
    }

    int[] ii(final int N) {
        int[] a = new int[N];
        for (int j = 0; j < a.length; j++) a[j] = i();
        return a;
    }

    long l() {
        boolean minus = minus();
        long n = 0;
        while (true) {
            int k = next() - '0';
            if (k < 0 || 9 < k) break;
            n = 10 * n + k;
        }
        return minus ? -n : n;
    }
}


Measured memory_bytes: 32712
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,m = inm()
x = inl()
y = inl()
ax = 0
k = -n+1
for i in range(n):
    ax = (ax+k*x[i])%R
    k += 2
ay = 0
k = -m+1
for i in range(m):
    ay = (ay+k*y[i])%R
    k += 2
print((ax*ay)%R)


Measured memory_bytes: 83044
n, need = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]

ret = float('inf')
for mask in range(1 << n):
    total = 0
    count = 0
    for bit in range(n):
        if (mask >> bit) & 1:
            num, bonus = a[bit]
            points = (bit + 1) * 100
            total += points * num + bonus
            count += num
    for bit in range(n - 1, -1, -1):
        if (mask >> bit) & 1 == 0:
            num = a[bit][0]
            points = (bit + 1) * 100
            for i in range(num):
                if total >= need:
                    break
                total += points
                count += 1
    if total >= need:
        ret = min(ret, count)

print(ret)

Measured memory_bytes: 44144
#include <bits/stdc++.h>
    
using namespace std;
typedef long long ll;
    
int main()
{
    int A, B, C, K;
    cin >> A >> B >> C >> K;

    for (int i = 0; i < K; i++) {
        if (B <= A && C <= A) {
            A *= 2;
        } else if (A <= B && C <= B) {
            B *= 2;
        } else {
            C *= 2;
        }
    }
    cout << A + B + C;
    
    return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> p(1 << n, INF);
  p.at(0) = 0;
  for (int i = 0; i < m; i++) {
    int a, b, open = 0;
    cin >> a >> b;
    for (int j = 0; j < b; j++) {
      int c;
      cin >> c;
      open += 1 << (c - 1);
    }
    for (int j = 0; j < 1 << n; j++) {
      p.at(j) = min(p.at(j), p.at(j & (~open)) + a);
    }
  }
  if (p.at((1 << n) - 1) == INF) {
    cout << -1 << endl;
  } else {
    cout << p.at((1 << n) - 1) << endl;
  }
}


Measured memory_bytes: 256
# GCD
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x

n=int(input())
l=list(map(int,input().split()))

fl=[]
bl=[]

a=l[0]
for x in l:
  a=gcd(a,x)
  fl.append(a)
fl=[0]+fl

l.reverse()
a=l[0]
for x in l:
  a=gcd(a,x)
  bl.append(a)
bl.reverse()
bl=bl+[0]

l2=[]
for i in range(n):
  if fl[i]==0:
    l2.append(bl[i+1])
  elif bl[i+1]==0:
    l2.append(fl[i])
  else:
    l2.append(gcd(fl[i],bl[i+1]))

print(max(l2))

Measured memory_bytes: 14076
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
typedef long long int ll;
typedef long double ld;
#define PI 3.141592653589793
#define MOD 1000000007
#define ALL(obj) (obj).begin(),(obj).end()
template<class T>inline bool chmax(T& a,T b){if (a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T& a,T b){if (a>b){a=b;return 1;}return 0;}
const ll INF = 1LL << 56;

//四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

struct edge{//グラフに使うヤツ
    ll from,to,cost;
};

typedef vector<vector<edge> > G;
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

int main() {
    ll n;
    cin >> n;
    ll l[n];
    for (ll i=0;i<n;i++)cin >> l[i];
    sort(l,l+n);
    ll ans=0;
    for (ll i=0;i<n-2;i++){
        for (ll j=i+1;j<n-1;j++){
            for (ll k=j+1;k<n;k++){
                if (l[i]!=l[j] and l[j]!=l[k] and l[i]!=l[k]){
                    if (l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[i]+l[k]>l[j])ans++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main(){
    int H,W;
    cin >> H >> W;
    vector<vector<char> > A(H,vector<char> (0));
    for (int i = 0; i < H; i++){
        string gyou;
        cin >> gyou;
        for (int j = 0; j < W; j++){
            A.at(i).push_back(gyou.at(j));
        }
    }
    for (int i = W - 1; i >= 0; i--){
        int retsu_count = 0;
        for (int j = 0; j < H; j++){
            if (A.at(j).at(i) == '.'){
                retsu_count++;
            }
        }
        if (retsu_count == H){
            for (int j = 0; j < H; j++){
                A.at(j).erase(A.at(j).begin() + i);
            }
        }
    }
    
    for (int i = 0; i < H; i++){
        int gyou_count = 0;
        int retsu_su = A.at(i).size();
        for (int j = 0; j < retsu_su; j++){
            if (A.at(i).at(j) == '.'){
                gyou_count++;
            }
        }
        if (gyou_count != retsu_su){
            for (int j = 0; j < retsu_su; j++){
                cout << A.at(i).at(j);
            }
            cout << endl;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(i, n) for(int i=0; i<=n; i++)
#define repr(i, n) for(int i=n; i>0; i--)
#define REPR(i, n) for(int i=n; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
template<class T> void puts(T x) { std::cout << x << std::endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n, m;
vector<vector<int>> g;
bool visited[10];

int dfs(int u) {
    visited[u] = true;

    bool all_visited = true;
    rep(i, n) {
        if (!visited[i]) all_visited = false;
    }

    if (all_visited) return 1;

    int ret = 0;

    for (int v: g[u]) {
        if (!visited[v]) {
            visited[v] = true;
            ret += dfs(v);
            visited[v] = false;
        }
    }

    return ret;
}


int main() {
    cin >> n >> m;
    g.resize(n);
    rep(i, m) {
        int a, b; cin >> a >> b;
        a--; b--;
        g[a].emplace_back(b);
        g[b].emplace_back(a);
    }
    cout << dfs(0) << endl;
}


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

int main() {
  int A, B, C, D, L, R;
  cin >> A >> B >> C >> D;
  L = A + B; R = C + D;
  if (L > R){
    cout << "Left" << endl;
  }
  if (L == R){
    cout << "Balanced" << endl;
  } 
  if (L < R){
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 3544
N = int(input())
*B, = map(int, input().split())
ans = 0
for i in range(N):
    if i == 0:
        ans += B[0]
    elif i != N-1:
        ans += min(B[i-1], B[i])
    else:
        ans += B[i-1]
print(ans)

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main(){
	int A,B;
	cin >> A >> B;
	float A_MIN = A*12.5,A_MAX = (A+1)*12.5;
	int A_min = A*12.5, A_max = (A+1)*12.5;
	float C = A_min,D = A_max;
	if(C < A_MIN) A_min++;
	if(D == A_max) A_max--;
	int B_min = B*10, B_max = (B+1)*10-1;
	if(A_min > B_max || A_max < B_min){
		cout << "-1\n";
	}else{
		cout << max(A_min,B_min) << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double b = sc.nextInt();

		long d = (int)(a/b);
		long r = (int)(a%b);
		double f = a/b;
		//System.out.println(d+" "+r+" "+f);
		System.out.printf("%d %d %.7f%n",d,r,f);
	}
}

Measured memory_bytes: 28260
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  int sum = 0;
  
  for(int i=0;i<N;i++)
     cin >> data.at(i);
  
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      int x = data.at(i)*data.at(j);
      sum += x;
    }
    sum -= data.at(i)*data.at(i);
  }
    cout << sum/2 << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
	string str;
	long long Num;
	cin >> str;
	cin >> Num;

	long long intStrNum = str.size();

	for (long long i = 0;i < min(intStrNum, Num);i++)
	{
		if (str[i] != '1')
		{
			cout << str[i] << endl;
			return 0;
		}
	}

	cout << "1" << endl;
	return 0;


}


Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include <cassert>
#include<string>
#include<vector>
#include <utility>
#include <math.h>
#include<cmath>
#include<map>
#include <limits>
# include <iomanip>
#define INF 1000000009;
using namespace std;
int gcd(int a, int b) {
	while (a % b != 0) {
		int c = 0;
		c = a % b;
		a = b;
		b = c;
	}
	return  b;
}
vector<int>machi[100009];
vector<pair<int, int> > cope;
long long int copyy[100009];
int manji[100009];
int c = 0;
int main() {
	int N = 0, M = 0,a=0,b=0;
	cin >> N >> M;
	c = max(c, N);
	for (int i = 0; i < M; i++) {
		cin >>a >> b;
		manji[a]++;
		copyy[a]++;
		
		machi[a].push_back(b);
		cope.push_back  (make_pair(a, b));
	}
	//cout << "OK" << endl;
	for (int i = 1; i <= c; i++) {
		if (machi[i].size()>1) {
			sort(machi[i].begin(), machi[i].end());
		}
	}
	//cout << "OK" << endl;
	
	for (long long int i = 0; i < M; i++) {
    auto ans = lower_bound(machi[cope[i].first].begin(), machi[cope[i].first].end(), cope[i].second);
		cout << setfill('0') << right << setw(6) << cope[i].first;
		cout << setfill('0') << right << setw(6) << ans-machi[cope[i].first].begin()+1 << endl;
					
			
		
	}
	return 0;
}

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

int main() {
    int x;
    cin >> x;
    vector<int> bekis;
    int beki = 2;
    bekis.push_back(1);
    while (true) {
        int tmp = beki;
        while (true) {
            tmp *= beki;
            if (tmp < 1100) {
                bekis.push_back(tmp);
            } else {
                break;
            }
        }
        beki++;
        if (beki > 500) break;
    }
    sort(bekis.begin(), bekis.end());
    int ans = -1;
    for (int i = 0; i < bekis.size(); i++) {
        if (bekis[i + 1] > x) {
            ans = bekis[i];
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,m;
	cin>>n>>m;
	if(n==1&&m==1)
	cout<<1;
	else
	if(n==1)
	cout<<m-2;
	else
	if(m==1)
	cout<<n-2;
	else
	cout<<(n-2)*(m-2);
	return 0;
}

Measured memory_bytes: 256
/**
 * @author karayuu
 */
fun main(args: Array<String>) {
  var count = 0
  val (k, s) = readLine()!!.split(" ").map { it.toInt() }
  for (x in 0..k) {
    for (y in 0..k) {
      val _z = s - x - y
      if (_z in 0..k) {
        count++
      }
    }
  }

  println(count)
}

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

namespace ABC163_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string H = Console.ReadLine();
            int R = int.Parse(H);
            
            double result = (R) * 2 * Math.PI;

            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 27604
#include <iostream>

using namespace std;

int main(){
	double w;
    while(cin >> w){
    	if(w > 91.00){
    		cout << "heavy" << endl;
    	}else if(w > 81.00){
    		cout << "light heavy" << endl;
    	}else if(w > 75.00){
    		cout << "middle" << endl;
    	}else if(w > 69.00){
    		cout << "light middle" << endl;
    	}else if(w > 64.00){
    		cout << "welter" << endl;
    	}else if(w > 60.00){
    		cout << "light welter" << endl;
    	}else if(w > 57.00){
    		cout << "light" << endl;
    	}else if(w > 54.00){
    		cout << "feather" << endl;
    	}else if(w > 51.00){
    		cout << "bantam" << endl;
    	}else if(w > 48.00){
    		cout << "fly" << endl;
    	}else{
    		cout << "light fly" << endl;
    	}
    }
    return 0;
}

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

int main() {
  long N, x = 0, a = 0, b = 0, flag = 0;
  string ans = "YES";
  cin >> N;
  
  for (int i = 1; i <= N; i++) {
    cin >> x;
    if (i != x && flag == 2) break;
    if (i != x && flag == 1) {
      if (x == a && i == b) ans = "YES";
      flag = 2;
    }
        if (i != x && flag == 0) {
      a = i;
      b = x;
      flag = 1;
      ans = "NO";
    }
  }
  
  cout << ans << endl;
}

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

typedef long long ll;
typedef unsigned long long int llu;
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define mem(a, v) memset(a, v, sizeof(a))
#define PI acos(-1)
#define S(a) scanf("%d",&a)
#define SL(a) scanf("%lld",&a)
#define S2(a, b) scanf("%d%d",&a,&b)
#define nl printf("\n")
#define deb(x) cout<<#x<<" : "<<x<<endl;
#define deb2(x, y) cout<<#x<<" : "<<x<<" | "<<#y<<" : "<<y<<endl;
#define deb3(x, y, z) cout<<#x<<" : "<<x<<" | "<<#y<<" : "<<y<<" | "<<#z<<" : "<<z<<endl;
#define debv(x) {cout<<#x<<" : "<<endl; for(int ii =0; ii < x.size(); ii++) cout<<x[ii]<<" "; cout<<endl; }
#define debarr(x, xs) {cout<<#x<<" : "<<endl; for(int ii =0; ii < xs; ii++) cout<<x[ii]<<" "; cout<<endl; }
//auto T=clock(); 
//cout<<double(clock()-T)/CLOCKS_PER_SEC<<'\n';
//cout << fixed << setprecision(10) << f(0, 0, 0) << "\n";
const ll mod = 1000000007LL;
const int lmt = 1000005;

ll a[lmt], diff[lmt];

int main(){
    int n;
    S(n);
    ll sum = 0, sub = n;
    sub = sub*(sub+1);
    sub /= 2LL;
    for(int i = 0; i < n; i++) {
        SL(a[i]);
        sum += a[i];
    }
    if(sum % sub != 0) {
        printf("NO");
        return 0;
    }
    ll k = sum/sub;
    for(int i = 0; i < n; i++) {
        diff[i] = a[(i+1) % n] - a[i];        
        diff[i] -= k;
    }
    ll cnt = 0;
    for(int i = 0; i < n; i++) {
        if(diff[i] > 0) {
            printf("NO");
            return 0;
        }
        else if(diff[i] < 0) {
            if(abs(diff[i]) % n != 0) {
                printf("NO");
                return 0;
            }
            cnt += abs(diff[i])/n;
        }
    }
    // if(cnt != k)
    //     printf("NO\n");
    // else
        printf("YES");
    return 0;
}

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

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

const int mx=1e6+11;
const double PI = acos(-1);
#define MOD 1000000007


#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define sa(v) sort(v.begin(),v.end())
#define sd(v) sort(v.begin(),v.end(),greater<>())
#define rev(s) reverse(s.begin(),s.end())
#define tt int t; cin>>t; while(t--)
#define lo(i,a,b) for(ll i=a;i<b;i++)
#define be(a) (a).begin(),(a).end()
#define rbe(a) (a).rbegin(),(a).rend()

#define sqr(a) ((a) * (a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define mem(a,b) memset(a,b,sizeof(a))

#define yes cout<<"YES"<<nl;
#define no cout<<"NO"<<nl;

#define su ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define frac cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree< long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update > ordered_set;
void erase ( ordered_set &s, long long val )
{
    auto it = s.upper_bound(val);

    if ( it == s.begin() && val == *s.begin() ) s.erase ( s.upper_bound(val) );
    else s.erase ( s.upper_bound(val) );
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}


int main()
{
   su;
   int n,k;
   cin>>n>>k;
   ll a[n],sum=0;
   lo(i,0,n)
   {
     cin>>a[i];
   }
   sort(a,a+n);
   lo(i,0,n-k)
   {
     sum+=a[i];
   }
   cout<<sum<<nl;
   return 0;
}


Measured memory_bytes: 5172
#include<stdio.h>
#include<stdlib.h>
int ROW_INDEX = 1;
//[min_range, max_range]からn_ints個の整数の組をすべてとりだしcomb[組][整数]に格納する
void AllCombs_ints(int min_range, int max_range, int depth, int n_ints, int **comb){
	if(depth > 0){
		for(int x = min_range; x <= max_range; x++){
			//combの0行目を一時的な格納場所として使っている。これも気持ち悪い。
			comb[0][depth-1] = x;
			if(depth == 1){
				for(int num_i = 1; num_i <= n_ints; num_i++)
					comb[ROW_INDEX][num_i-1] = comb[0][n_ints-num_i];
				ROW_INDEX++;
			}
			AllCombs_ints(x + 1, max_range, depth - 1, n_ints, comb);
		}
	}
	if(depth == n_ints)
		ROW_INDEX = 1;
}
int Find_Rightmost_Col(int threshold, int from, int n_rows, int n_slices, int n_cols, 
						int slices[n_slices], int mat[n_rows+1][n_cols+1]){
	int current_col = from;
	int value_cell[n_slices+1];
	for(int cell_i = 0; cell_i <= n_slices; cell_i++)
		value_cell[cell_i] = 0;
	while(current_col <= n_cols){
		for(int slice_i = 0; slice_i <= n_slices; slice_i++){
			for(int row_i = (slice_i == 0 ? 1 : slices[slice_i-1] + 1); 
				row_i <= (slice_i == n_slices ? n_rows : slices[slice_i]); row_i++){
				value_cell[slice_i] += mat[row_i][current_col];
			}
			if(value_cell[slice_i] > threshold)
				return current_col - 1;
		}
		current_col++;
	}
	return current_col - 1;
}
int Factorial(int upto){
	if(upto == 0)
		return 1;
	return upto * Factorial(upto-1);
}
int main(){
	int n_rows, n_cols, nmax_white;
	scanf("%d %d %d", &n_rows, &n_cols, &nmax_white);
	int mat_choco[n_rows+1][n_cols+1];
	for(int row_i = 1; row_i <= n_rows; row_i++){
		char str[n_cols];
		scanf("%s", str);
		for(int col_i = 1; col_i <= n_cols; col_i++){
			if(str[col_i-1] == '0')
				mat_choco[row_i][col_i] = 0;
			else
				mat_choco[row_i][col_i] = 1;
		}
	}
	int ans = n_rows * n_cols;
	for(int n_slices = 0; n_slices < n_rows; n_slices++){
		int n_combs = Factorial(n_rows-1) / Factorial(n_slices) / Factorial(n_rows-1-n_slices);
		int **pt_slice;
		pt_slice = (int **) malloc(sizeof(int *) * (n_combs+1));
		for(int pt_i = 0; pt_i <= n_combs; pt_i++)
			pt_slice[pt_i] = (int *) malloc(sizeof(int) * (n_slices>0 ? n_slices : 1));
		AllCombs_ints(1, n_rows-1, n_slices, n_slices, pt_slice);
		for(int comb_i = 1; comb_i <= n_combs; comb_i++){
			int ans_temp = n_slices;
			int current_col = 1;
			while(current_col <= n_cols){
				int col_temp = current_col;
				current_col = Find_Rightmost_Col(nmax_white, current_col, n_rows, n_slices, n_cols, pt_slice[comb_i], mat_choco);
				if(col_temp > current_col){
					ans_temp = n_rows * n_cols;
					break;
				}
				ans_temp++;
				current_col++;
			}
			if(--ans_temp < ans)
				ans = ans_temp;
		}
		for(int pt_i = 0; pt_i <= n_combs; pt_i++)
			free(pt_slice[pt_i]);
		free(pt_slice);
	}
	printf("%d", ans);
	return 0;
}

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

namespace ABC137A
{
	class Program
	{
		static void Main(string[] args)
		{
			int A, B;
			var word = Console.ReadLine().Split(' ');
			A = int.Parse(word[0]);
			B = int.Parse(word[1]);

			if (A+B>=A-B&& A + B >= A * B)
				Console.Write(A+B);
			else if(A-B>=A+B&&A-B>=A*B)
				Console.WriteLine(A-B);
			else if(A*B>=A+B&&A*B>=A-B)
				Console.WriteLine(A*B);
			Console.ReadKey();
		}
	}
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i=0;i<(int)(n);++i)
template <typename T> ll gcd(T a, T b) {return b?gcd(b, a%b):a;}
template <typename T> ll lcm(T a, T b) {return a * b / gcd(a, b);};
template <typename T> inline void chmin(T &a, const T& b){if(a>b)a=b;}
template <typename T> inline void chmax(T &a, const T& b){if(a<b)a=b;}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll ans = 0, b = 0;
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'B') ++b;
    else ans += b;
  }
  cout << ans << '\n';
}


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

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

    if (2 * n <= m) {
        int64_t ans = n;
        m -= 2 * n;
        ans += m / 4;
        cout << ans << endl;
    } else {
        cout << m / 2 << endl;
    }

    return 0;
}

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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

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

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

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int D; // D: 365
  cin >> D;
  vector< int > C(26);
  cin >> C;
  auto S = make_v< int >(D, 26);
  cin >> S;

  vector< int > T(D);
  cin >> T;
  for(auto &p : T) --p;

  int ret = 0;
  vector< int > last(26, -1);
  for(int i = 0; i < D; i++) {
    last[T[i]] = i;
    ret += S[i][T[i]];
    for(int j = 0; j < 26; j++) ret -= C[j] * (i - last[j]);
    cout << ret << "\n";
  }
}



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

int main(){
    int g[4][4] = {};
    for(int i = 0; i < 3; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a][b] = g[b][a] = 1;
    }
    for(int i = 0; i < 4; i++){
        for(int j = 0; j < 4; j++){
            for(int k = 0; k < 4; k++){
                for(int l = 0; l < 4; l++){
                    if(i == j || i == k || i == l || j == k || j == l || k == l) continue;
                    if(g[i][j] && g[j][k] && g[k][l]){
                        cout << "YES" << endl;
                        return 0;
                    }
                }
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}

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

int main()
{

    char original[100];
    scanf("%s", original);
    int ascii[130];

    for (int i = 0; i < 130;i++){
        ascii[i] = 0;
    }

        int len = strlen(original);

    for (int i = 0; i < len; i++)
    {
        ascii[(int)original[i]]++;

    }
    int yes = 1;
    for (int i = 0; i < 130; i++)
    {
        if(ascii[i]%2!=0){
            yes = 0;
            break;
        }
    }
    if(yes==1)
        printf("Yes");
    else
    {
        printf("No");
    }

    printf("\n");
}

Measured memory_bytes: 128
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;

const string t = "FESTIVAL";

const int M = 10;
ll dp[M][8];

int main() {
  ll n;
  cin >> n;
  dp[0][0] = 1;
  rrep(i,M-1) {
    rep(j,8) dp[i][j] = dp[i-1][j];
    rep(j,7) {
      dp[i][j+1] += dp[i][j]*(1<<(i-1));
    }
    // cout<<i<<" "<<dp[i][7]<<endl;
  }
  string ans;
  drep(i,M) if (i) {
    ll s = dp[i][7];
    while (n >= s) {
      ans += t[7];
      n -= s;
    }
    drep(j,7)rep(k,(1<<(i-1))) ans += t[j];
  }
  reverse(rng(ans));
  cout<<ans<<endl;
  // cout<<sz(ans)<<endl;
  return 0;
}































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

int main() {
  int N, D,ans;
  cin >> D >> N;
  
  if (N == 100) {
    ans = pow(100, D) * 101;
  } else {
    ans = pow(100, D) * N;
  }
  cout << ans << endl;
  
  return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <bits/stdc++.h>
#include <iomanip>
#include <numeric>
#include <utility>
#include <map>
#include <algorithm>
typedef long long ll;
using namespace std;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b, c;
    cin >> a >> b >> c;
    if (c - a - b < 0)
        cout << "No\n";
    else if (4 * a * b < (c - a - b) * (c - a - b))
        cout << "Yes\n";
    else
        cout << "No\n";
}


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>;
const int N = 200;

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

    int n;
    cin>>n;

    int i = 1;

    while(1)
    {
        if(i < n)
        {
            i *= 2;
        }
        else if (i == n) 
        {
            break;
        }
        else
        {
            i /= 2;
            break;
        }
        
    }
    cout<<i<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<class T> bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }

int main() {
    long long a, b, n;
    cin >> a >> b >> n;
    
    auto f = [&] (long long x) -> long long {
        long long ret = a * x / b;
        ret -= a * (x / b);
        return ret;
    };
    
    cout << f(min(b - 1, n)) << '\n';
    
    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
//#include<tr1/unordered_map>
#pragma GCC optimize ("Ofast")
#define ll long long
#define pll pair<long long,long long>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define forn(i, n) for(int i=0; i<int(n); i++)
#define Forn(i, n) for(int i=1; i<=int(n); i++)

using namespace std;

int main()
{
    cin.tie(0); ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    cout << n*n*n << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e15+9
#define MOD 1000000007
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

ll a[3];

int main(){
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	REP(i, 3){
		if (a[i] % 2 == 0){
			cout << 0 << endl;
			return 0;
		}
		if (i == 2){
			cout << a[0] * a[1] << endl;
			return 0;
		}
	}

}

Measured memory_bytes: 256
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))

diff = float("INF")
min_index = 0
index = 1
for h in hs:
    temp_diff = abs(a - (t - h*0.006))
    if temp_diff < diff:
        diff = temp_diff
        min_index = index
    index += 1
print(min_index)


Measured memory_bytes: 38256
#include<iostream>
#include<cstring>
using namespace std ;
int n ;
const int N = 1e5 + 10 ;
const int M = 1 << 17 ;
int s[N] , S , ans , f[M] , inf , sum[20] ;
 
inline int dfs(int S) {
  if(! S) return 0 ;
  if(f[S] < inf) return f[S] ;
  for(register int i = 0 ; i < 16 ; i ++)
    if(S & (1 << i)) {
      for(register int j = 0 ; j < 16 ; j ++)
        if(i != j && (S & (1 << j))) {
          int p = i ^ j ;
          int x = S ^ (1 << i) ^ (1 << j) ^ (1 << p) ;
          if(S & (1 << p)) { f[S] = min(f[S] , dfs(x) + 2) ; }
          else { f[S] = min(f[S] , dfs(x) + 1) ; }
        }
    }
    return f[S] ;
}
signed main(){
  ios :: sync_with_stdio(false) ;
  cin.tie(0) ;
  cout.tie(0) ;
  cin >> n ;
  for(register int i = 1 ; i < n ; i ++) { int a , b , c ; cin >> a >> b >> c ; s[a] ^= c ; s[b] ^= c ; }
  for(register int i = 0 ; i < n ; i ++) { sum[s[i]] ++ ; }
  for(register int i = 1 ; i < 16 ; i ++)
    ans += (sum[i] >> 1) , S += (1 << i) * (sum[i] & 1) ;
  memset(f , 0x7f , sizeof(f)) ; inf = f[0] ;
  cout << ans + dfs(S) << '\n' ;
}
/*
5
0 1 1
0 2 3
0 3 6
3 4 4
*/

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

int main(){
  int h, w, n;
  cin >> h >> w >> n;
  vector<pair<int, int>>xy;
  vector<int>dl(h+w, 10000000); //x-yがキー、禁止xの下限
  for(int i=0; i<n; i++){
    int x, y;
    cin >> x >> y;
    if(x>=y)xy.push_back(make_pair(x, y));
  }
  sort(xy.begin(), xy.end());
  int nowl=0; //今の所OKなx-yの下限
  for(int i=0; i<xy.size(); i++){
    if(xy[i].first-xy[i].second==nowl){
      dl[nowl]=xy[i].first;
      nowl++;
    }
  }
  int ret=0;
  for(pair<int, int>p: xy){
    int x=p.first, y=p.second;
    if(x-y>0 && dl[x-y-1]>=x){
      ret=x-1;
      break;
    }
  }
  if(ret==0)ret=h;
  cout << ret;
  return 0;
}


Measured memory_bytes: 3956
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 1000000007;
const ll INF = 1000000000000000;
#define all(v) v.begin(), v.end()


int main(){
  ll N,K,k=0,m=0,ans=1;
  cin >> N >> K;
  vector<ll> A(N);
  rep(i,N){
    cin >> A.at(i);
    if(A.at(i)<0) k++;
    if(A.at(i)==0) m++;
  }
  if(K+m>N){
    cout << 0 << endl;
    return 0;
  }else if(K==N){
    rep(i,N){
      if(A.at(i)<0) ans*=(MOD+A.at(i));
      else ans*=A.at(i);
      ans%=MOD;
    }
    cout << ans << endl;
    return 0;
  }else if(k+m==N&&K%2==1){
    sort(all(A));
    reverse(all(A));
    rep(i,K){
      ans*=(MOD+A.at(i));
      ans%=MOD;
    }
    cout << ans << endl;
    return 0;
  }else{
    vector<ll> B,C;
    rep(i,N){
      if(A.at(i)>=0) B.push_back(A.at(i));
      else C.push_back(A.at(i));
    }
    if(B.size()!=0){
      sort(all(B));
      reverse(all(B));
    }
    if(C.size()!=0){
      sort(all(C));
    }
    if(K%2==1){
      ans=B.at(0);
      ll t=1,s=0;
      rep(i,K/2){
        if(t>=(ll)B.size()-1){
          ans*=(C.at(s)*C.at(s+1))%MOD;
          s+=2;
          ans%=MOD;
        }else if(s>=(ll)C.size()-1){
          ans*=(B.at(t)*B.at(t+1))%MOD;
          t+=2;
          ans%=MOD;
        }else{
          if(B.at(t)*B.at(t+1)>C.at(s)*C.at(s+1)){
            ans*=(B.at(t)*B.at(t+1))%MOD;
            t+=2;
            ans%=MOD;
          }else{
            ans*=(C.at(s)*C.at(s+1))%MOD;
            s+=2;
            ans%=MOD;
          }
        }
      }
    }else{
      ans=1;
      ll t=0,s=0;
      rep(i,K/2){
        if(t>=(ll)B.size()-1){
          ans*=(C.at(s)*C.at(s+1))%MOD;
          s+=2;
          ans%=MOD;
        }else if(s>=(ll)C.size()-1){
          ans*=(B.at(t)*B.at(t+1))%MOD;
          t+=2;
          ans%=MOD;
        }else{
          if(B.at(t)*B.at(t+1)>C.at(s)*C.at(s+1)){
            ans*=(B.at(t)*B.at(t+1))%MOD;
            t+=2;
            ans%=MOD;
          }else{
            ans*=(C.at(s)*C.at(s+1))%MOD;
            s+=2;
            ans%=MOD;
          }
        }
      }
      
    }
    cout << ans << endl;
    return 0;
  }
      
}

Measured memory_bytes: 6996