akhauriyash/Code-Regression huggingface dataset:
// Author: wlzhouzhuan
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rint register int
#define rep(i, l, r) for (rint i = l; i <= r; i++)
#define per(i, l, r) for (rint i = l; i >= r; i--)
#define mset(s, _) memset(s, _, sizeof(s))
#define pb push_back
#define pii pair <int, int>
#define mp(a, b) make_pair(a, b)

inline int read() {
  int x = 0, neg = 1; char op = getchar();
  while (!isdigit(op)) { if (op == '-') neg = -1; op = getchar(); }
  while (isdigit(op)) { x = 10 * x + op - '0'; op = getchar(); }
  return neg * x;
}
inline void print(int x) {
  if (x < 0) { putchar('-'); x = -x; }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}

double x;
int main() {
  scanf("%lf", &x);
  x /= 3.0;
  printf("%.12lf\n", x * x * x);
  return 0;
}

Measured memory_bytes: 256
function Main(s) {
	s = s.split("\n");
	var n = parseInt(s[0]);
	var a = {0:0};
	for(var i = 0; i < n; i++){
		if(!a[s[i+1]]) a[s[i+1]] = 1;
		else a[s[i+1]]++;
	}
	var m = parseInt(s[n+1]);
	for(var i = 0; i < m; i++){
		if(a[s[n+i+2]]) a[s[n+i+2]]--;
	}
	var max = 0;
	for(i in a){
		if(max < a[i]) max = a[i];
	}
	console.log(max);
}

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

Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
#define nl '\n' 
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define pii pair <int,int>
ll mod=1000000007;
int main()
{
	fast;
	ll a,b;cin>>a>>b;
	vector<ll>v;
	if(a%2==0 && b%2==0)
	{
		v.push_back(2);
		while(a%2==0)
		{
			a=a/2;
		}
		while(b%2==0)
		{
			b=b/2;
		}

	}
	else
	{
		if(a%2==0)
		{
			a=a/2;
		}
		if(b%2==0)
		{
			b=b/2;
		}
	}
	//cout<<b<<nl;
	ll limit=(sqrt(a),sqrt(b));
	for(int i=3;i<=limit+1;i+=2)
	{
		if(a%i==0 && b%i==0)
		{
			v.push_back(i);
			while(a%i==0)
			{
				a=a/i;
			}
			while(b%i==0)
			{
				b=b/i;
			}
		}
		else
		{
			while(a%i==0)
			{
				a=a/i;
			}
			while(b%i==0)
			{
				b=b/i;
			}
		}
	}
	if(a==b && a>1)
		v.push_back(a);
	
	cout<<v.size()+1;
}

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

namespace contest_Csharp
{

    class Program
    {
        public static (long m, long s)[,] dp;
        public static long mod;


        static void Main(string[] args)
        {
            checked
            {
                var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
                Console.SetOut(sw);

                var vals = Console.ReadLine().Split(' ')
                    .Select(x => long.Parse(x)).ToList();


                var N = vals[0];
                var M = vals[1];

                var crastar = 0;
                var parent = new int[N + 1];
                var treesize = new int[N + 1];
                int root(int n)
                {
                    if (parent[n] == n)
                        return n;
                    else
                        return root(parent[n]);
                }
                for (int i = 0; i < N + 1; i++)
                {
                    parent[i] = i;
                    treesize[i] = 1;
                }
                //読み込み
                for (int i = 0; i < M; i++)
                {
                    var v = Console.ReadLine().Split(' ').
                    Select(x => int.Parse(x)).ToList();
                    var A = v[0];
                    var B = v[1];
                    var RA = root(A);
                    var RB = root(B);
                    if (RA != RB)
                    {
                        if (treesize[RA] >= treesize[RB])
                        {
                            parent[RB] = RA;
                            treesize[RA] += treesize[RB];
                        }
                        else
                        {
                            parent[RA] = RB;
                            treesize[RB] += treesize[RA];
                        }
                    }
                }
                var checker = new bool[N + 1];
                for (int i = 0; i < N; i++)
                {
                    if (!checker[root(i+1)])
                    {
                        crastar++;
                        checker[root(i + 1)] = true;
                    }
                    

                }
                Console.WriteLine(crastar-1);

                Console.Out.Flush();
            }//cheked

        }
        
    }

}




Measured memory_bytes: 42312
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> T;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define revrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define f first
#define s second
#define pb push_back

const ll mod = 1000000007;
const ll INF = 100000010000;

ll kai[100010];
ll bit[700010];

void pres(double A, ll x = 20) { printf("%.20f\n", x); }

/*ll sum(ll i)
{
	ll s = 0;
	while (i > 0)
	{
		s += bit[i];
		i -= i & -i;
	}
	return s;
}

void add(ll i, ll x)
{
	while (i <= 700005)
	{
		bit[i] += x;
		i += i & -i;
	}
}*/

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}

ll pow_mod(ll x, ll y) {
	if (y == 0) return 1;
	if (y % 2 == 1) {
		return x * pow_mod(x, y - 1) % mod;
	}
	else {
		ll half = pow_mod(x, y / 2);
		return half * half % mod;
	}
}

ll div_mod(ll x) {
	return pow_mod(x, mod - 2);
}

ll com(ll x, ll y) {
	return kai[x] * div_mod(kai[y] * kai[x - y] % mod) % mod;
}

