akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>

using namespace std;
#define ALL(x)              (x).begin(),(x).end()
typedef long long           ll;
#define REP(i, n)           for (ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)       for (ll i = m ; i < (ll)n ; ++i)
#define INF                 (ll)1e15
#define MOD                 (1000 * 1000 * 1000 + 7)
#define Ceil(x, n)          (((((x))+((n)-1))/n))
#define CeilN(x, n)         (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)        ((x)-(x)%(n))
#define IsOdd(x)            (((x)&0x01UL) == 0x01UL)
#define IsEven(x)           (!IsOdd((x)))
#define M_PI                3.14159265358979323846
typedef pair<ll, ll>	    P;

/*-----------------------------------------------------------------------------
　処理
 -----------------------------------------------------------------------------*/
/* 繰り返し二乗法 (xのy乗) */
ll binpow(ll x, ll y)
{
	ll res = 1LL;
	x %= MOD;
	while (y) {
		if (y & 1) res = (res * x) % MOD;
		y >>= 1;
		x = (x * x) % MOD;
	}
	return res;
}

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

	ll oneCnt = 0;
	ll ans = 0;
	REP(i, L.size()) {
		if (L[i] == '1') {
			ll nokori = L.size() - i - 1;
			ans += binpow(2, oneCnt) * binpow(3, nokori);
			ans %= MOD;
			oneCnt++;
		}
	}

	ans += binpow(2, oneCnt);
	ans %= MOD;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

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

Measured memory_bytes: 1284
object Main extends App {

  import scala.io.StdIn._
  import scala.math._

  val n = readLine.trim.toInt
  val prime = primes(n + 2)
  var count = 0
  for (i ← 1 until prime.size){
    if (prime(i) == prime(i - 1) + 2) {
      count += 2
    }
  }
  println(count)
  def primes(upper:Int): Array[Int] = {
    val memo = Array.tabulate(upper + 1){_ ⇒ true}
    for (i ← 2 to math.sqrt(upper).toInt){
      if (memo(i)){
        for (j ← i * 2 to upper by i){
          memo(j) = false
        }
      }
    }
    (2 to upper).filter(it ⇒ memo(it)).toArray
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}


Measured memory_bytes: 221172
n = int(input())
A = list(map(int, input().split()))[::-1]
B = []
t = 0
before = A[0] - 1
max_t = 0
for i in A:
    if before <= i:
        t += 1
        before = i
    else:
        B.append(t)
        t = 1
        before = i
B.append(t)
if n == 1:
    print(0)
else:
    print(max(B)-1)

Measured memory_bytes: 63984
#include<iostream>
#include<cstdlib>

#include<cmath>
#include<map>
#include<string>
#include<vector>
#include<algorithm> 

using namespace std;

# define p(s) std::cout << s << endl;
# define printIf(j,s1,s2) std::cout << (j ? s1 : s2) << endl;
# define YES(j) std::cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define rep(n,i) for(i = 0 ; i < n ; i++)
# define swap_int(a,b) int t=a;a=b;b=t;

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

   int a[100000];
   int min_abs=1e9;
   long long int total_abs=0;
   for(int i=0;i<n;i++){
      cin >> a[i];
      min_abs=min(min_abs,abs(a[i]));
      total_abs+=abs(a[i]);
   }

   for(int i=0;i<n-1;i++){
      if(a[i]<0) {
         a[i]*=-1;
         a[i+1]*=-1;
      }
   }
   if(a[n-1]<0) p(total_abs-min_abs*2)
   else p(total_abs)
} 

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cstring>
int main()
{
	int K, X;
	std::cin >> K >> X;
	if (K * 500 >= X) {
		std::cout << "Yes" << std::endl;
	}
	else {
		std::cout << "No" << std::endl;
	}
	return 0;
}

Measured memory_bytes: 3624
def main():
    n, m = map(int, input().split())
    D = [list(map(int, input().split())) for _ in range(m)]
    D.sort()
    result = 1
    checker = D[0][1]
    for i in range(m):
        if checker <= D[i][0]:
            result += 1
            checker = D[i][1]
        elif checker > D[i][1]:
            checker = D[i][1]
    print(result)
if __name__ == '__main__':
    main()


