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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

//実行部
void Main()
{
  str s; cin >> s;
  vll a(s.size() + 1, 0);
  rep(i, s.size())
  {
    if(s[i] == '<')
    {
      a[i + 1] = a[i] + 1;
    }
  }
  rrep(i, s.size())
  {
    if(s[i] == '>')
    {
      a[i] = max(a[i + 1] + 1, a[i]);
    }
  }
  ll ans = 0;
  rep(i, a.size())
  {
    ans += a[i];
  }
  fin(ans);
  return;
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

/*
//test時
  g++ test.cpp -o test;./test
*/


Measured memory_bytes: 4764
[h,w] = [int(i) for i in input().split()]
ls = [["."] * (w+2)]
for i in range(h):
    tmp = input()
    tmp_ls = ["."]
    for j in range(w):
        tmp_ls.append(tmp[j])
    tmp_ls.append(".")
    ls.append(tmp_ls)
ls.append(["."] * (w+2))
ans = "Yes"

for i in range(1,h+1):
    for j in range(1,w+1):
        flag = 0
        if ls[i][j] == "#":
            flag = flag or (ls[i-1][j] == "#")
            flag = flag or (ls[i+1][j] == "#")
            flag = flag or (ls[i][j-1] == "#")
            flag = flag or (ls[i][j+1] == "#")
            if flag == 0:
                ans = "No"
print(ans)


Measured memory_bytes: 66912
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    cout << (n-a+1) * (n - b +1) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
   public static void main(String[] a){
      Scanner scn = new Scanner(System.in);
      int d = scn.nextInt();
      int b = scn.nextInt();
      int c = scn.nextInt();
      int z;
if(b>c){
z=b;
b=c;
c=z;
}
if(c>d){
z=c;
c=d;
d=z;
}if(b>c){
z=b;
b=c;
c=z;
}
System.out.println(b+" "+c+" "+d);
}
}

Measured memory_bytes: 26284
#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;
long long arr[37][2];
int len;
int ch[37];

int main()
{
    long long N;
    cin>>N;
    if(N==0){
        cout<<0;
        return 0;
    }

    arr[0][0]=1;
    arr[0][1]=0;
    for(int i=1;i<=36;i++){
        long long temp=pow(-2,i);
        if(temp>0){
            arr[i][0]=arr[i-1][0]+temp;
            arr[i][1]=arr[i-1][1];
        }
        else{
            arr[i][0]=arr[i-1][0];
            arr[i][1]=arr[i-1][1]+temp;
        }
    }
    int i;
    for(i=0;i<=36;i++){
        if(arr[i][1]<=N&&N<=arr[i][0])break;
    }
    ch[i]=1;
    len=i;

    N=N-pow(-2,i);
    i--;

    while(!(0<=N&&N<=1)){
        if(arr[i][1]<=N&&N<=arr[i][0]) i--;
        else{
            i=i+1;
            ch[i]=1;
            N=N-pow(-2,i);
        }
    }
    if(N==1)ch[0]=1;


    for(int k=len;k>=0;k--){
        cout<<ch[k];
    }

}


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 n, k;
    cin >> n >> k;

    if (2 * n < k) {
        cout << 0 << endl;
        return 0;
    }

    ll ans = 0;
    int ks = n / k;
    ans += (ll) ks * ks * ks;
    if (k % 2 == 0) {
        int rs = (n - k / 2) / k + 1;
        ans += (ll) rs * rs * rs;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

int V, E;
bool visited[105];
vector<vector<int> > g;
vector<int> ls;

void dfs(int i){
    visited[i] = true;
    for(auto to : g[i]){
        if(visited[to]>0)continue;
        dfs(to);
    } 
    ls.push_back(i);
}

int main() {
    cin >> V >> E;
    g.resize(V+1);
    REP(i,E){
        int s, t;
        cin >> s >> t;
        g[s].push_back(t);
    }
    for(int i=1;i<=V;i++){
        if(visited[i]>0)continue;
        dfs(i);
    }
    reverse(ALL(ls));
    for(auto i : ls){
        cout << i << endl;
    }
    return 0;
}


Measured memory_bytes: 3164
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int AMAX = 100000;
	public static void main(String[] args) {
		int i=0,j=0,k=0;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int cnt=0;
		int cnt2=0;
		for(i=1;i<=n;i++) {
			if(parseInt(sc.next())==i) {
				cnt++;
			} else {
				cnt2+=(int)ceil((double)cnt/2);
				cnt=0;
			}
		}
		sc.close();
		cnt2+=(int)ceil((double)cnt/2);
		out.println(cnt2);
	}
}


Measured memory_bytes: 46300
/*
 * ID: adityaa
 * LANG: C++
 */
#include <bits/stdc++.h>
using namespace std;

#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mem(x, y) memset(x, y, sizeof x);
#define fi first
#define se second
#define pb push_back
#define pii pair<int , int>
#define asdfg y1
#define int long long
#define double long double
#define endl '\n'
#define PI 3.14159265359

/*-----------------------------------------------------------------------*/

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

/*-----------------------------------------------------------------------*/