ll H;
map<ll, ll> mp;

ll fu(ll h) {
	if (mp[h] != 0) {
		return mp[h];
	}
	else if (h == 1) {
		return mp[1] = 1;
	}
	else {
		return mp[h] = 2 * fu(h / 2) + 1;
	}
}

void solve() {
	cin >> H;
	cout << fu(H) << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	ll N;
	cin >> N;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mxn 100005
#define mp make_pair
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long int ll;
int main(){
	int n; cin>>n;
	ll ar1[n],ar2[n],ar3[n];
	for(int i=0; i<n; i++){
	     cin>>ar1[i]>>ar2[i]>>ar3[i];
	}
	ll dp[n][3];
	dp[0][0] = ar1[0];
	dp[0][1] = ar2[0];
	dp[0][2] = ar3[0];
	for(int i=1; i<n; i++){
		dp[i][0] = max(dp[i-1][1]+ar1[i], dp[i-1][2]+ar1[i]);
		dp[i][1] = max(dp[i-1][0], dp[i-1][2])+ar2[i];
		dp[i][2] = max(dp[i-1][0], dp[i-1][1])+ar3[i];
	}
	cout<<max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
}

Measured memory_bytes: 8312
import math

n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        s = 0
        for k in range(d):
            s += (x[i][k] - x[j][k])**2
        if math.sqrt(s) % 1 == 0:
            cnt += 1
print(cnt)

Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>
using namespace std;
#define INF 1000000007
#define ll long long
#define rep(i, start, end) for(ll i=(ll)start; i<(ll)end; i++)
#define print(a) cout << a << endl;
#define printarray(a, len) rep(i,0,len) cout << a[i] << " ";
 
bool distance(double a[], double b[], ll d){
  double total=0;
  rep(i, 0, d){
    total += (a[i] - b[i]) * (a[i] - b[i]);
  }
  if ((ll)(sqrt(total)) == sqrt(total)){
    return true;
  }else{
    return false;
  }
}

int main(){
  ll n, d, count=0;
  double x[11][11] = {};
  cin >> n >> d;
  rep(i, 0, n){
    rep(j, 0, d){
		cin >> x[i][j];
    }
  }
  rep(i, 0, n-1){
    rep(j, i+1, n){
      if (distance(x[i], x[j], d)) count++;
    }
  }
  print(count);
  
  return 0;
}

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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int N; cin >> N;
    vector<int> a( N );
    int zero = 0;
    set<int> st;
    REP( i, N ) {
        cin >> a[i];
        if( a[i] == 0 ) {
            zero++;
        }
        st.insert( a[i] );
    }

    sort( ALL( a ) );

    if( zero == N ) {
        cout << "Yes" << endl;
        return 0;
    }

    if( zero == 1 && st.size() == 2 ){
        cout << "Yes" << endl;
        return 0;
    }

    if( N % 3 == 0 ){
        if( zero != 0  && st.size() == 2 ){
            if( ( N - zero ) == zero * 2 ){
                cout << "Yes" << endl;
                return 0;
            }
        }

        if( st.size() == 3 ){
            int x = a[0];
            int y = *upper_bound( ALL( a ), x );
            int z = *upper_bound( ALL( a ), y );

            if( (int)(x ^ y) == z && count( ALL( a ), x ) == count( ALL( a ), y ) && count( ALL( a ), y ) == count( ALL( a ), z )  ){
                cout << "Yes" << endl;
                return 0;
            }
        }
        cout << "No" << endl;

    }else{
        cout << "No" << endl;
    }

}

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