Measured memory_bytes: 27880
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vpii> vvpii;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int n;
  while (cin >> n, n) {
    vi a(n);
    rep(i, n) cin >> a[i];
    int totalSwapTime = 0;
    for (;;) {
      int st = 0;
      loop(i, 1, n) {
        if (a[i - 1] <= a[i]) continue;
        swap(a[i - 1], a[i]);
        st++;
      }
      totalSwapTime += st;
      if (!st) break;
    }
    cout << totalSwapTime << endl;
  }
}

Measured memory_bytes: 3104
#include <iostream>
#include <algorithm>

using namespace std;
int main()
{
	int N, K;
	string s;	
	cin >> N >> K;
	cin >> s;
	int left = 0;
	int longest = 1;
	int i = 1;
	int cnt = (s[0] == '0') ? 1 : 0;
	while(i < N && N - left > longest)
	{
		for(; i < N; i += 1)
		{
			if(s[i] == '0' && s[i-1] == '1')
			{
				cnt += 1;
				if(cnt > K)
				{
					break;
				}
			}
		}
		longest = max(longest, i - left);

		left += 1;
		while(left < N && !(s[left - 1] == '0' && s[left] == '1'))
		{
			left += 1;
		}
		cnt -= 2;
	}

	cout << longest << endl;
	return 0;
}


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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	llong a,b,x;
	cin >> a >> b >> x;

	cout << b/x+1 - (a > 0 ? (a-1)/x + 1 : 0) << endl;

	return 0;
}

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

long long binary_search(vector<long long> &n, long long x){
    long long ok = (long long)n.size();
    long long ng = - 1;
    while (abs(ok - ng) > 1){
        long long mid = (ok + ng) / 2;
        if (n[mid] >= x) ok = mid;
        else ng = mid;
    }
    return ng;
}

int main(){
    int n;
    cin >> n;
    vector<long long> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<long long> b(n);
    for (int i = 0; i < n; i++) cin >> b[i];
    long long ans = 0;
    vector<long long> mod_a(n);
    vector<long long> mod_b(n);
    for (int i = 0; i < 29; i++){
        long long tmp = 0;
        for (int j = 0; j < n; j++){
            mod_a[j] = a[j] % (1<<(i+1));
            mod_b[j] = b[j] % (1<<(i+1));
        }
        sort(mod_b.begin(), mod_b.end());
        for (int j = 0; j < n; j++){
            tmp += binary_search(mod_b, 2*(1<<i) - mod_a[j]) - binary_search(mod_b, (1<<i) - mod_a[j]);
            tmp += binary_search(mod_b,  4*(1<<i) - mod_a[j]) - binary_search(mod_b, 3*(1<<i) - mod_a[j]);
        }
        ans += (1<<i) * (tmp % 2);
    }
    cout << ans << endl;
}

Measured memory_bytes: 6528
//بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;

#define endl "\n"

const int MOD = 1000000007;


int main()
{
    ios::sync_with_stdio(0);cin.tie(0);
    string a, b;
    cin >> a >> b;
    int co = 0  ;

    for(int i = 0 ; i < a.size() ; i++){
        if(a[i] != b[i])
            co++;
    }
    cout << co << endl;
	return 0;
}


Measured memory_bytes: 3792
import sys
v=[0]*100
for e in sys.stdin:
 a,b=map(int,e.split())
 v[a]+=1;v[b]+=1
 if a==0:
  print(['NG','OK'][(v[1]&1)*(v[2]&1)*sum(x&1 for x in v)==2])
  v=[0]*100


Measured memory_bytes: 5612
while True:
    n=input()
    if n==0:
        break
    S=list(map(int,raw_input().split()))
    cnt=0
    post=[S.count(S[i]) for i in range(n)]
    while S<>post:
	S=post[:]
        cnt+=1
        post=[S.count(S[i]) for i in range(n)]
    print cnt
    print " ".join(map(str,post))

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

int main() {
  int n,k;
  char c;
  cin >> n >> k;
  for(int i=0 ;i<n ;i++){
    cin >> c;
    if(i == k-1){
      c = tolower(c);
    }
    cout << c;
  }
  cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

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

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    int c[3][3];
    rep(i, 3) {
        rep(j, 3) { cin >> c[i][j]; }
    }

    int padding1 = c[1][0] - c[0][0];
    rep(i, 3) { c[1][i] -= c[0][i] + padding1; }

    int padding2 = c[2][0] - c[0][0];
    rep(i, 3) { c[2][i] -= c[0][i] + padding2; }

    bool ans = true;
    repd(i, 1, 3) {
        rep(j, 3) {
            if (c[i][j] != 0) {
                ans = false;
            }
        }
    }

    if (ans) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

void prime_map(map<ll, ll> &m, ll num) {

    if (num == 1) {
        return;
    }
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }
    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }

        return;
    }
    prime_map(m, num);
    return;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX 10000001