// check base cases n = 0 , n = 1
// max / min questions - check for binary search
const int maxn = (int) 1e6 + 6;
const double EPS = 1e-9;
const int INF = (int)1e18 + 18;
const int mod = (int) 998244353;
int n , m , used[maxn];
int dp[maxn];
vector<int> g[maxn] , order;

void dfs(int u){
    used[u] = 1;
    for(int v : g[u]){
        if(used[v] == 0){
            dfs(v);
        }
    }
    order.push_back(u);
}

signed main() {
    
    fio;
    cin >> n >> m;
    for(int i = 0; i < m; i++){
        int u , v; cin >> u >> v;
        g[u].push_back(v);
    }
    
    for(int i = 1; i <= n; i++){
        if(used[i] == 0){
            dfs(i);
        }
    }
    
    reverse(order.begin(), order.end());
    for(int i = 0; i < n; i++){
        for(int to : g[order[i]]){
            dp[to] = max(dp[to] , dp[order[i]] + 1);
        }
    }
    
    int ans = 0;
    for(int i = 1; i <= n; i++){
        ans = max(ans , dp[i]);
    }
    
    cout << ans << endl;
    
    return 0;
    
}


Measured memory_bytes: 33272
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
	is >> p.first >> p.second;
	return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
	os << p.first << " " << p.second;
	return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}
/*
typedef __int128_t Int;
std::ostream &operator<<(std::ostream &dest, __int128_t value) {
std::ostream::sentry s(dest);
  if (s) {
	__uint128_t tmp = value < 0 ? -value : value;
	char buffer[128];
	char *d = std::end(buffer);
	do {
	  --d;
	  *d = "0123456789"[tmp % 10];
	  tmp /= 10;
	} while (tmp != 0);
	if (value < 0) {
	  --d;
	  *d = '-';
	}
	int len = std::end(buffer) - d;
	if (dest.rdbuf()->sputn(d, len) != len) {
	  dest.setstate(std::ios_base::badbit);
	}
  }
  return dest;
}

__int128 parse(string &s) {
  __int128 ret = 0;
  for (int i = 0; i < s.length(); i++)
	if ('0' <= s[i] && s[i] <= '9')
	  ret = 10 * ret + s[i] - '0';
  return ret;
}
*/

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
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 (a > b) {
		a = b;
		return true;
	}
	return false;
}

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int H, W; cin >> H >> W;
	int h, w; cin >> h >> w;
	if (H%h == 0 and W%w == 0) {
		Yes(0);
	}
	else {
		Yes(1);
		bool f = 0;
		if (W%w == 0) {
			swap(H, W);
			swap(h, w);
			f = 1;
		}
		vector<int>s(W + 1), a;
		rep(i, 1, W + 1) {
			if (i < w) {
				s[i] = 555;
			}
			else {
				s[i] = s[i - w] - 1;
			}
			a.eb(s[i]-s[i-1]);
		}
		if (not f) {
			rep(i, 0, H) {
				rep(j, 0, W) {
					cout << a[j] << (j == W - 1 ? '\n' : ' ');
				}
			}
		}
		else {
			rep(i, 0, W) {
				rep(j, 0, H) {
					cout << a[i] << (j == W - 1 ? '\n' : ' ');
				}
			}
		}

	}

	return 0;
}


Measured memory_bytes: 1408
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得
def ST(): return sys.stdin.readline().rstrip()
def LST(): return sys.stdin.readline().rstrip().split()
def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)

N,M = MI()
to = [[] for _ in range(N+1)]
for _ in range(M):
    x,y = MI()
    to[x].append(y)
dp = [-1]*(N+1)
def rec(i):
    if dp[i] != -1:
        return dp[i]
    ret = 0
    if to[i]:
        for v in to[i]:
            ret = max(ret,rec(v)+1)
    dp[i] = ret
    return ret

for i in range(1,N+1):
    rec(i)
ans = 0
for i in range(1,N+1):
    ans = max(ans, dp[i])
print(ans)


Measured memory_bytes: 165944
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Stack;
import java.util.StringTokenizer;

public class Main {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static StringTokenizer st;

    private static int readInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return Integer.parseInt(st.nextToken());
    }

    private static long readLong() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return Long.parseLong(st.nextToken());
    }

    public static void main(String[] args) throws IOException {
        int N = readInt();

        final long MOD = 1_000_000_007;
        final long TWO_INVERSE = 500_000_004;
        long sum = 0;
        long res = 0;
        for (int i = 0; i < N; i++) {
            long a = readLong();
            sum += a;
            res -= a * a % MOD;
        }

        sum %= MOD;
        res = (res + sum * sum % MOD) % MOD * TWO_INVERSE % MOD;
        if (res < 0) res += MOD;
        System.out.println(res);
    }
}