int main() {
  LL n, p;
  cin >> n >> p;

  vector<pair<LL, LL>> a;
  LL tmp = p;
  for (LL i = 2; i * i <= p; i ++) {
    if (tmp % i != 0) continue;
    LL cnt = 0;
    while (tmp % i == 0) {
      cnt ++;
      tmp /= i;
    }
    a.push_back(make_pair(i, cnt));
  }
  if (tmp > 1) a.push_back(make_pair(tmp, 1));

  LL ans = 1;
  for (int i = 0; i < a.size(); i ++) {
    for (int j = 0; j < a[i].second / n; j ++) ans *= a[i].first;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define sim template < class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                        \
    sim > typename enable_if< sizeof dud< c >(0) x 1, debug & >::type operator<<(c i) \
    {
sim > struct rge
{
    c b, e;
};
sim > rge< c > range(c i, c j) { return rge< c >{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug
{
#ifdef XOX
    ~debug()
    {
        cerr << endl;
    }
    eni(!=) cerr << boolalpha << i;
    ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair< b, c > d)
{
    ris << "" << d.first << " --> " << d.second << "";
}
sim dor(rge< c > d)
{
    *this << "[";
    for (auto it = d.b; it != d.e; ++it)
        *this << ", " + 2 * (it == d.b) << *it;
    ris << "]";
}
#else
    sim dor(const c &)
    {
        ris;
    }
#endif
}
;
#define imie(...) "" << #__VA_ARGS__ " = " << (__VA_ARGS__) << ", "

#define F first
#define S second
#define endl '\n'
#define pb emplace_back
#define mp make_pair
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define all(v) (v).begin(), (v).end()
#define lb(v, val) (lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (upper_bound(v.begin(), v.end(), val) - v.begin())
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie();                    \
    cout.tie()
#define min3(x, y, z) (x < y ? (x < z ? x : z) : (y < z ? y : z))
#define max3(x, y, z) (x > y ? (x > z ? x : z) : (y > z ? y : z))
#define MAX_N int(1e6 + 7)
#define MAX_M int(1e6 + 7)
#define MAX_V int(1e6 + 7)
#define oo int(1e9 + 217)
#define MOD int(1e9 + 7)
using ll = long long;
using vi = vector< int >;
using vl = vector< ll >;
using vpii = vector< pair< int, int > >;
using pii = pair< int, int >;

typedef tree<
    int,
    null_type,
    less< int >,
    rb_tree_tag,
    tree_order_statistics_node_update >
    oset;

vi G[ MAX_V ];
bool visited[ MAX_V ];
int tans;

void dfs(int v)
{
    visited[ v ] = 1;
    tans++;
    for (auto u : G[ v ])
        if (not visited[ u ])
            dfs(u);
}

void edge(int a, int b)
{
    G[ a ].pb(b);
    G[ b ].pb(a);
}

int main()
{
    fast;
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
    {
        int a, b;
        cin >> a >> b;
        edge(a, b);
    }
    int ans = -oo;
    for (int i = 1; i <= n; i++)
        if (not visited[ i ])
        {
            tans = 0;
            dfs(i);
            ans = max(ans, tans);
        }
    cout << ans;
}

Measured memory_bytes: 39756
#include <bits/stdc++.h>
#include <experimental/iterator>

/* snippet: useful macros and functions */
#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
template<class T> T ant(const T &a, const T &b){ return a > b ? a : b; }
template<class T> T ont(const T &a, const T &b){ return a < b ? a : b; }
template<class T> T rng(const T &a, const T &b){ return a < b ? b - a : a - b; }
template<class T> void th(T &a, const T &b, T (*f)(const T &, const T &)){ a = f(a, b); }
#define anth(a, b) th(a, b, ant)
#define onth(a, b) th(a, b, ont)

/* debug */
auto debug = std::experimental::make_ostream_joiner(std::cout, " ");

/* snippet: modint library */
template<class T, int MOD>
class Modint{
	T val;
public:
	Modint(T val = 0) : val(val % MOD + (val > 0 ? 0 : MOD)) {}
	operator T(){ return val; }
	Modint &operator+=(const Modint &a){ val += a.val; if(val >= MOD) val -= MOD; return *this; }
	Modint &operator-=(const Modint &a){ val -= a.val; if(val < 0) val += MOD; return *this; }
	Modint &operator*=(const Modint &a){ val = val * a.val % MOD; return *this; }
	void inverse(){T x[2]={MOD,val},a[2]={0,1};int i;for(i=0;x[!i];i^=1){a[i]-=x[i]/x[!i]*a[!i];x[i]=x[i]%x[!i];}if(!i)a[i]+= MOD;val=a[i];}
	Modint &operator/=(Modint a){ a.inverse(); return *this *= a; }
	friend Modint modpow(Modint a, int n){ Modint ret(1); while(n){ if(n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
	friend Modint operator+(Modint a, const Modint &b){ return a += b; }
	friend Modint operator-(Modint a, const Modint &b){ return a -= b; }
	friend Modint operator*(Modint a, const Modint &b){ return a *= b; }
	friend Modint operator/(Modint a, const Modint &b){ return a /= b; }
	friend std::ostream &operator<<(std::ostream &os, const Modint &a){ return os << a.val; }
};

/* snippet: using declarations */
using Int = long long;
using std::cout;
using std::cin;
using std::endl;
using Mint = Modint<long long, 1000000007>;

Int n, k;
Int a[212345];

int main(){
	cin >> n >> k;
	RC(i, n){
		Int tmp;
		cin >> tmp;
		a[i] = tmp - 1;
	}
	Int x = 0, y = 0;
	Int count = 0;
	do{
		x = a[x];
		y = a[a[y]];
		++count;
	}while(x != y);
	Int t = 0;
	x = 0;
	while(x != y){
		x = a[x];
		y = a[y];
		++t;
	}
	// cout << t << " " << count << endl;
	k = t + (k - t) % count;
	x = 0;
	for(Int i = 0; i < k; ++i){
		x = a[x];
	}
	cout << x + 1 << endl;
}


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

int main()
{
	ll a,b,c;
  cin >> a>>b>>c;
  ll ans=0;
  if(a%2==1||b%2==1||c%2==1){
    cout << ans << endl;
    return 0;
  }
  if(a==b&&b==c) {
    cout << -1 << endl;
    return 0;
  }
  while(true){
    if(a%2==1||b%2==1||c%2==1){
      break;
    }
    ll tmpA,tmpB,tmpC;
    tmpA=b/2+c/2;
    tmpB=a/2+c/2;
    tmpC=a/2+b/2;
    a=tmpA;
    b=tmpB;
    c=tmpC;
    ans++;
  }
  cout <<ans<<endl;
}

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

int main()
{
    char s[4];
    cin >> s;
    if(s[0]==s[1]&&s[1]==s[2]){
        if(s[0]=='R')
            cout << 3 ;
        else
            cout << 0;
    }
    else if(s[0]==s[1]||s[1]==s[2]){
        if(s[1]=='R')
            cout <<2 ;
        else
            cout << 1 ;
    }
    else
        cout << 1 <<endl;
    return 0;
}


Measured memory_bytes: 3564
import re

S = input()
without_x = ''.join([s for s in S if s != 'x'])
if without_x != without_x[::-1]: print(-1)
elif S == S[::-1]: print(0)
else:
    ans = 0
    x_lists = re.split('[{}]'.format(''.join(list(set(without_x)))), S)
    n = len(x_lists); i = 0
    while i < n-1-i:
        ans += abs(len(x_lists[i]) - len(x_lists[n-1-i]))
        i += 1
    print(ans)

Measured memory_bytes: 4336
H, W, K = map(int, input().split())
for n in range(W+1):
    if W == n+n:
        continue
    l = (K-H*n)//(W-2*n)
    if 0 <= l <= H and H*n+(W-2*n)*l == K:
        print('Yes')
        exit()
print('No')


Measured memory_bytes: 38384
from collections import Counter

n = int(input())
v = list(map(int,input().split()))
a1,a0 = [] , []

for i in range(n):
    if i%2 == 0:
        a0.append(v[i])
    else:
        a1.append(v[i])
        
b0 = Counter(a0)
b1 = Counter(a1)
b0[0] = 0
b1[0] = 0

if max(b0,key=b0.get) != max(b1,key=b1.get):
    ans = n - max(b0.values()) - max(b1.values())
else:
    q = max(b0.values())
    r = max(b1.values())
    b0.pop(max(b0,key=b0.get))
    b1.pop(max(b1,key=b1.get))
    ans = min(n - max(b0.values()) - r , n - q - max(b1.values()))
    
print(ans)

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

int main(){
  vector<int> a(3);
  cin >> a.at(0) >> a.at(1) >> a.at(2);
  sort(a.begin(), a.end());
  
 if(a.at(0) == a.at(1)){
   if(a.at(1) != a.at(2)){
     cout << "Yes" << endl;
     return 0;
   }
 }
 else{
   if(a.at(1) == a.at(2)){
     cout << "Yes" << endl;
     return 0;
   }
 }
 cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#![allow(unused_imports, unused_macros, unknown_lints)]

use std::collections::{VecDeque, HashSet, HashMap, BinaryHeap};
use std::cmp::{max, min, Ordering};

macro_rules! dump {[$($e:expr), +] => {println!(concat!($(stringify!($e), " = {:?}\n"), +), $($e), +)}}
macro_rules! max {[$e0:expr, $($e:expr), +] => {{let mut r = $e0; $(r = max(r, $e);)+ r}}}
macro_rules! min {[$e0:expr, $($e:expr), +] => {{let mut r = $e0; $(r = min(r, $e);)+ r}}}
macro_rules! freq {($v:expr) => {{let mut h = HashMap::new(); for x in $v {*h.entry(x).or_insert(0) += 1} h}}}

fn main() {
  let (mut x,y) = get::tuple::<usize,usize>();

  let mut ans = 1;
  while x*2 <= y {
    x *= 2;
    ans += 1
  }

  println!("{}", ans)
}

#[allow(dead_code)]
mod get {
  use std::io::*;
  use std::str::*;

  pub fn val<T: FromStr>() -> T {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    buf.trim_right().parse::<T>().ok().unwrap()
  }

  pub fn vals<T: FromStr>(n: usize) -> Vec<T> {
    let mut vec: Vec<T> = vec![];
    for _ in 0 .. n {
      vec.push(val());
    }
    vec
  }

  pub fn tuple<T1: FromStr, T2: FromStr>() -> (T1, T2) {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    let mut it = buf.trim_right().split_whitespace();
    let x = it.next().unwrap().parse::<T1>().ok().unwrap();
    let y = it.next().unwrap().parse::<T2>().ok().unwrap();
    (x, y)
  }

  pub fn tuples<T1: FromStr, T2: FromStr>(n: usize) -> Vec<(T1, T2)> {
    let mut vec: Vec<(T1, T2)> = vec![];
    for _ in 0 .. n {
      vec.push(tuple());
    }
    vec
  }

  pub fn tuple3<T1: FromStr, T2: FromStr, T3: FromStr>() -> (T1, T2, T3) {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    let mut it = buf.trim_right().split_whitespace();
    let x = it.next().unwrap().parse::<T1>().ok().unwrap();
    let y = it.next().unwrap().parse::<T2>().ok().unwrap();
    let z = it.next().unwrap().parse::<T3>().ok().unwrap();
    (x, y, z)
  }

  pub fn tuple3s<T1: FromStr, T2: FromStr, T3: FromStr>(n: usize) -> Vec<(T1, T2, T3)> {
    let mut vec: Vec<(T1, T2, T3)> = vec![];
    for _ in 0 .. n {
      vec.push(tuple3());
    }
    vec
  }

  pub fn vec<T: FromStr>() -> Vec<T> {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    buf.trim_right().split_whitespace().map(|t| t.parse::<T>().ok().unwrap()).collect()
  }

  pub fn mat<T: FromStr>(h: usize) -> Vec<Vec<T>> {
    let mut mat = vec![];
    for _ in 0 .. h {
      mat.push(vec());
    }
    mat
  }

  pub fn chars() -> Vec<char> {
    let mut buf = String::new();
    let s = stdin();
    s.lock().read_line(&mut buf).ok();
    buf.trim_right().chars().collect()
  }
}

#[allow(dead_code)]
mod put {
  use std::string::*;

  pub fn vec<T: ToString>(vec: &Vec<T>, sep: &str) {
    let out = vec.iter().map(|e| e.to_string()).collect::<Vec<_>>().as_slice().join(sep);
    println!("{}", out);
  }

  pub fn mat<T: ToString>(mat: &Vec<Vec<T>>, sep: &str) {
    for v in mat {
      vec(v, sep);
    }
  }
}


Measured memory_bytes: 4352
#include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main() {
    int N,K;
    cin >> N>> K;
    
    if (K==1) {
        cout << 0 << endl;
    }
    else{
        cout << (N-K) << endl;
    }
    
}


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

int main(){
    string s, t;
    cin >> s >> t;
    sort(s.begin(),s.end());
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());
    if(s < t){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int M; cin >> M;
	cout << 48-M << endl;
	return 0;
}

Measured memory_bytes: 256
//includes
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#include<assert.h>
#include<cstring>
#include<unordered_map>
#include<bitset>


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

//macros and consts
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define FORE(i,a) for(auto &i : a)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define accm accumulate
#define Fi first
#define Se second
#define INF 1e9
#define llINF (1LL<<60)
#define mINF -1e9
#define mllINF -(1LL<<60)
#define endl "\n"
#define CONT continue
#define BRK break
#define modulo(n, m) (((n)%(m)+(m))%m)

//shorter types
using namespace std;
using ll = long long;
using vi = std::vector<int>;
using vc = std::vector<char>;
using vll = std::vector<long long>;
using vs = std::vector<string>;
using Mi = map<int,int>;
using Mll = map<ll,ll>;
using UMi = unordered_map<int,int>;
using UMll = unordered_map<ll,ll>;
using Pi = pair<int,int>;
using Pll = pair<ll,ll>;
using vPi = vector<Pi>;
using vPll = vector<Pll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pqgi = priority_queue<int,vector<int>,greater<int>>;
using pqsi = priority_queue<int,vector<int>,less<int>>;
using pqgll = priority_queue<int,vector<int>,greater<int>>;
using pssll = priority_queue<int,vector<int>,less<int>>;
template<class T>
using vec = vector<T>;
#define int long long
int N;
//here begins your code
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  vector<int> A;
  cin >> N;
  A.resize(N);
  REP(i,N){
  	cin >> A[i];
  }
  vector<int> ans(N,0);


  for(int i = 0; i < N; i++){
  	if(i == 0){
  		for(int j = 0; j < N; j++){
  			if(j % 2 == 0){
  				ans[i] += A[j];
  			}
  			else{
  				ans[i] -= A[j];
  			}
  		}
  	}
  	else{
  		ans[i] = ans[i - 1] * (-1) + 2 * A[i - 1];
  	}
  }

  for(int i = 0; i < N; i++){
  	cout << ans[i] << " ";
  }
  cout << endl;
  //check types
  //do not eb if you resize
  //resize before you access by idx
  return 0;
} 

Measured memory_bytes: 2944
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}

ld cal(ll num, ll aim){
    ld ans = 1.0;
    while(num < aim){
        num *= 2;
        ans *= (ld)(0.5);
    }
    return ans;
}

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

    ll N , K ;
    cin >> N >> K ;

    ld ans = 0 ;
    rep(i, N){
        ans += (1.0)/((ld)N) * cal(i+1, K);
    }
    cout << fixed << setprecision(16) << ans << endl;
    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            char[] array = sc.chararr;
            int count = 0;

            for(int i=0; i<array.Length; i++)
            {
                if(array[i] == '+')
                {
                    count += 1;
                }
                else
                {
                    count -= 1;
                }
            }

            wr.wri(count);
        }
    }

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

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

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


    }



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


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

int main() {
    ios_base::sync_with_stdio(false);

    
    string s;
    cin >> s;
    
    int start = s[0];
    bool all_same = true;
    for(auto a: s) {
        if(a != start) {
            all_same = false;
        }
    }
    
    if(all_same) {
        cout << s << "\n";
    } else {
        string tmp = "";
        tmp += start; tmp += start; tmp += start;
        int curr_num = stoi(tmp);
        int actual_num = stoi(s);

        if(curr_num < actual_num) {
            start++;
            tmp = "";
            tmp += start; tmp += start; tmp += start;
        }

        

        cout << tmp << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int n;
    scanf("%d",&n);
    int c[n];
    for(int i=0;i<n;i++){
        scanf("%d",c+i);
    }
    int d[200005];
    long long f[n];
    f[0]=1;
    int e[200005];
    for(int i=0;i<200005;i++)e[i]=0;
    long long p=1000000007;
    e[c[0]]++;
    d[c[0]]=0;
    for(int i=1;i<n;i++){
        if((e[c[i]]==0)||c[i]==c[i-1]){
            f[i]=f[i-1];
        }
        else{
            f[i]=f[i-1]+f[d[c[i]]];
            f[i]%=p;
        }
        d[c[i]]=i;
        e[c[i]]++;
    }
    printf("%lld\n",f[n-1]);
}

Measured memory_bytes: 4096
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;
typedef long long ll;
#include <cstring>
int bit[500001], n;

int sum(int i) {
  int s = 0;
  while (i > 0) {
    s += bit[i];
    i -= (i & -i);
  }
  return s;
}

void add(int i, int x) {
  while (i <= n) {
    bit[i] += x;
    i += (i & -i);
  }
}
int main() {
  int q, a, l, r;

  vector<pair<pair<int, int>, int> > v;
  cin >> n >> q;
  vector<set<int> > s(n + 1);
  vector<int> ans(q);
  for (int i = 0; i < n; i++) {
    cin >> a;
    s[a].insert(i + 1);
  }
  for (int i = 0; i <= n; i++) {
    set<int>::iterator it = s[i].begin();
    for (; it != s[i].end(); it++) {
      set<int>::iterator it2 = it;
      it2++;
      if (it2 != s[i].end()) {
        v.push_back({{*it2, -1}, *it});
      }
    }
  }
  for (int i = 0; i < q; i++) {
    cin >> l >> r;
    v.push_back({{r, i}, l});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first.second == -1) {
      add(v[i].second, 1);
    } else {
      ans[v[i].first.second] = v[i].first.first - v[i].second + 1 -
                               sum(v[i].first.first) + sum(v[i].second - 1);
    }
  }
  for (int i = 0; i < q; i++) {
    cout << ans[i] << endl;
  }
}


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

typedef long long ll;
//loop
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//STL
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

//const
#define MOD 1000000007 //10^9+7:合同式の法

//acronym
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

void Main() {
    ll a, b;
    string op;
    cin >> a >> op >> b;
    if (op == "+") {
        cout << a + b << endl;
    } else {
        cout << a -b << endl;
    }
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	Main();
	return 0;
}


Measured memory_bytes: 256
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N = int(readline())
S = [readline().rstrip() for i in range(N)]

from collections import Counter

Sc = Counter(S)
print("AC x", Sc["AC"])
print("WA x", Sc["WA"])
print("TLE x", Sc["TLE"])
print("RE x", Sc["RE"])


Measured memory_bytes: 16704
#include <iostream>
#include <algorithm>
#include <cstring>
#include <limits>
using namespace std;

int main() {
	int n;
	cin >> n;
	int vals[n][3];
	for (int i = 0; i < n; i++) {
		cin >> vals[i][0] >> vals[i][1] >> vals[i][2];
	}
	int dp[n][3];
	for (int i = 0; i < n; i++) {
		memset(dp[i], 0, sizeof(int)*3);
	}
	dp[0][0] = vals[0][0];
	dp[0][1] = vals[0][1];
	dp[0][2] = vals[0][2];
	for (int i = 1; i < n; i++) {
		for (int j = 0; j < 3; j++) {
			dp[i][j] = max(dp[i-1][(j+1)%3] + vals[i][j], dp[i-1][(j+2)%3] + vals[i][j]);
		}
	}
	cout << max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
}

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

int main()
{
  int N,M,r,q,t[1000],n[1000],m[1000],s[1000],ts,te,stu,sum,log,res;

  for(;;){
    cin>>N>>M;
    if(!(N|M)) break;
    cin>>r;
    for(int i=0;i<r;i++)
      cin>>t[i]>>n[i]>>m[i]>>s[i];
    cin>>q;
    for(int i=0;i<q;i++){
      cin>>ts>>te>>stu;
      sum=0; log=0;
      for(int j=0;j<r;j++){
	if(m[j]!=stu) continue;
	if(s[j]){
	  log++;
	  if(log==1) res=t[j];
	} else {
	  log--;
	  if(!log&&ts<=t[j]&&res<=te) sum+=(min(te,t[j])-max(ts,res));
	}
      }
      cout<<sum<<endl;
    }
  }
}


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

int bubleSort(int a[], int n)
{
	int cnt = 0;
	for (int i = 0; i < n; ++i)
	{
		for (int j = n-1; j>=i+1; --j)
		{
			if (a[j-1] > a[j])
			{
				swap(a[j-1], a[j]);
				cnt++;
			}
		}
	}
	return cnt;
}

void swap(int& a, int& b)
{
	int temp = a;
	a = b;
	b = temp;
}
void solve()
{
	int n;
	int a[105];
	cin >> n;
	for (int i = 0; i<n; ++i) cin >> a[i];
	int ans = bubleSort(a, n);
	for (int i = 0; i < n-1; ++i) printf("%d ", a[i]);
	printf("%d", a[n - 1]);
	printf("\n");
	printf("%d\n", ans);
}
int main()
{
	solve();
	return 0;
}

Measured memory_bytes: 3156
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <assert.h>
#include <sys/time.h>
#include <fstream>
#include <iomanip>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define REP(i,n)  FOR(i,0,n)
#define each(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define deb(x) cerr << #x << " = " << (x) << " , ";
#define debl cerr << " (L" << __LINE__ << ")"<< endl;
#define sz(s) (int)((s).size())


#define clr(a) memset((a),0,sizeof(a))
#define nclr(a) memset((a),-1,sizeof(a))
#define pb push_back
#define INRANGE(x,s,e) ((s)<=(x) && (x)<(e))
#define MP(x,y) make_pair((x),(y))

double pi=3.14159265358979323846;

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

template<typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& z){
	os << "[ ";
	REP(i,z.size())os << z[i] << ", " ;
	return ( os << "]" << endl);
}

template<typename T> std::ostream& operator<<(std::ostream& os, const set<T>& z){
	os << "set( ";
	EACH(p,z)os << (*p) << ", " ;
	return ( os << ")" << endl);
}

template<typename T,typename U> std::ostream& operator<<(std::ostream& os, const map<T,U>& z){
	os << "{ ";
	EACH(p,z)os << (p->first) << ": " << (p->second) << ", " ;
	return ( os << "}" << endl);
}

template<typename T,typename U> std::ostream& operator<<(std::ostream& os, const pair<T,U>& z){
	return ( os << "(" << z.first << ", " << z.second << ",)" );
}

double get_time(){
	struct timeval tv;
	gettimeofday(&tv, NULL);
	return tv.tv_sec + tv.tv_usec*1e-6;
}

typedef unsigned int uint32_t;
struct RND{
	uint32_t x;
	uint32_t y;
	uint32_t z;
	uint32_t w;
	RND(){
		x=123456789;
		y=362436069;
		z=521288629;
		w=88675123;
	}
	void init(int seed){
		x=123456789;
		y=362436069;
		z=521288629;
		w=seed+100;
		REP(i,10)get();
	}
	uint32_t get(){
		uint32_t t;
		t=x^(x<<11);
		x=y;y=z;z=w;
		w=(w^(w>>19))^(t^(t>>8));
		return w;
	}
};
RND rnd;

ll double_to_ll(double d){
	if(d>0)return d+0.5;
	return d-0.5;
}

void _main(istream &inp){
	string s;
	inp >> s;
	rep(i,s.size()) for(int j=i+1; j<s.size(); j++) if(s[i]=='C' && s[j]=='F'){
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;

}

int main(){
	if(0){
		ifstream ifs("test.txt");
		_main(ifs);
	}
	else{
		_main(cin);
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

int main() {
	int n;
	cin >> n;
	int maxv = 0;
	vector<vector<int>>a(2, vector<int>(n));
	repp(i, 0, 2)repp(j, 0, n)cin >> a[i][j];
	repp(i, 0, n) {
		int sum = 0;
		repp(j, i, n)sum += a[1][j];
		repp(j, 0, i+1)sum += a[0][j];
		maxv = max(maxv, sum);
	}
	cout << maxv << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

#define all(a) (a).begin(), (a).end()

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

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

    ll a, b, c; cin>>a>>b>>c;
    ll l = 4 * a * b, r = (c - a - b) * (c - a - b);

    if(c - a - b < 0){
        cout << "No" << endl;
        return 0;
    }

    cout << (l < r ? "Yes" : "No") << endl;


    return 0;
}

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


def solve(N: int, T: "List[int]"):
    def gcd(a, b):
        if b == 0:
            return a
        return gcd(b, a % b)
    ret = T[0]
    for t in T:
        g = gcd(ret, t)
        ret = ret * t // g

    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, T)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		if(A==B) {
			System.out.println(C);
		} else if(B==C) {
			System.out.println(A);
		} else {
			System.out.println(B);
		}
	}
	
	// print
	static void print(String s) {
		System.out.println(s);
	}
	
	// union find lib
	// usage:
	// 最初にinitを呼ぶ
	// root: 直接は呼ばないで
	// unite: まとめる
	// same: グループ判定
	static void init(int par[], int N) {
		for(int i=0; i<N; i++) {
			par[i] = i;
		}
	}
	
	static int root(int x, int [] par) {
		if(par[x] == x) {
			return x;
		} else {
			return (par[x] = root(par[x], par));
		}
	}
	
	static boolean same(int x, int y, int[] par) {
		return root(x, par) == root(y, par);
	}
	
	static void unite(int x, int y, int[] par) {
		x = root(x, par);
		y = root(y, par);
		if(x == y) return;
		par[x] = y;
	}
	
	// end union find lib
	
	// number lib
	
	static int max(int...ls) {
		int ans = Integer.MIN_VALUE;
		for(int i=0; i<ls.length; i++) {
			ans = Math.max(ans, ls[i]);
		}
		return ans;
	}
	
	static int min(int...ls) {
		int ans = Integer.MAX_VALUE;
		for(int i=0; i<ls.length; i++) {
			ans = Math.min(ans, ls[i]);
		}
		return ans;
	}
	
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
	
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	
	// end number lib
}

Measured memory_bytes: 21844
from collections import Counter

N = int(input())
blue = list(input() for _ in range(N))
M = int(input())
red = list(input() for _ in range(M))

blue2 = Counter(blue)
red2 = Counter(red)

blue2.subtract(red2)
for word, cnt in blue2.most_common(1):
    if cnt < 0:
        print(0)
    else:
        print(cnt)


Measured memory_bytes: 3316
# _*_ coding:utf-8 _*_
#  Atcoder_BEGINNERS_Contest123-A
#  TODO https://atcoder.jp/contests/abc123/tasks/abc123_a

def solveProblem(a,b,c,d,e,k):
	if k < b - a :return ":("
	if k < c - a :return ":("
	if k < d - a :return ":("
	if k < e - a :return ":("
	if k < c - b :return ":("
	if k < d - b :return ":("
	if k < e - b :return ":("
	if k < d - c :return ":("
	if k < e - c :return ":("
	if k < e - d :return ":("
	return "Yay!"


if __name__ == '__main__':
	a = int(input().strip())
	b = int(input().strip())
	c = int(input().strip())
	d = int(input().strip())
	e = int(input().strip())
	k = int(input().strip())
	solution = solveProblem(a,b,c,d,e,k)
	print("{}".format(solution))


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

int main(){
  string code;
  cin >> code;
  int sub1= stoi(code.substr(0,2));
  int sub2= stoi(code.substr(2,2));

  auto as_month= [](int a){
    return 1<= a && a<= 12;
  };

  string ans= ( as_month(sub1) &&  as_month(sub2)) ? "AMBIGUOUS"
             :( as_month(sub1) && !as_month(sub2)) ? "MMYY"
             :(!as_month(sub1) &&  as_month(sub2)) ? "YYMM"
                                                   : "NA";
  cout << ans << endl;
}

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

int main(){
  
  for(int i = 1; ; i++){
    int x;
    cin >> x;
    if(x==0){
      break;
    }
    cout << "Case " << i << ": " << x << endl;
  }
     
  return 0;
}



Measured memory_bytes: 3048
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		long x = fs.nextLong();
		long y = fs.nextLong();
		
		if(x == y) {
			System.out.println(0);
			return;
		}
		
		long absX = Math.abs(x);
		long absY = Math.abs(y);
		
		long ans = 0;
		
		if(absY >= absX) {
			ans += absY - absX;
			if(x < 0) {
				ans++;
			}
			
			if(y < 0) {
				ans++;
			}
		}else {
			ans += absX - absY;
			if(x > 0) {
				ans++;
			}
			
			if(y > 0) {
				ans++;
			}
		}
		
		System.out.println(ans);
		
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}


}