#define mod 1000000007

ll computeTotient(ll n)
{
    ll res=n;
    ll tmp=n;
    for(int i=2;i<=sqrt(tmp);i++)
    {
        if(n%i==0){
            res-=(res/i);
            while(n%i==0)
                n/=i;
        }

    }
    if(n>1)
    {
        res-=(res/n);
    }
    return res;

}
int main()
{
    int n;
  	cin >> n;
  int c=0;
  for(int i=1;i<=n;i++)
  {
   	int p;
    cin >> p;
    c+=(i%2==1 && p%2==1);
  }
  cout<<c<<'\n';
} 

Measured memory_bytes: 3556
#include<iostream>
#include<cstdio>
using namespace std;
long long a,b;
int main(){
//	freopen("A.in","r",stdin);
//	freopen("A.out","w",stdout);
	scanf("%lld%lld",&a,&b);
	long long n=a*b;
	if (n%2==0) printf("Even\n");
	else printf("Odd\n");
	fclose(stdin);fclose(stdout);
	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> cnt(N + 1);
	REP(i, N - 1) {
		int A;
		cin >> A;
		++cnt[A];
	}
	FOR(i, 1, N + 1) printf("%d\n", cnt[i]);
	return 0;
}


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

#define AndIamIronMan ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); 
 
using namespace std;
 
typedef long long int lli; 
 
int main(){
    
	lli a,b,c,n,t,k;
	AndIamIronMan;
	cin>>a>>b>>c>>k;
	lli s1=0,s2=0,s3=0,s=0;
	s1=a,s2=a+b,s3=a+b+c;
	if(s1>=k){
		s=k;
		cout<<s;
		return 0;
	}
	if(s2>=k){
		s=a;
		cout<<s;
		return 0;
	}
	cout<<a-(k-(a+b));
    return 0;
}	

Measured memory_bytes: 3652
#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=1;i<=(n);i++)
typedef long long ll;

int main() {
    string s; int q;
    cin >> s >> q;
    string mae={},ushiro={};
    int hanten=0;
    rep(i,q){
        int t;
        cin >> t;
        if(t==1){
            hanten++;
            hanten%=2;
        }else{
            int f; string c;
            cin >> f >> c;
            if(f==1){
                if(hanten==0){
                    mae=c+mae;
                }else{
                    ushiro+=c;
                }
            }else{
                if(hanten==0){
                    ushiro+=c;
                }else{
                    mae=c+mae;
                }
            }
        }
    }
    //cout << mae << " " << ushiro << endl;
    string ans = mae + s + ushiro;
    if(hanten==0){
        cout << ans << endl;
    }else{
        reverse(ans.begin(),ans.end());
        cout << ans << endl; 
    }
}

Measured memory_bytes: 4328
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <locale>
#include <iomanip>

#define nl '\n';

using namespace std;

int r;

int main(){

    cin >> r;

    cout << r*r;







}

//g++ -std=c++14 comp.cpp -o b; ./b.exe
//g++ -std=c++14 comp.cpp && ./a.out

// char** arr = new char*[r];
// for(long long i = 0; i < r; i++) arr[i] = new char[c];

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

#ifdef _PRINTDEBUG
  #include "lib/printdebug.hpp"
#else
  #define printdebug(...) 1
#endif
#define MOD_1_000_000_007 (1000000007)
#define IINF (1<<28)
#define LINF (1LL<<60)
#define rep(i, n)      REP(i, 0, (n))
#define repc(i, n)     REPC(i, 0, (n))
#define REP(i, n, m)   for (int i = (int)(n); i <  (int)(m); i++)
#define REPC(i, n, m)  for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
#define yesno(cond)       YESNO((cond), "Yes", "No")
#define YESNO(cond, a, b) cout << ((cond) ? (a) : (b)) << "\n"

namespace solver {
  using namespace std;
  typedef long long ll;

  int N;
  ll A, B, xs[100010];

  void init() {
    cin >> N >> A >> B;
    rep(i, N) {
      cin >> xs[i];
    }
  }