Measured memory_bytes: 54540
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
struct UnionFind {
	vector<int> par;
	UnionFind(int x) : par(x, -1) {}
	void init(int x) { par.assign(x, -1); }
	int root(int x) {
		if (par[x] <= -1) return x;
		else return root(par[x]);
	}
	bool issame(int x, int y) {
		return root(x) == root(y);
	}
	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}
	int size(int x) {
		return -par[root(x)];
	}
};
int ans[100100];
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M, K;
    cin >> N >> M >> K;
    UnionFind UF(N), UF2(N);
    int fs[100010], ft[100010];
    int bs[100010], bt[100010];
    rep(i, M) {
        cin >> fs[i] >> ft[i];
        fs[i]--; ft[i]--;
        UF.merge(fs[i], ft[i]);
    }
    rep(i, K) {
        cin >> bs[i] >> bt[i];
        bs[i]--; bt[i]--;
        UF2.merge(bs[i], bt[i]);
    }
    rep(i, N) {
        ans[i] = UF.size(i);
    }
    rep(i, M) {
        ans[fs[i]]--;
        ans[ft[i]]--;
    }
    rep(i, K) {
        if (UF.issame(bs[i], bt[i])) {
            ans[bs[i]]--;
            ans[bt[i]]--;
        }
    }
    rep(i, N) {
        if (i != 0) cout << " ";
        cout << max(0, ans[i] - 1);
    }

    return 0;
}


Measured memory_bytes: 3584
//  Author : Amit Kumar 

#include <iostream>
#include <algorithm> 
#include <string> 
#include <sstream>
#include <fstream>
#include <iomanip> 
#include <chrono> 
#include <numeric> 
#include <utility>
#include <functional>

#include <bitset>
#include <tuple>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <deque>
#include <list>


#include <climits>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cstdio>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace std::chrono;
//  using namespace placeholders;
using namespace __gnu_pbds;
template<typename TypeInfo>
using new_set = tree< 
/* ob.order_of_key(element) -> number of element strictly less than element
 * *ob.find_by_order(n) ->  nth element in increasing order
 */
         TypeInfo ,
         null_type ,
         less<TypeInfo> ,
         rb_tree_tag ,
         tree_order_statistics_node_update 
 > ;

void show_me() { cerr << endl; }
 
template <typename HEAD, typename... TAIL>
void show_me(HEAD H, TAIL... T) {
  cerr << " " << (H);
  show_me(T...);
}
 
#ifdef HELL_JUDGE
#define show(...) cerr << "[" << #__VA_ARGS__ << "]:", show_me(__VA_ARGS__)
#else
#define show(...) 0
#endif
 
template<typename A, typename B>
ostream& operator<<(ostream&out, const pair<A, B>&p){
    out << p.first << ' ' << p.second ;
    return out;
}

template<typename A, typename B>
istream& operator>>(istream&in, pair<A, B>&p){
    in >> p.first >> p.second ;
    return in;
}

template<typename A> 
istream& operator>>(istream&in, vector<A>&vec){
    for(auto&itr:vec){
        in >> itr;
    }
    return in;
}

template<typename A>
ostream& operator<<(ostream&out,const vector<A>&vec){
    for(auto&itr:vec){
        out << itr <<' '; // VVV 
    }
    return out;
}

const int MAXM = (int)1e5+100;
const int MAXN = (int)1e5+100;
const int MOD  = (int)1e9+7;




signed main(void){
#ifdef HELL_JUDGE
    freopen("input","r",stdin);
    freopen("output","w",stdout);
    freopen("error","w",stderr);
#endif 
    ios::sync_with_stdio(false); // FLUSH THE STREAM IF USING puts / printf / scanf/
    cin.tie(nullptr);            //
    cout.tie(nullptr);           //
#ifdef HELL_JUDGE
    auto INITIAL_TIME = high_resolution_clock::now();
#endif 

    int64_t n; cin >> n; 
    string ans{};
    while(n){
        int64_t m = n%26ll;
        --m; 
        m = (m+26+26)%26;
        ans+=char(m+'a');
        n-=!(n&1);
        n = (n/26);
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';

#ifdef HELL_JUDGE
    auto FINAL_TIME = high_resolution_clock::now();
    cout << "Time : "
         << duration_cast<milliseconds>(FINAL_TIME-INITIAL_TIME).count() 
         << " ms" << '\n'; 
#endif 
    return 0;
}


Measured memory_bytes: 3652
use std::collections::BTreeSet;

fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_owned()
}

fn reads<T>() -> Vec<T>
where
    T: std::str::FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    read_line()
        .split_whitespace()
        .map(|w| w.parse().unwrap())
        .collect()
}

fn main() {
    let n: usize = reads()[0];

    let a: Vec<u64> = reads();
    let mut b: Vec<u64> = reads();

    let mut ans = 0;

    for p in 0..29 {
        let t = 1 << p;
        let t2 = t * 2;
        let t2m = t2 - 1;

        b.sort_by_key(|x| x & t2m);

        let mut cnt = 0;
        for i in 0..n {
            let ai = a[i] & t2m;
            let pos10 = b.binary_search_by_key(&(t * 2 * 2 - 1), |e| (ai + (e & t2m)) * 2)
                .err()
                .unwrap();
            let pos01 = &b[0..pos10]
                .binary_search_by_key(&(t * 1 * 2 - 1), |e| (ai + (e & t2m)) * 2)
                .err()
                .unwrap();
            let pos11 = &b[pos10..]
                .binary_search_by_key(&(t * 3 * 2 - 1), |e| (ai + (e & t2m)) * 2)
                .err()
                .unwrap() + pos10;
            cnt += (n - pos11) + (pos10 - pos01);
        }

        ans |= (cnt & 1) << p;
    }

    println!("{}", ans);
}