Measured memory_bytes: 23252
import math
def koch(left, right, n):
    if n < 1: print(" ".join(map(str, left))); return
    
    s, t, u = [0] * 2, [0] * 2, [0] * 2
    s[0] = (2 * left[0] + right[0]) / 3.0
    s[1] = (2 * left[1] + right[1]) / 3.0
    
    t[0] = (left[0] + 2 * right[0]) / 3.0
    t[1] = (left[1] + 2 * right[1]) / 3.0
    
    u[0] = (t[0] - s[0]) * math.cos(math.pi/3) - (t[1] - s[1]) * math.sin(math.pi/3) + s[0]
    u[1] = (t[0] - s[0]) * math.sin(math.pi/3) + (t[1] - s[1]) * math.cos(math.pi/3) + s[1]
    
    koch(left, s, n-1)
    koch(s, u, n-1)
    koch(u, t, n-1)
    koch(t, right, n-1)
    
n = int(input())
left = [0, 0]
right = [100, 0]

koch(left, right, n)
print(right[0], right[1])


Measured memory_bytes: 5740
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,ans=1;
	cin >> n;
	int a[n];
	for(int i=0;i<n;i++)
		cin >> a[i];
	sort(a,a+n);
	for(int i=0;i<n-1;i++)
		if(a[i]<a[i+1])
			ans++;
	cout << ans << endl;
	return 0;
} 

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