  void solve() {
    ll ans = 0;
    rep(i, N-1) {
      ll w = abs(xs[i+1]-xs[i])*A;
      ans += min(w, B);
    }
    cout << ans << "\n";
  }
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  solver::init();
  solver::solve();
  return 0;
}

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

long long int A, B, N;

int main(void) {
  cin >> A >> B >> N;
  long long int ans = 0;
  
  if (N < B) {
    ans = floor(A * N / B);
  } else {
    ans = floor(A * (B - 1) / B);
  }
  cout << ans << endl;
  return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int N; cin >> N;
    vector<ll> a(N);
    rep(i, N) cin >> a[i];
    ll res = 0;
    rep(i, N){
        while(a[i]%2 == 0){
            a[i] /= 2;
            res++;
        }
    }

    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	int N;
	cin >>N;
	cout << N*N << endl;
	return 0;
}



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

int main(void){
    int n, x;
    cin >> n >> x;
    
    int input, min = 1000;
    int i;
    for(i = 1; i <= n; i++){
        cin >> input;
        x -= input;
        if(input < min){
            min = input;
        }
    }
    
    cout << n + x / min << endl;
    
    return 0;
}


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

  int main() {
  string s, t;
  cin >> s >> t;
  int ans;
  ans = 0;
  for(int i = 0; i < 3; i++){
    if(s[i] == t[i]){
      ans++;
    }
  }
    cout << ans;
  return 0;
}

Measured memory_bytes: 256
H, W = map(int, input().split())

if (H * W) % 3 == 0:
    # 縦または横が3の倍数
    print(0)
elif H == 1 or W == 1:
    # 縦または横が1
    print(1)
else:
    ans = 9999999999
    # pattern1
    for i in range(1, H):
        l = [W * (H - i), i * (int(W / 2)), i * (W - int(W / 2))]
        l.sort()
        ans = min(ans, l[-1] - l[0])

    # pattern2
    for i in range(1, W):
        l = [H * (W - i), i * (int(H / 2)), i * (H - int(H / 2))]
        l.sort()
        ans = min(ans, l[-1] - l[0])

    # pattern3
    ans = min(ans, H)

    # pattern4
    ans = min(ans, W)

    print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h> 
#include<cmath>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define deb(x) cerr<<#x<<" "<<x<<"\n"
#define debi cerr<<"hey sparky\n"
#define f first
//#define s second
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define newline cout<<"\n"
#define yes cout<<"YES"<<"\n"	
#define no cout<<"NO"<<"\n"
#define INF (int)1e5
#define nax (int)1e6+2
using namespace std;
// look for  all edge cases
//bool seq[nax] = {false};



int main(){
	fast;
	//int n ;
	int n ;
	cin >> n;
	string s;
	cin >> s;
	vector<ll > pre_r(n,0),pre_g(n,0),pre_b(n,0);
	if(s[0] == 'R'){
			pre_r[0]++;
		}
		else if(s[0] == 'G'){
			pre_g[0]++;
		}
		else{
			pre_b[0]++;
		}
	for(int i  =1 ;i< n;i++){
		pre_r[i] += pre_r[i-1];
		pre_g[i] += pre_g[i-1];
		pre_b[i] += pre_b[i-1];
		if(s[i] == 'R'){
			pre_r[i]++;
		}
		else if(s[i] == 'G'){
			pre_g[i]++;
		}
		else{
			pre_b[i]++;
		}
		
	}
	//debi;
	ll sum = 0 ;
	for(int i = 0 ;i< n-1;i++){
		for(int j = i+1 ; j<n;j++){
			
			if(s[i] != s[j]){
				set<char> p;
				p.insert('R');
				p.insert('B');
				p.insert('G');
				int another = 	2*j - i;
				char a1 = s[i];
				char a2 = s[j];
				//debi;
				p.erase(a1);
				p.erase(a2);
				char re = *p.begin();
				//deb(re);
				char check;
				if(another <= n-1)
					check = s[another];
				else
					check = '$';
				//deb(re);
				if(re == 'R'){
					sum += pre_r[n-1] - pre_r[j];
					if(check == re){
						sum += -1;
					}
				}
				else if(re == 'G'){
					sum += pre_g[n-1] - pre_g[j];
					if(check == re){
						sum += -1;
					}
				}
				else if(re == 'B'){
					sum += pre_b[n-1] - pre_b[j];
					if(check == re){
						sum += -1;
					}
				}
			}
		}
	}
	cout<< sum;
	return 0;
	
}