Measured memory_bytes: 12136
w, h, x, y = map(int, input().split())

cx = w/2
cy = h/2
if (cx == x) and (cy == y):
    print(w*h/2, end=' ')
    print(1)
    exit()
elif cx == x:
    print(w * h / 2, end=' ')
    print(0)
    exit()
elif cy == y:
    print(w * h / 2, end=' ')
    print(0)
    exit()
else:
    t = 0

b = y - x * ((y-cy) / (x-cx))
if (b >= 0) and (b <= h):
    bb = ((y-cy) / (x-cx)) * w + b
    s = (b + bb) * w / 2
elif b < 0:
    a = (0 - b) * (x-cx) / (y-cy)
    aa = (h - b) * (x-cx) / (y-cy)
    s = ((-b + h) * aa / 2) - ((-b) * a / 2)
elif b > h:
    a = (0 - b) * (x - cx) / (y - cy)
    aa = (h - b) * (x - cx) / (y - cy)
    s = (b * a / 2) - ((b-h) * aa / 2)

print(s, end=' ')
print(t)


Measured memory_bytes: 3064
while True:
    W, H = map(int, input().split())
    if W == 0 and H == 0:
        break
    else:
        for j in range(W):
            if j == 0 or j == W-1:
                for i in range(H):
                    print('#', end='')
                print()
            else:
                for i in range(H):
                    if i == 0 or i == H-1:
                        print('#', end='')
                    else:
                        print('.', end='')
                print()
        print()



Measured memory_bytes: 7000
x, n = map(int, input().split())
if n == 0:
  print(x)
else:
  p_list = [int(x) for x in input().split()]
  x_list = list(range(102))
  for i in range(n):
    p_i = p_list[i]
    if p_i in x_list:
      x_list.remove(p_i)
  for i in range(51):
    x_hiku = x - i
    x_tasu = x + i
    if x_hiku in x_list:
      print(x_hiku)
      break
    elif x_tasu in x_list:
      print(x_tasu)
      break


Measured memory_bytes: 9200
#include<iostream>
#include<string>

using namespace std;

int main(){
 string o,e;
  cin >> o>> e;
  string res="";
  
  
  for(int i=0;i<e.length();i++) {res+=char(o[i]);
                                 res+=char(e[i]);
                                }
  if(o.length()>e.length()) res+=char(o[o.length()-1]);
  
  
  cout << res << endl;
  

}

Measured memory_bytes: 256
#include <cstdio>

using namespace std;

int a[100001];

int main() {
    int n, c = 0, ans = 0, i;
    
    scanf("%d", &n);
    
    for (i = 0; i < n; i++) {
        int x;
        
        scanf("%d", &x);
        
        a[x]++;
    }
    
    for (i = 0; i <= 100000; i++) {
        if (a[i] == 0) continue;
        if (a[i] % 2 == 0) {
            c++;
        } else {
            ans++;
        }
    }
    
    printf("%d\n", ans + c - c % 2);
    
    return 0;
}


Measured memory_bytes: 512
import sys
input = sys.stdin.readline
n = int(input())
stone = [0]+list(map(int,input().split()))
ab = [list(map(int,input().split())) for i in range(n-1)]
graph = [[] for i in range(n+1)]
dp = [[] for i in range(n+1)]
deg = [0]*(n+1)
stack = []
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
  deg[a] += 1
  deg[b] += 1
root = 0
for i in range(1,n+1):
  if deg[i] == 1:
    stack.append(i)
  elif root == 0:
    root = i
if root == 0:
  if stone[1] == stone[2]:
    print("YES")
  else:
    print("NO")
  exit()
deg[root] += 1
flg = 1
while stack:
  x = stack.pop()
  if x == root:
    if sum(dp[x]) != 2*stone[x] or max(dp[x]) > stone[x]:
      flg = 0
    break
  elif dp[x]:
    if max(max(dp[x])*2,sum(dp[x])) > stone[x]*2 or stone[x] > sum(dp[x]):
      flg = 0
      break
    stone[x] = 2*stone[x]-sum(dp[x])
  for y in graph[x]:
    if deg[y] > 1:
      dp[y].append(stone[x])
      deg[y] -= 1
      if deg[y] == 1:
        stack.append(y)
if flg:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 94956
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  long long ans = 0;
  vector<int> vec(a * 3);
  for (int i = 0; i < 3 * a; i++) cin >> vec[i];
  sort(vec.rbegin(), vec.rend());
  for (int i = 0; i < a; i++) {
    ans += vec.at(2 * i + 1);
  }
  cout << ans << endl;
}

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

int main() {
	int n; cin >> n;
	cout << (n % 2 == 0 ? n / 2 : n / 2 + 1) << endl;
	return 0;
}


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm(a, b) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<int> Div(int n) {
    vector<int> ret;
    for(int i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);

            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    string s;
    cin >> s;
    int len = s.length();
    if(s[0] != s[len - 1]) {
        if(len % 2 == 0) cout << "Second";
        else cout << "First";

    } else {
        if(len % 2 == 0) cout << "First";
        else cout << "Second";

    }
    cout << endl;
    return 0;
}



Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#include<sstream>
#include<iomanip>
#include <map>
#include <stack>