int main(){
    std :: string str;
    std :: cin >> str;
    if(str == "SAT")
        std :: cout << 1 << '\n';
    else if(str == "SUN")
        std :: cout << 7 << '\n';
    else if(str == "MON")
        std :: cout << 6 << '\n';
    else if(str == "TUE")
        std :: cout << 5 << '\n';
    else if(str == "WED")
        std :: cout << 4 << '\n';
    else if(str == "THU")
        std :: cout << 3 << '\n';
    else if(str == "FRI")
        std :: cout << 2 << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
    #define ll long long
    #define rep(X,N) for(int X = 0; X < (N); X++)
    #define pback push_back
    #define mpair make_pair
    #define MODN 1000000007
    #define ceilint(A, B) ((A) + (B - 1)) / (B)
    #define ALL(v) (v).begin(), (v).end()

    using namespace std;

    ll gcd(ll a, ll b){
        if(a < b) return gcd(b,a);

        if(a % b == 0) return b;

        return gcd(b, a % b);
    }

    int main(){

        //TiとAiで小さいほうと過去の投票数で最小公倍数を求めてから他方の値をその比率で掛け合わせるのをN回行う

        int n;
        cin >> n;

        ll t = 1;
        ll a = 1;   

        rep(i,n){
            ll tmpt,tmpa,tmpm;
            cin >> tmpt >> tmpa;

            ll oldt = t;
            ll olda = a;

            if(tmpt <= tmpa){

                tmpm = (tmpt - (t % tmpt)) % tmpt;

                t = t + tmpm;
                a = t / tmpt * tmpa;

                if(olda > a){
                    ll times = ceilint(olda - a, tmpa);

                    t = t + times * tmpt;
                    a = a + times * tmpa;
                }


            }else{

                tmpm = (tmpa - (a % tmpa)) % tmpa;

                a = a + tmpm;
                t = a / tmpa * tmpt ;

                if(oldt > t){
                    ll times = ceilint(oldt - t, tmpt);

                    t = t + times * tmpt;
                    a = a + times * tmpa;
                }

            }

            //cerr << t << " " << a << endl;

        }

        cout << t + a << endl;

        
        return 0;
    }

Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		//  input
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int r = Integer.parseInt(sc.next());
		
		// output & judge
		if(n >= 10) {
			System.out.println(r);
		}else {
			System.out.println(100 * (10 - n) + r);
		}
	}
}

Measured memory_bytes: 21972