Measured memory_bytes: 3744
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
ll n,r[2005],a[2005],w[2006],t[2005];
ll dp[2][2005];
ll sub[2005];
vector<ll>vec;
bool cmp(const ll&a,const ll&b){
	return t[a]+r[a] > t[b]+r[b];
}
int main(){
	cin >> n;
	repn(i,n) cin >> r[i] >> a[i] >> w[i] >> t[i];
	rep(i,2)rep(j,2005) dp[i][j]=-1e18;
	repn(i,n)vec.pb(i);
	sort(vec.begin(),vec.end(),cmp);
	int cur = 0,nxt = 1;
	
	rep(i,vec.size()){
		rep(j,2005) dp[nxt][j] = sub[j] = -1e18;
		int id = vec[i];
		rep(j,2005){
			dp[nxt][j] = max(dp[nxt][j],dp[cur][j]);
			if(j <= t[id]+r[id]){
				if(j >= r[id]){
					sub[j-r[id]] = max(sub[j-r[id]],dp[cur][j]+a[id]);
				}
			}
			else{
				sub[t[id]] = max(sub[t[id]],dp[cur][j]+a[id]);
			}
		}
		for(int j=2004;j>=0;j--){
			if(j+r[id] < 2005) sub[j] = max(sub[j],sub[j+r[id]]+w[id]);
		}
		rep(j,2005) dp[nxt][j] = max(dp[nxt][j],sub[j]);
		dp[nxt][t[id]] = max(dp[nxt][t[id]],1LL*a[id]);
		for(int i=1;t[id]-r[id]*i>0;i++){
			dp[nxt][t[id]-r[id]*i] = max(dp[nxt][t[id]-r[id]*i],a[id]+1LL*i*w[id]);
		}
		swap(cur,nxt);
	}
	ll ans = 0;
	for(int i=1;i<2005;i++) ans = max(ans,dp[cur][i]);
	cout << ans << endl;
}


Measured memory_bytes: 3304
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>

using namespace std;

int main()
{
    int t, x;
    cin >> t >> x;

    long double y = (long double)t / x;
    cout << y << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <deque>
#include <iomanip>

using namespace std;

int n, L;
deque<pair<int, double> > que;
double sum = 0;

int main()
{
	ios::sync_with_stdio(false);
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);

	cin >> n >> L;
	for(int i = 1; i <= n; i++)
	{
		int v;
		double t;
		cin >> t >> v;
		if(i != 1)
		{
			int cnt = v;
			while(!que.empty() && cnt)
				if(que.front().first <= cnt)
					cnt -= que.front().first, sum -= que.front().second, que.pop_front();
				else
				{
					int vol = que.front().first;
					double temp = que.front().second / que.front().first;
					sum -= cnt * temp;
					que.front() = make_pair(vol - cnt, (vol - cnt) * temp);
					cnt = 0;
				}
		}
		sum += v * t;
		double mul = v * t;
		while(!que.empty() && que.back().second / que.back().first > mul / v)
			v += que.back().first, mul += que.back().second, que.pop_back();
		que.push_back(make_pair(v, mul));
		double ans = sum / L;
		cout << fixed << setprecision(12) << ans << endl;
	}


	return 0;
}


Measured memory_bytes: 19740
MAX_Q = 500_001
OFFSET = 200_000
C = [None] * MAX_Q
S = input()
N = len(S)
for i in range(N):
    C[OFFSET + i] = S[i]
Q = int(input())
left = OFFSET - 1
right = N + OFFSET
flg = False
for _ in range(Q):
    T = input()
    if len(T) == 1:
        flg = not(flg)
    else:
        f, c = T.split()[1:]
        if ((not flg and f == '1') or (flg and f == '2')):
            C[left] = c
            left -= 1
        else:
            C[right] = c
            right += 1
if flg:
    print(''.join(C[right-1:left:-1]))
else:
    print(''.join(C[left+1:right]))


Measured memory_bytes: 15844
import sys,math,collections
from collections import defaultdict

#from itertools import permutations,combinations
	
def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
def get_array():
	l=list(map(int, input().split()))
	return l
def get_2_ints():	
	a,b=map(int, input().split())
	return a,b
def get_3_ints():	
	a,b,c=map(int, input().split())
	return a,b,c	