struct max_min
{
    int64_t max = 0;
    int64_t min = 0;
};

const int64_t cc = pow( 10, 9 ) + 7;
//std::cout<< std::fixed << std::setprecision(10) << ( double )( max ) / 2;
bool sort_pair( std::pair< int64_t, int64_t > origin, std::pair< int64_t, int64_t > another )
{
    return origin.first < another.first;
}


int main()
{
    std::string word = "aa";
    int64_t a,b,c,d,e,f;
 
    std::vector< std::pair< int64_t, int64_t > > list;
    std::cin>> a;
    std::cin>> b;
    
    for( int i = 0; i < b; i++ )
    {
        std::pair< int64_t, int64_t > dd;
        std::cin>> dd.first;
        std::cin>> dd.second;
        list.push_back( dd );        
    }
 
    std::sort( list.begin(), list.end(), sort_pair );
    c = 0;
 
    for( int i = 0; i < list.size(); i++ )
    {
        if( list[i].first == 1
            && list[i].second == 0
            && a != 1 )
        {
            c = -1;
            break;
        }
 
        if( list[i].first > a )
        {
            c = -1;
            break;
        }
        
        if( i == 0 )
        {
            c += pow( 10, a - list[i].first ) * list[i].second;
        }
        else
        {
            if( list[i].first == list[i-1].first )
            {
                if( list[i].second == list[i-1].second )
                {
                    continue;
                }
                else
                {
                    c = -1;
                    break;
                }
            }
            else
            {
                c += pow( 10, a - list[i].first ) * list[i].second;
            }
        }
    }
 

    if( a == 2
        && c < 10
        && c != -1 )
    {
        c += 10;
    }
    else if( a == 3
             && c < 100
             && c != -1 )
    {
        c += 100;
    }
    
    std::cout<< c;
}


Measured memory_bytes: 256
def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

N,M,K = map(int,input().split())

C = comb(N*M-2, K-2)
#print(int(C))

A = int(0)
for d in range(N):
    a = (N-d)*(M**2)

    A += int(d*a)

B = int(0)
for d in range(M):
    b = (M-d)*(N**2)
    B += int(d*b)

ans = int((A+B)*C)
ans = ans%(1000000007)
print(ans)


Measured memory_bytes: 11512
n, m = map(int, input().split())
if abs(n-m) > 1:
    print(0)
else:
    mod = 10**9+7
    k = min(n, m)
    modfa = 1
    for i in range(1, k+1):
            modfa = modfa*i % mod
    print(modfa**2*(k+1) % mod if abs(n-m) else 2*modfa**2 % mod)


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

using namespace std;

bool arr[200002];

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

int main(){

    cin.sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    //freopen("input.txt", "r", stdin);

    int n, pref = 0, tot = 0;
    string a;

    cin >> n >> a;

    for(auto i : a)
        if(i == '.')
            ++tot;

    // find divider point, separate black and white

    int best = 1e9;

    for(int i = 0; i < n; ++i){
        // Set a[i] as last white
        if(a[i] == '.')
            pref++;
        best = min(best, (i + 1) + tot - pref * 2);
    }

    cout << min(best, min(tot, n - tot));

    return 0;
}


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

using namespace std;

int main()
{
// #ifndef ONLINE_JUDGE
//     freopen("input.txt","r",stdin);
// #endif
    
    string s;
    cin>>s;
    int l = s.length();
    for(int i = 0 ;i<l-1 ;i++)
    {
        if(s[i]==s[i+1])
        {
            cout<<"Bad"<<endl;
            return 0;
        }
    }
    cout<<"Good"<<endl;
    return 0 ;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	int N;
	cin >> N;
	
	vector<int> A(N);
	REP(i, N) cin >> A[i];
	
	map<ll, int> mm;
	REP(i, N) ++mm[A[i] - i];
	
	ll ans = 0;
	REP(i, N) {
		--mm[A[i] - i];
		ans += mm[-(A[i] + i)];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 26756
a=int(input())
b = [int(i) for i in input().split()]
#print(b)
#print(sum(b)/a)
c={}
for i in range(a):
	c.update({i:abs(sum(b)/a-b[i])})
#print(c)
c=sorted(c.items(), key=lambda x: x[1])
#print(c)
print(c[0][0])

Measured memory_bytes: 3060
object Main extends App {
    val Array(x, n) = io.StdIn.readLine.split(" ").map(_.toInt)
    
    if (n == 0) println(x)
    else {
        val ps = io.StdIn.readLine.split(" ").map(_.toInt)

        val ints = ((ps.min-1) to (ps.max+1)).toSet &~ ps.toSet

        def rec(diff: Int): Int = {
            if (ints.contains(x-diff)) x-diff
            else if (ints.contains(x+diff)) x+diff
            else rec(diff+1)
        }

        val result = rec(0)
        println(result)
    }
}

Measured memory_bytes: 58004
#include <cstdio>
#include <string>
#include <map>
#include <cstring>
#include <algorithm>
using namespace std;
#define mst(a,b) memset((a),(b),sizeof(a))
#define rush() int T;scanf("%d",&T);while(T--)

typedef long long ll;
const int maxn = 105;
const ll mod = 1e9+7;
const int INF = 0x3f3f3f;
const double eps = 1e-9;

int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        if(n%10==n/100)
        {
            puts("Yes");
        }
        else puts("No");
    }
}


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

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

  int joy = 0;
  
  int prod500 = N / 500;
  joy += (1000 * prod500);
  N = N % 500;

  int prod5 = N / 5;
  joy += (5 * prod5);
  N = N % 5;

  cout << joy << endl;
  
  return 0;
}

Measured memory_bytes: 256
import java.awt.geom.*;
import java.util.*;
public class Main {
	String str;
	int ans, pos;
	//0352 start
	//0405 cording end
	//0406 WA
	private void doit() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		while(n-- > 0){
			str = sc.next();
			ans = 0;
			pos = 0;
			int res = exp();
			System.out.println(res);
		}
	}

	private int exp() {
		int res = term();
		while(true){
			char op = str.charAt(pos);
			if((op == '+') || (op == '-')){
				int old = res;
				pos++;
				res = term();
				switch(op){
				case '+': 
					res = old + res;
					break;
				case '-':
					res = old - res;
					break;
				}
			}
			else{
				break;
			}
		}
		return res;
	}

	private int term() {
		int res = fact();
		while(true){
			char op = str.charAt(pos);
			if((op == '*') || (op == '/')){
				int old = res;
				pos++;
				res = fact();
				switch(op){
				case '*':
					res = old * res;
					break;
				case '/':
					res = old / res;
					break;
				}
			}
			else{
				break;
			}
		}
		return res;
	}

	private int fact() {
		if(Character.isDigit(str.charAt(pos))){
			int t = str.charAt(pos) - '0';
			pos++;
			while(Character.isDigit(str.charAt(pos))){
				t = t * 10 + (str.charAt(pos) - '0');
				pos++;
			}
			return t;
		}
		else if(str.charAt(pos) == '('){
			pos++;
			int res = exp();
			pos++;
			return res;
		}
		return 0;
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 12000
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var k = long.Parse(Console.ReadLine());

        Queue<long> qu = new Queue<long>();
        qu.Enqueue(1);
        qu.Enqueue(2);
        qu.Enqueue(3);
        qu.Enqueue(4);
        qu.Enqueue(5);
        qu.Enqueue(6);
        qu.Enqueue(7);
        qu.Enqueue(8);
        qu.Enqueue(9);

        long ans = 0;
        var count = 0;
        var flag = true;
        while (flag)
        {
            var tmp = qu.Dequeue();
            var last = tmp.ToString();
            last = last[tmp.ToString().Length -1].ToString();

            if (tmp % 10 != 0)
            {
                qu.Enqueue(10 * tmp + long.Parse(last) - 1);
            }

            qu.Enqueue(10 * tmp + long.Parse(last));

            if (tmp % 10 != 9)
            {
                qu.Enqueue(10 * tmp + long.Parse(last) + 1);
            }

            count++;
            if (count == k)
            {
                ans = tmp;
                flag = false;
            }
        }


        // 出力
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 19288
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> V;

int main() {
  string s[3];
  cin >> s[0] >> s[1] >> s[2];
  int turn = 0;
  char tmp;
  while (!s[turn].empty()) {
    tmp = s[turn][0];
    s[turn].erase(s[turn].begin());
    turn = tmp-'a';
  }
  char res = 'A'+turn;
  dump(res);
  return 0;
}


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

typedef long long ll;
using namespace std;

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

	
	string s; cin >> s;
	for (int i = 0;i < s.size();i++){
		if(s[i] == '1')cout << 9;
		else if(s[i] == '9')cout << 1;
		else cout << s[i];
	}	

	cout << endl;

	return 0;

}


Measured memory_bytes: 764
n,m  = map(int, input().split())

ans = 0
ba = [[0 for _ in range(2)] for _ in range(m)]

for i in range(m):
    a,b = map(int, input().split())
    ba[i][0] = b
    ba[i][1] = a

ba.sort()

br = 0
for b,a in ba:
    #if bridge[(a-1):] != 0:
    if not (a < br < b):
        #bridge[b-2] = 0
        br = b - 0.5
        ans += 1

print(ans)

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

using namespace std;