def sod(n):
	n,c=str(n),0
	for i in n:	
		c+=int(i)
	return c	
def isPrime(n):
    if (n <= 1):
        return False
    if (n <= 3):
        return True
    if (n % 2 == 0 or n % 3 == 0):
        return False
    i = 5
    while(i * i <= n):
        if (n % i == 0 or n % (i + 2) == 0):
            return False
        i = i + 6
  
    return True
def getFloor(A, x):

	(left, right) = (0, len(A) - 1)

	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
			
	return floor
def floorSqrt(x) : 
  
    # Base cases 
    if (x == 0 or x == 1) : 
        return x 
   
    # Do Binary Search for floor(sqrt(x)) 
    start = 1
    end = x    
    while (start <= end) : 
        mid = (start + end) // 2
          
        # If x is a perfect square 
        if (mid*mid == x) : 
            return mid 
              
        # Since we need floor, we update  
        # answer when mid*mid is smaller 
        # than x, and move closer to sqrt(x) 
        if (mid * mid < x) : 
            start = mid + 1
            ans = mid 
              
        else : 
              
            # If mid*mid is greater than x 
            end = mid-1
              
    return ans	
#file()
def main():
	
		n=int(input())
		
		if(n>=30):
			print("Yes")
		else:
			print("No")	



	

	
	

		











		
		

		























































				

			







            
			
































		








if __name__ == '__main__':
    main()

Measured memory_bytes: 9432
//#include <tourist>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
//setprecision(15)有効数字15桁
//-std=c++14
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
struct edge {
    int to, cost;
};
ll n, k, r, s, p ;
vector<int> a;
string t;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>k>>r>>s>>p>>t;
    ll ans=0;
    vector<bool> used(n,false);
    for(int i=0;i<n;i++){
        if(i-k<0){
            if(t[i]=='r'){
                ans+=p;
            }
            if(t[i]=='s'){
                ans+=r;
            }
            if(t[i]=='p'){
                ans+=s;
            }
            used[i]=true;
        }
        else if(t[i-k]==t[i]&&used[i-k]){

        }
        else{
            if(t[i]=='r'){
                ans+=p;
            }
            if(t[i]=='s'){
                ans+=r;
            }
            if(t[i]=='p'){
                ans+=s;
            }
            used[i]=true;
        }
    }
    cout << ans << "\n";
}



Measured memory_bytes: 512
#include <stdio.h>
int main (){
  int y,m,d;
  char sla1,sla2;
  scanf ("%d %c %d %c %d", &y,&sla1,&m,&sla2,&d);
  
  if (y < 2019) printf("Heisei");
  else if (y > 2019) printf("TBD");
  else {
    if (m>=5) printf("TBD");
    else printf("Heisei");
  }
  
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define repp(i, n) rep(i, n)
#define reppp(i, n) repp(i, n)
#define rrepp(i, n) rrep(i, n)
#define repss(i, n) reps(i, n)
#define repcc(i, n) repc(i, n)
#define repii(i, a, b) repi(i, a, b)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } 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; }

void solve() {
  string s; cin >> s;
  sort(all(s));
  if (s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) yes(); no();
}


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

int main(){
    int n, q,A[100000];
    cin >> n >> q;
    string name;
    queue<pair<string,int> > S;
    
    for(int i=0; i<n; i++){
        cin >> name >> A[i];
        S.push(make_pair(name,A[i]));
    }
    
    pair<string,int> u;
    int a,elap=0;
    
    while(!S.empty()){
        u = S.front(); S.pop();
        a = min(u.second, q);
        if(q >= u.second){
            elap += a;
            cout << u.first << ' ' << elap << endl;
        }else{
            elap += a;
            S.push(make_pair(u.first, u.second-q));
        }
        
    }
}

Measured memory_bytes: 6548
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> PA;
typedef priority_queue<int, vector<int>, greater<int> > PQG;
#define REP(i, a, n) for(ll i = (ll) a;i < (ll) n;i++)
#define fi first
#define se second
#define pb push_back
#define INF 1000000009
#define MOD 100000
#define MAXN 302
#define MAXC 100000000000014
#define MAXV 1000000009

int n, ans;
char s[2 * MAXN][2 * MAXN];


int main()
{
    cin >> n;
    REP(i, 0, n){
        REP(j, 0, n){
            cin >> s[i][j];
            s[i][j + n] = s[i][j];
            s[i + n][j] = s[i][j];
            s[i + n][j + n] = s[i][j];
        }
    }
    REP(k, 0, n){
        int same = 0;
        REP(i, 0, n){
            REP(j, 0, n){
                if(s[i][j + k] == s[j][i + k]){
                    same++;
                }
            }
        }
        if(same == n * n)ans++;
    }
    cout << ans * n << endl;

    return 0;
}
















Measured memory_bytes: 640
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define PB push_back
#define MP make_pair

int main(){
	string S;
	cin >> S;
	if(S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) cout << "Bad" << endl;
	else cout << "Good" << endl;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	s := 0
	m := map[int]int{}
	m[0]++
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		s += a
		m[s]++
	}

	ans := 0
	for _, i := range m {
		ans += combi(i, 2)
	}

	fmt.Println(ans)
}