int main()
{
   int n,rev=0,d=0,p;
   scanf("%d",&n);
   p=n;
   while (n!=0)
   {
       d=n%10;
       rev=(rev*10)+d;
       n=n/10;
   }
   if(p==rev)
   {
       printf("Yes");
   }
   else
   {
       printf("No");
   }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
static const int N = 100;

int main() {
    int M[N][N];
    int n, u, k, v;
    
    cin >> n;
    
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) M[i][j] = 0;
    }
    
    for (int i = 0; i < n; i++) {
        cin >> u >> k;
        u--;
        for (int j = 0; j < k; j++) {
            cin >> v;
            v--;
            M[u][v] = 1;
        }
    }
    
    for(int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if(j) cout << " ";
            cout << M[i][j];
        }
        cout << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3136
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	int n, i, j, k;
	string s;
	cin >> n >> s;
	s = s + s;

	vector<int> ans, a(n);
	for (i = 0; i < 2; i++) {
		for (j = 0; j < 2; j++) {
			a[0] = i;
			a[1] = j;

			for (k = 2; k < n; k++) {
				if (a[k - 1] == 0) {
					if (s[k - 1] == 'o') a[k] = a[k - 2];
					else a[k] = 1 - a[k - 2];
				}
				else {
					if (s[k - 1] == 'o') a[k] = 1 - a[k - 2];
					else a[k] = a[k - 2];
				}
			}

			bool v1 = false, v2 = false;
			if (a[0] == 0) {
				if ((s[0] == 'o') && (a[n - 1] == a[1])) v1 = true;
				if ((s[0] == 'x') && (a[n - 1] != a[1])) v1 = true;
			}
			else {
				if ((s[0] == 'o') && (a[n - 1] != a[1])) v1 = true;
				if ((s[0] == 'x') && (a[n - 1] == a[1])) v1 = true;
			}

			if (a[n - 1] == 0) {
				if ((s[n - 1] == 'o') && (a[n - 2] == a[0])) v2 = true;
				if ((s[n - 1] == 'x') && (a[n - 2] != a[0])) v2 = true;
			}
			else {
				if ((s[n - 1] == 'o') && (a[n - 2] != a[0])) v2 = true;
				if ((s[n - 1] == 'x') && (a[n - 2] == a[0])) v2 = true;
			}

			if (v1 && v2) {
				ans = a;
			}
		}
	}

	if (ans.empty()) cout << "-1\n";
	else {
		for (i = 0; i < n; i++) {
			if (ans[i] == 0) cout << "S";
			else cout << "W";
		}
		cout << "\n";
	}

	return 0;
}



Measured memory_bytes: 1500
N,M=map(int,input().split())

x=list(range(1,N+1,1))

if N%2==1:
    for i in range(M):
        print(x.pop(0),x.pop(-1))
        
else:
    x_f=x[1:int(N/2+1)]
    x_l=x[int(N/2+1):]
    
    count=0
    
    for i in range(M):
        if len(x_f)>1:
            print(x_f.pop(0),x_f.pop(-1))
            count+=1
            
        if count==M:
            break
        
        if len(x_l)>1:
            print(x_l.pop(0),x_l.pop(-1))
            count+=1
            
        if count==M:
            break

Measured memory_bytes: 15904
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

string s;
LL dpa[100010],dpc[100010],dpq[100010],pw[100010],q,ans=0;

int main()
{
	pw[0]=1;
	repn(i,100005) pw[i]=pw[i-1]*3%MOD;
	cin>>s;
	repn(i,s.size())
	{
		if(s[i-1]=='?') q++;
		dpa[i]=dpa[i-1];
		dpc[i]=dpc[i-1];
		dpq[i]=dpq[i-1];
		if(s[i-1]=='A') dpa[i]++;
		if(s[i-1]=='C') dpc[i]++;
		if(s[i-1]=='?') dpq[i]++;
	}
	rep(i,s.size())
	{
		LL fa=dpa[i]-dpa[0],fq=dpq[i]-dpq[0],bc=dpc[s.size()]-dpc[i+1],bq=dpq[s.size()]-dpq[i+1];
		if(s[i]=='B')
		ans=(ans+fa*bc*pw[q]%MOD+fa*bq*(q==0 ? 0:pw[q-1])%MOD+fq*bc*(q==0 ? 0:pw[q-1])%MOD
		+fq*bq*(q-2<0 ? 0:pw[q-2])%MOD)%MOD;
		if(s[i]=='?')
		ans=(ans+fa*bc*(q==0 ? 0:pw[q-1])%MOD+fa*bq*(q-2<0 ? 0:pw[q-2])%MOD+fq*bc*(q-2<0 ? 0:pw[q-2])%MOD
		+fq*bq*(q-3<0 ? 0:pw[q-3])%MOD)%MOD;
	}
	cout<<ans<<endl;
	rt0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <cstdint>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

int main(void)
{
    int64_t X;

    std::cin >> X;

    int64_t kyu = 8;

    std::vector<int64_t> rates = {
        600,
        800,
        1000,
        1200,
        1400,
        1600,
        1800,
    };

    for (auto rate : rates) {
        if (X >= rate) kyu--;
    }

    std::cout << kyu << std::endl;

    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h> 
using namespace std;
using ll = long long;
#define F first
#define S second

ll n;

void solve(){
    cin >> n;
    if(n%2 == 1){
        cout << "0\n";
    }
    else{
        ll ans = 0;
        for(ll i = 10; i <= n; i *= 5){
            ans += n/i;
        }
        cout << ans << '\n';
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}

Measured memory_bytes: 3604
import java.io.*;
import java.util.*;
 
public class Main {
 
	void submit() {
	    int a = nextInt();
	    int b = nextInt();
	    
	    int total = 0;
	    int ten = 1;
	    
	    if(a >= b){
	        for(int i=0; i<a; i++){
	            total += b*ten;
	            ten *= 10;
	        }
	    }else{
	        for(int i=0; i<b; i++){
	            total += a*ten;
	            ten *= 10;
	        }
	    }
        out.println(total);
	}

	void preCalc() {
 
	}
 
	void stress() {
 
	}
 
	void test() {
 
	}
 
	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}
 
	static final Random rng = new Random();
 
	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}
 
	public static void main(String[] args) throws IOException {
		new Main();
	}
 
	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
 
	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}
 
	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
	int nextInt() {
		return Integer.parseInt(nextToken());
	}
 
	long nextLong() {
		return Long.parseLong(nextToken());
	}
 
	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 21204
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 300005

int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i,n)cin >> a[i];
    int f[MAX_N] = {};
    ll ans = 0;

    rep(i,n){
        int x = -a[i] + i;
        if(0 <= x && x < MAX_N){
            ans += f[x];
        }
        int y = a[i] + i;
        if(y < MAX_N)f[y]++;
    }

    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 5624
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int N,M;

ll dp[303][303][303];

void add(ll &a,ll b){
    a=(a+b)%MOD;
    return;
}

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

  dp[0][1][0]=1;
  for(int i=0;i<M;i++){
      for(int j=0;j<=N;j++){
          for(int k=0;j+k<=N;k++){
              add(dp[i+1][j+k][0],dp[i][j][k]*j);
              add(dp[i+1][j][k],dp[i][j][k]*k);
              if(j+k+1<=N) add(dp[i+1][j][k+1],dp[i][j][k]*(N-(j+k)));
          }
      }
  }

  cout<<dp[M][N][0]<<endl;


  return 0;
}


Measured memory_bytes: 216576
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
#define repi(i,a,b) for (int i=a;i<(b);i++)
#define SIZE_OF_ARRAY(a) (sizeof(a)/sizeof(a[0]))
using namespace std;
typedef long long ll;
  
  int main(void){
    cin.tie(0); //cin高速化
    ios::sync_with_stdio(false); //cin高速化
	int x,a,b,c;
    int ans=0;
    cin >> a >> b >> c >> x;
    rep(i,a+1){
      rep(j,b+1){
        rep(k,c+1){
          if(500*i+100*j+50*k==x){
            ans++;
          }
        }
      }
    }
    cout << ans << endl;
    return 0;
  } 

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

int main(){
  int N,K;
  cin >> N >> K;
  int* x = new int[N];

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

  int sum = 0;
  int t;

  for(int i = 0; i < N; i++){
    if(x[i] > K - x[i]){
      t = (K - x[i]) * 2;
    }
    else if(x[i] < K - x[i]){
      t = x[i] * 2;
    }
    else{
      t = x[i] * 2;
    }
    sum = sum + t;
  }

  cout << sum << endl;


  delete[] x;
}

Measured memory_bytes: 256
def guess_the_number():
    N,M=map(int,input().split())
    ans=[-1]*N

    for i in range(M):
        s,c=map(int,input().split())
        if N>1 and s==1 and c==0:
            print(-1)
            exit()
        if ans[s-1]!=-1 and c!=ans[s-1]:
            print(-1)
            exit()
        ans[s-1]=c
    for i in range(len(ans)):
        if ans[i]==-1:
            ans[i]=0
    
    if N==1:
        print(ans[0])
        exit()
    if ans[0]==0:
        ans[0]=1
    
    result=""
    for i in range(0, N):
        result += str(ans[i])
    print (result)

guess_the_number()

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

#define debug(x) cerr << x << " = "(x) << endl;
#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    int k; cin >> k;
    int a,b; cin >> a >> b;
    ll ans=0;
    while(ans<a){
        ans+=k;
    }
    if(ans>b) cout << "NG" << endl;
    else cout << "OK" << endl;
}

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

int main(void){
  while(true){
    int n;
    cin >> n;
    if(n == 0){ break; }

    vector<int> a(n);
    for(int i = 0; i < n; i++){ cin >> a[i]; }
    sort(a.begin(), a.end());

    int ans = 10000000;
    for(int i = 1; i < n; i++){ ans = min(a[i] - a[i - 1], ans); }
    cout << ans << endl;
  }

  return 0;
}

Measured memory_bytes: 3080
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int seki = a * b * c;
        if (seki == (5 * 7 * 5)) {
          System.out.println("YES");
        } else {
          System.out.println("NO");
        }
    }
}


Measured memory_bytes: 21460
/* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */

#include <bits/stdc++.h>
//#include <Windows.h>
using namespace std;

void wakwaw(int *x) { 
     x[1] = 0; 
     x[2] = 1; 
     for (int i = 3; i <= 1000000; i += 2) 
         x[i] = 1; 
 
 
     for (int i = 3; i <= 1000; i += 2) { 
         if (x[i] == 0) 
             continue; 
         for (int j = 2; i * j <= 1000000; j++) 
            x[i * j] = 0; 
     } 
 
 
     for (int i = 3; i <= 1000000; i++) 
         x[i] += x[i-1]; 
 } 
 
 
 int main() { 
 
 
     int *arr = new int[1000001]; 
     wakwaw(arr); 
 
 
     int n; 
     while (cin >> n) { 
         cout << arr[n] << endl; 
     } 
 
 
     return 0; 
 } 

Measured memory_bytes: 6960