func combi(n, r int) int {
	c := 1
	for i := 1; i <= r; i++ {
		c = c * (n - i + 1) / i
	}
	return c
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define FOR(i,n) for(size_t i=0;i<(n);i++)
#define cinv(v,n) for(size_t i=0;i<(n);i++){cin>>(v)[i];}
#define nvec(type,v,n) vector<type> v(n);cinv(v,n)
#define npairs(type1,type2,v,n) vector<pair<type1,type2>> v(n);for(size_t i=0;i<(n);i++){cin>>v[i].first>>v[i].second;}

#define min_index(v) size_t(min_element(all(v))-(v).begin())
#define max_index(v) size_t(max_element(all(v))-(v).begin())
#define min_e(v) *min_element(all(v))
#define max_e(v) *max_element(all(v))

#define count_le(v,a) size_t(upper_bound(all(v),a)-(v).begin())
#define count_lt(v,a) size_t(lower_bound(all(v),a)-(v).begin())
#define count_ge(v,a) size_t((v).end()-lower_bound(all(v),a))
#define count_gt(v,a) size_t((v).end()-upper_bound(all(v),a))

#define order(neq_sl) [](const &auto s, const &auto l){return neq_sl;}
#define make_lr(v,type,l,r) vector<type> l(n+1),r(n+1);FOR(i,n){l[i+1]=l[i]+v[i];r[i+1]=r[i]+v[n-1-i];}

#define acm accumulate
#define SUM(v) accumulate(all(v),0l)

int main() {
  int a,b;
  cin>>a>>b;
  if(max(a,b)>8){
    cout<<":(";
  }else{
    cout<<"Yay!";
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
#include<queue>
using namespace std;
typedef long long ll;

const ll MOD = 1e9 + 7; 

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF_INT (1<<30)
#define INF_LL (1ll<<62)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int A[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main(){
    int K;
    cin>>K;
    out(A[--K]);
    
    
}

Measured memory_bytes: 256
A,B,C,D = gets.chomp.split(' ').map(&:to_i)
countA = C % B == 0 ? C/B : C/B + 1
countC = A % D == 0 ? A/D : A/D + 1

if countA <= countC
    puts('Yes')
else
    puts('No')    
end

Measured memory_bytes: 14392
N, X, Y = map(int,input().split())
a = [0 for _ in range(N - 1)]

for lt in range(1, N+1):
    for rt in range(lt+1, N+1):
        a[min(rt-lt-1, abs(X-lt) + abs(Y-rt))] += 1

print(*a, sep="\n")

Measured memory_bytes: 3444
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>

using namespace std;
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 100000000;
const long long LINF = 1000000000000000000;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-6;
using pii = std::pair<int, int>;
using ll=long long;  
using pLL = std::pair<ll, ll>;

int N;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,w,H,W;
    cin >> H >>W >> h >> w;
    
    cout << (H-h)*(W-w);
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    ArrayList[] year = new ArrayList[n];
    for(int i = 0; i < n; i++) {
      year[i] = new ArrayList<Integer>();
    }
    int[] p = new int[m];
    int[] y = new int[m];
    HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
    for(int i = 0; i < m; i++) {
      p[i] = sc.nextInt() - 1;
      y[i] = sc.nextInt();
      year[p[i]].add(y[i]);
    }
    for(int i = 0; i < n; i++) {
      Collections.sort(year[i]);
      for(int j = 0; j < year[i].size(); j++) {
        map.put((int)year[i].get(j), j + 1);
      }
    }
    for(int i = 0; i < m; i++) {
      p[i]++;
      String s1 = String.valueOf(p[i]);
      String ans1 = s1;
      for(int j = 0; j < 6 - s1.length(); j++) {
        ans1 = "0" + ans1;
      }
      int t2 = map.get(y[i]);
      String s2 = String.valueOf(t2);
      String ans2 = s2;
      for(int j = 0; j < 6 - s2.length(); j++) {
        ans2 = "0" + ans2;
      }
      System.out.println(ans1 + ans2);
    }
  }
}


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

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N,M;
    Scd2(N,M);

    vector<vi> e(N);
    int u,v;
    Rep(i,M){
        Scd2(u,v);
        u--,v--;
        e[u].push_back(v);
        e[v].push_back(u);
    }

    vi d(N,-1);
    deque<int> q;
    d[0] = 0;
    q.push_back(0);

    while(q.size()){
        int from = q.front();
        q.pop_front();
        int di = d[from];

        for( int to : e[from] ){
            if( d[to] == -1 ){
                d[to] = from;
                q.push_back(to);
            }
        }

    }

    YesNo(true);
    Rep(i,N-1){
        printf ("%d\n", d[i+1]+1 );
    }


    return 0;
}



Measured memory_bytes: 10220
#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;
  cin>>n;
  int ans=0;
  rep(i,n){
    if(n<10) ans=n;
    if(n<100&&n>9) ans=9;
    if(n<1000&&n>99) ans=9+n-99;
    if(n<10000&&n>999) ans=909;
    if(n<100000&&n>9999) ans=909+n-9999;
    if(n==100000) ans=90909;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3644
#include <iostream>
#include <math.h>
using namespace std;

int main() {
    int N;
    int D;
    int x[10][10];
    int num_int = 0;

    cin >> N >> D;
    for (int n_i = 0; n_i < N; n_i++) {
        for (int d_i = 0; d_i < D; d_i++) {
            cin >> x[n_i][d_i];
        }
        // kyori
        if (n_i == 0) continue;
        for (int m_i = 0; m_i < n_i; m_i++) {
            // calc kyori m_i vs n_i
            double dist_sq = 0;
            double dist;

            for (int d2_i = 0; d2_i < D; d2_i++) {
                dist_sq += pow(x[m_i][d2_i] - x[n_i][d2_i], 2);
            }
            dist = sqrt(dist_sq);
            if (dist == int(dist))
                num_int++;
        }
    }
    cout << num_int << endl;

    return 0;
}

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

int main(){
int n,a[1000], cnt =0, sum=0;
cin>>n;
 for(int i=0;i<n;i++){
    cin>>a[i];
    if(a[i]%2==0)
        cnt++;
 }
  for(int i=0; i< n; i++){
    if(a[i]%2==0){
        if(a[i]%3==0 || a[i]%5==0)
            sum++;
    }
  }
  if(cnt==sum)
    cout<<"APPROVED";
  else
    cout<<"DENIED";
    return 0;
}



Measured memory_bytes: 3576
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	ll w = in(), a = in(), b = in();
	cout << max(abs(a - b) - w, 0LL) << endl;
}

Measured memory_bytes: 256
function Main(input) {
    const args = input.split(' ');
    var fee;
	var number = parseInt(args[0],10);
    var taxifee = parseInt(args[1],10);
   	var taxiAllFee = number * taxifee
    var trainAllfee = parseInt(args[2],10);
    
    if(taxiAllFee < trainAllfee){
      fee = taxiAllFee
    }else {
      fee = trainAllfee
    }
    
	console.log(fee);
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll N, M;
    cin >> N >> M;
    vector<ll> X(M), dx(M-1);
    rep(i, 0, M) cin >> X[i];
    sort(X.begin(), X.end());
    rep(i, 0, M-1) dx[i] = X[i+1] - X[i];
    sort(dx.begin(), dx.end());
    ll ans = 0;
    rep(i, 0, M-N) ans += dx[i];
    cout << ans << endl;
    return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;
typedef vector<string> vs;
const double pi = acos(-1.0);

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

template<class T>
inline bool chmax(T& a, T b){if(a<b){a=b;return true;} return false;}

template<class T>
inline bool chmin(T& a, T b){if(a>b){a=b;return true;} return false;}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll a,b,c,cnt=0;
	cin >> a >> b >> c;
	REP(i,a,b){
		if(c%i==0) cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 3104