akhauriyash/Code-Regression huggingface dataset:
/**Bismillahir Rahmanir Raheem
    Author:Refatul Fahad**/

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

#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define pii pair<int,int>
#define pil pair<int,ll>
const int N = 1e5 + 5;
const ll M = (ll)1e9 + 7;
const double pi=2*acos(0.0);
const double esp=1e-9;
int Set(int N,int pos) {
    return N=N | (1<<pos);
}
int reset(int N,int pos) {
    return N= N & ~(1<<pos);
}
bool check(int N,int pos) {
    return (bool)(N & (1<<pos));
}

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

int main() {

    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    /// freopen("input.txt","r",stdin);
    /// freopen("output.txt","w",stdout);

    int test=1;
    //cin>>test;
    for(int cs=1; cs<=test; ++cs) {
       int n;
       cin>>n;
       if(n%1000){
         int cnt=(n/1000)+1;
         cout<<(cnt*1000)-n<<endl;
       }
       else{
        cout<<0<<endl;
       }
    }
    return 0;
}



Measured memory_bytes: 3644
until (n = $<.gets.to_i).zero?
  result = n.times.map {$<.gets.split.map(&:to_i)}.map do |id, *d|
    [id, d.each_slice(2).map {|m, s| 60 * m + s}.sum]
  end.sort {|a, b| a[1] <=> b[1]}.map(&:first)
  puts result[0], result[1], result[-2]
end


Measured memory_bytes: 7540
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FRE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define int long long
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
#define endl "\n"
const int oo = INT_MAX;
const int MOD = 1e9 + 7;
const int sz = 1e5 + 5;

int32_t main() {
    IOS;
    int tc = 1;
    //cin >> tc;
    while(tc--) {
        int n; cin >> n;
        vector<pair<int, int>> v(n);
        for(auto&el : v) cin >> el.first >> el.second;
        for(int i = 0; i + 2 < n; ++i) {
            if(v[i].first == v[i].second && v[i + 1].first == v[i + 1].second && v[i + 2].first == v[i + 2].second) return 0 * printf("Yes\n");
        }
        return 0 * printf("No\n");
    }
}

Measured memory_bytes: 3640
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

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

using namespace std;

const LL MOD=1e9+7;

int n;
double x,ans=0;
string u;

int main()
{
	cin>>n;
	rep(i,n)
	{
		cin>>x>>u;
		if(u=="JPY") ans+=x;
		else ans+=x*380000;
	}
	cout<<ans<<endl;
	rt0;
}

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

using namespace std;
typedef long long ll;

const int mx = 2e5+5;

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

	ll a[n+5];

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

	int maxi=0;
	int tc=0;

	for(int i=1;i<n;i++)
	{
		if(a[i]<=a[i-1])
		{
			tc++;
			maxi=max(tc,maxi);
		}
		else
		{
			tc=0;
		}
	}

	cout<<maxi<<'\n';

	return 0;		
}

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

int main()
{
	int A, B, C;

	cin >> A >> B >> C;

	bool flag = false;

	for ( int i = 1; i <= B * 10; i++ ) {
		if ( (A * i) % B == C ) {
			flag = true;
		}
	}

	if ( flag ) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	
	return ( 0 );
}


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

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

const int MAX = 510000;
const int MOD = 998244353;

long long fac[MAX], finv[MAX], inv[MAX];
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main(){
   COMinit(); 
  long long N,M,K,ans=0;
  cin>>N>>M>>K;
  for(int i=0;i<=K;i++){
  	ans+=M*COM(N-1,i)%MOD*modpow(M-1,N-1-i,MOD)%MOD;
    ans=ans%MOD;
  }
  cout<<ans<<endl;
}

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

int main() {
  int64_t k=1000000007;
int64_t s;
  cin>>s;
  if(s==1||s==2){cout<<0<<endl;}
else{vector<int64_t> ans(s);
vector<int64_t> ho(s);
ans.at(0)=0;
  ans.at(1)=0;
  ans.at(2)=1;
for(int i=0;i<3;i++){
ho.at(i)=ans.at(i);
}
for(int i=3;i<s;i++){
ans.at(i)=(ho.at(i-3)+1)%k;
  ho.at(i)=(ho.at(i-1)+ans.at(i))%k;
} 
  cout<<ans.at(s-1)<<endl;}
}

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

int main(){
  string s;
  cin >> s;
  int n = s.size();
  rep(i,n){
    if(s[i] == '?') s[i] = 'D';
  }
  cout << s << endl;
  return 0;
}


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

int main() {
  
  int A,B,C;

  cin >> A;
  cin >> B;
  cin >> C;
  
  string res;

  vector <int>vec(10);

  vec.at(A) += 1;
  vec.at(B) += 1;
  vec.at(C) += 1;
  
  res = "No";
  
  for( int i = 0; i<10;i++){
    if(vec.at(i) == 2){
      res = "Yes";
      break;
    }
  }
  cout << res << endl;
}






Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	long long x=0;
	long long ans=0;
	for(int i=1;i<=n;i++)
	  {
	  	long long a;
	  	scanf("%lld",&a);
	  	if(a>=x)
	  	  {
	  	  	a-=x;
	  	  	ans+=x;
	  	  	x=a%2;
	  	  	ans+=a/2;
		  }
		else
		  {
		  	ans+=a;
		  	x=0;
		  }
	  }
	cout<<ans;
}

Measured memory_bytes: 256
#include<stdio.h>

#define SIZE 100002
int a[SIZE],n,m,vis[SIZE],ans;
int main()
{
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &a[i]);
	}
	for (int i = 1; i <= m; i++)
	{
		int x, y;
		scanf("%d%d", &x, &y);
		if (a[x] < a[y])
		{
			vis[x] = 1;
		}
		if (a[x] == a[y])
		{
			vis[y]=vis[x] = 1;
		}
		if (a[x] > a[y])
		{
			vis[y] = 1;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		if (vis[i] == 0)
			ans++;
	}
	printf("%d", ans);
}

Measured memory_bytes: 2512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)

int main() {
    ll n; cin >> n;
    cout << n * (n+1) / 2 << endl;
}

Measured memory_bytes: 3644
#include <stdio.h>

int max(int x,int y)
{
  return x>y?x:y;
}

int main()
{
 
  int n,m;
  
  scanf("%d%d",&n,&m);
  
  int i;
  int h[n];
  int count_zero[100001]={};
  for(i=0;i<n;i++)
  {
    scanf("%d",&h[i]);
  }
  int a[m],b[m];
  int l[n];
  for(i=0;i<n;i++)
  {
    l[i]=0;
  }
  for(i=0;i<m;i++)
  {
    scanf("%d%d",&a[i],&b[i]);
    l[a[i]-1]=max(l[a[i]-1],h[b[i]-1]);
    l[b[i]-1]=max(l[b[i]-1],h[a[i]-1]); 
  }
  
  int ans=0;
  
  for(i=0;i<n;i++)
  {
    if(l[i]<h[i])
    {
      ans++;
    }
  }
  
  printf("%d\n",ans);
 
  return 0;
}

Measured memory_bytes: 3232
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <unordered_set>

int main(void) {
    unsigned long inputN = 0;
    unsigned long inputK = 0;
    unsigned int inputP[200001] = {};
    scanf("%ld", &inputN);
    scanf("%ld", &inputK);
    double expection = 0.0;
    double prev = 0.0;

    for (auto i = 0; i < inputN; i++)
    {
        scanf("%d", &inputP[i]);
        if(i+1 == inputK) {
            for(auto j=0; j<inputK; ++j) {
                expection += (double)(inputP[i-j]+1) * 0.50;
            }
            prev = expection;
        }
        else if(i+1>inputK) {
            double tmp = prev + (double)(inputP[i]+1) * 0.50 - (double)(inputP[i-inputK]+1) * 0.50;
            if (tmp > expection) {
                expection = tmp;
            }
            prev = tmp;
        }
    }
    printf("%lf\n", expection);
    return 0;
}


Measured memory_bytes: 896
import math


def issq(x):
    sx = int(math.sqrt(x))
    return any([
        (sx - 1)**2 == x,
        sx**2 == x,
        (sx + 1)**2 == x,
    ])


N, D = map(int, input().split())
X = [
    list(map(int, input().split()))
    for _ in range(N)
]

print([
    issq(sum((v - w)**2 for v, w in zip(X[i], X[j])))
    for i in range(N)
    for j in range(i + 1, N)
].count(True))


Measured memory_bytes: 3188
N,M=map(int,input().split())
cake=[list(map(int,input().split())) for _ in range(N)]
ans=0
for i in range(1<<3):
    point=[0]*N
    for j in range(N):
        for k in range(3):
            point[j]+=(-1+(i>>k & 1)*2)*cake[j][k]
    point.sort()
    ans=max(ans,sum(point[-M:]))
    if M==0:
        ans=0
print(ans)


Measured memory_bytes: 3316
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int road[4] = {0,0,0,0};
    for(int i = 0; i < 6; i++){
        int a;
        cin >> a;
        road[a-1]++;
    }
    
    int odd = 0;
    for(int i = 0; i < 4; i++){
        if(road[i] % 2 == 1)
            odd++;
    }

    cout << ((odd <= 2)?"YES\n":"NO\n");
}


Measured memory_bytes: 256
//By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i=0;i<e;++i)
#define forsn(i,s,e) for(int i=s;i<e;++i)
#define rforn(i,s) for(int i=s;i>=0;--i)
#define rforsn(i,s,e) for(int i=s;i>=e;--i)
#define bitcount(a) __builtin_popcount(a) // set bits (add ll)
#define ln '\n'
#define getcurrtime() cerr<<"Time = "<<((double)clock()/CLOCKS_PER_SEC)<<endl
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inputfile freopen("input.txt", "r", stdin)
#define outputfile freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32; 
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<p64> vp64;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const int LIM=1e5+5,MOD=1e9+7;
const ld EPS = 1e-9;


int main(){
	fastio;

	int x,y;
	cin>>x>>y;
	int ans = 0;
	ans = max(0,4-x)+max(0,4-y);
	if(ans == 6) ans += 4;
	cout<<ans*100000<<ln;

	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <queue>

#include <map>
#include <array>

using namespace std;

const int kLose = -1;
const int kBack = -2;
const double kDice = 1.0/6.0;

void Solve(double prob[102][101], int board[101], int goal, int T){
  prob[0][0] = 1.0;
  
  for(int t=0; t<T; t++){
	for(int i=0; i<goal; i++){
	  for(int n=1; n<=6; n++){
		int npos = (i + n <= goal) ? i + n : 2*goal - (i+n);
		if(board[npos] == kLose){
		  prob[t+2][npos] += prob[t][i]*kDice;
		}else if(board[npos] == kBack){
		  prob[t+1][0] += prob[t][i]*kDice;
		}else{
		  prob[t+1][npos] += prob[t][i]*kDice;
		}
	  }
	}
  }
  
}

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

  while(1){
	double prob[102][101] = {{0.0}};
	int board[101] = {0};
	int N, T, L, B;
	cin >> N >> T >> L >> B;
	if(N == 0){
	  return 0;
	}

	for(int i=0; i<L; i++){
	  int n;
	  cin >> n;
	  board[n] = kLose;
	}

	for(int i=0; i<B; i++){
	  int n;
	  cin >> n;
	  board[n] = kBack;
	}

	Solve(prob, board, N, T);

	double sum = 0.0;
	for(int t=1; t<=T; t++){
	  sum += prob[t][N];
	}
	printf("%.6f\n", sum);
  }
}

Measured memory_bytes: 3164
import java.util.Scanner;

/**
 *
 * @author k16075kk
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a*b + " " + 2*(a+b));
    }
}



Measured memory_bytes: 26056
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.StringBuilder
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    var n = sc.nextLong()
    var m = sc.nextLong()
    var ans = minOf(n, m / 2)
    n -= ans
    m -= ans * 2
    ans += m / 4
    println(ans)
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Measured memory_bytes: 34280
s = input().split()
a = int(s[0])
b = int(s[1])
k = int(s[2])




for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)


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

Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>

void push(int);
int pop(void);

int stack[100];
static int top = 0;

int main(){
  int x, y, b, c, i=0, j;
  char a[100];
  int fcount=0, ecount=0;

  while( scanf("%s", a) != EOF ){
    if(a[0] >= '0' && a[0] <= '9'){
      b = atoi(a);
      push(b);
      fcount++;
    }

    if(a[0] == '+' || a[0] == '-' || a[0] == '*'){
      x = pop();
      y = pop();
      if(a[0] == '+') c = y+x;
      else if(a[0] == '-') c = y-x;
      else c = y*x;

      if(c < -1000000000 || c > 1000000000) exit(3);

      push(c);
      ecount++;
    }
  }

  if(fcount < 2 || fcount > 100 || ecount < 1 || ecount > 99) exit(5);

  printf("%d\n", pop());
  return 0;
}

void push(int a){
  int i;

  if(top > 100) exit(1);
  stack[top] = a;
  top++;

}

int pop(void){
  int x;

  if(top < 0) exit(2);
  top--;
  x = stack[top];

  return x;
}



Measured memory_bytes: 2100
from itertools import product
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
mod = 998244353


class BinaryIndexTree:  # 1-indexed
    def __init__(self, N):
        """
        INPUT
        N [int] -> 全部0で初期化
        N [list] -> そのまま初期化
        """
        if isinstance(N, int):
            self.N = N
            self.depth = N.bit_length()
            self.tree = [0] * (N + 1)
            self.elem = [0] * (N + 1)
        elif isinstance(N, list):
            self.N = len(N)
            self.depth = self.N.bit_length()
            self.tree = [0] + N
            self.elem = [0] + N
            self._init()
        else:
            raise "INVALID INPUT: input must be int or list"

    def _init(self):
        size = self.N
        for i in range(1, self.N):
            if i + (i & -i) > size:
                continue
            self.tree[i + (i & -i)] += self.tree[i]

    def add(self, i, x):
        self.elem[i] += x
        while i <= self.N:
            self.tree[i] += x
            i += i & -i

    def sum(self, i):
        res = 0
        while i > 0:
            res += self.tree[i]
            i -= i & -i
        return res

    def lower_bound(self, val):
        if val <= 0:
            return 0
        i = 0
        k = 1 << self.depth
        while k:
            if i + k <= self.N and self.tree[i + k] < val:
                val -= self.tree[i + k]
                i += k
            k >>= 1
        return i + 1


def F(a, b, c, d):
    res = 0
    nums = (a, b, c, d)
    ox = tuple(pow(2, i, mod) for i in nums)
    o = tuple(i-1 for i in ox)
    res += ox[0] * o[1] * ox[2] * o[3]
    res %= mod
    res += o[0] * ox[1] * o[2] * ox[3]
    res %= mod
    res -= o[0] * o[1] * o[2] * o[3]
    res %= mod
    res += ox[0] * ox[1] * ox[2] * ox[3]
    res %= mod
    return res


N = int(input())
XY = sorted(tuple(map(int, input().split())) for _ in range(N))
_, Y = zip(*XY)
ytoi = {y: i for i, y in enumerate(sorted(set(Y)), 1)}

bit_R = BinaryIndexTree([1] * N)
bit_L = BinaryIndexTree(N)

ans = 0
for i, y in enumerate(Y, 1):
    R = N - i
    L = i - 1
    y = ytoi[y]
    bit_R.add(y, -1)

    # 点iを原点として、第1-4象限にある点の数
    c4 = bit_R.sum(y)
    c1 = R - c4
    c3 = bit_L.sum(y)
    c2 = L - c3

    ans += F(c1, c2, c3, c4)
    ans %= mod

    bit_L.add(y, 1)

print(ans)

Measured memory_bytes: 193852
object Main {

  def main(args: Array[String]) {
    val source = scala.io.Source.stdin.getLines.toSeq

    source.filter(_ != "0").foreach {s =>
      val target = s.toInt

      val primeList: List[Int] = primes.takeWhile( _ <= target ).toList

      val result: Int = (for {
        p <- primeList.filter(p => p <= target / 2)
        if (primeList.contains(target - p))
      } yield p).size

      println(result)
    }
  }

  lazy val primes: Stream[Int] = {
    def isPrime(i: Int): Boolean =
      primes takeWhile {Math.sqrt(i) >= _} forall {i % _ != 0}

    2 #:: 3 #:: (Stream.from(2)).map{_ * 2 + 1}.filter{ isPrime(_) }
  }

}

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

int main() {
  int a,b;
  cin >> a >> b;
  if(a==b){
    cout << "Draw" << endl;
  }else{
    if(a!=1&&b!=1){
      if(a>b){
        cout << "Alice" << endl;
      }else{
        cout << "Bob" << endl;
      }
    }else{
      if(a==1){
        cout << "Alice" << endl;
      }else{
        cout << "Bob" << endl;
      }
    }
  }
}

Measured memory_bytes: 256
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    long n,m,d;
    scanf("%ld %ld %ld", &n, &m, &d);
    long k;
    if(d == 0){
        k = n;
    }
    else{
        k = 2 * (n - d);
    }
    k = k * (m - 1);
    double dAns = double(k)/double(n * n);
    printf("%.10lf", dAns);
    return 0;
}


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

int a,b,c,sr[500],ans,n,d[500000];
string s;

int  main(){
    cin>>n;
    for(int i=0;i<n;i++)cin>>d[i];
    sort(d,d+n);
    int g=(n/2)-1;
    cout<<d[g+1]-d[g]<<endl;
}


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

int main() {
  int a, b;
  char op;
  cin >> a >> op >> b;
  if (op == '+') cout << a + b << endl;
  else cout << a - b << endl;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
int main(){
   int S[13],H[13],C[13],D[13];
   for(int i=0;i<13;i++){
     S[i]=-1;
     H[i]=-1;
     C[i]=-1;
     D[i]=-1;
   }
   int num;
   scanf("%d",&num);
   int n;
   char m;
   for (int j=0;j<num;j++){
    scanf(" %c %d",&m,&n);
    if (m=='S'){
        S[n-1]=1;
    }
    else if (m=='H'){
        H[n-1]=1;
    }
    else if (m=='C'){
        C[n-1]=1;
    }
    else if (m=='D'){
        D[n-1]=1;
    }
   }




   for (int i=0;i<4;i++){
       for(int j=0;j<13;j++){
           if(i==0){
               if(S[j]==-1){
                   printf("S %d\n",j+1);
               }
           }
           else if(i==1){
               if(H[j]==-1){
                   printf("H %d\n",j+1);
               }
           }
           else if(i==2){
               if(C[j]==-1){
                   printf("C %d\n",j+1);
               }
           }
           else if(i==3){
               if(D[j]==-1){
                   printf("D %d\n",j+1);
               }
           }
       }
   }

}






Measured memory_bytes: 2608
#include<stdio.h>

int main(void){
  char s[4];
  
  scanf("%s",s);
  
  if(s[0]==s[1]&&s[1]==s[2]){
    printf("No");
  }
  else if(s[0]==s[1]&&s[2]==s[3]){
    printf("Yes");
  }
  else if(s[0]==s[2]&&s[1]==s[3]){
    printf("Yes");
  }
  else if(s[0]==s[3]&&s[1]==s[2]){
    printf("Yes");
  }
  else{
    printf("No");
  }
  
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
// *テンプレート*
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long MOD = 1000000007;
const long long INF = 0x3f3f3f3f;
using namespace std;
typedef long long ll;
map<int, int> mp;
using Graph = vector<vector<int>>; 
//最大公約数
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
//最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

// *テンプレートここまで*

// pair -> vector<pair<int,int>> 
//		   AandB.push_back(make_pair(a[i],b[i]))


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int x, y; cin >> x >> y;
	int a = abs(abs(x) - abs(y));
	if (x <= y and ((x >= 0 and y >= 0) or (x <= 0 and y <= 0))) cout << a << endl;
	else if (x > y and ((x > 0 and y > 0) or (x < 0 and y < 0))) cout << a + 2 << endl;
	else cout << a + 1 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  int d;
  while (cin >> d) {
    int sum = 0;
    for (int i = 0; i < 600 / d; ++i) {
      sum += i * d * i * d * d;
    }
    cout << sum << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <limits>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long LL;

int main() {
  int N;
  cin >> N;
  vector<LL> A(N*3);
  REP(i, N*3) { cin >> A[i]; }
  vector<LL> sum1(N*3),sum2(N*3);
  {
    priority_queue<LL, vector<LL>, greater<LL>> q;
    LL tsum = 0;
    REP(i, N*3) {
      q.push(A[i]);
      tsum += A[i];
      while(q.size() > N) {
        tsum -= q.top();
        q.pop();
      }
      if(q.size() == N) {
        sum1[i] = tsum;
      }
    }
  }
  {
    priority_queue<LL> q;
    LL tsum = 0;
    for(int i=N*3-1; i>=0; --i) {
      q.push(A[i]);
      tsum += A[i];
      while(q.size() > N) {
        tsum -= q.top();
        q.pop();
      }
      if(q.size() == N) {
        sum2[i] = tsum;
      }
    }
  }
  LL ret = numeric_limits<LL>::min();
  for(int i=N; i<=N*2; ++i) {
    LL tret = sum1[i-1] - sum2[i];
    ret = max(ret, tret);
  }
  cout << ret << endl;
}

Measured memory_bytes: 9068
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    int k, n;
    int diff = 0;
    cin >> k >> n;
    vector<int> arr(n, 0);
    for(int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    for(int i = 1; i < n; i++)
        diff = max(diff, arr[i]-arr[i-1]);
    diff = max(diff, arr[0]+k-arr[n-1]);
    cout << (k-diff) << endl;
    return 0;
}



Measured memory_bytes: 1024
// #pragma GCC target("avx2")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long Comb(int a,int b){
 	if(a<b||b<0)return 0;
 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
long long pw(long long a,long long b){
	if(a<0LL)return 0;
	if(b<0LL)return 0;
	long long ret=1;
	while(b){
		if(b%2)ret=ret*a%mod;
		a=a*a%mod;
		b/=2;
	}
	return ret;
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
// ここから編集しろ
long long gcd(long long a,long long b){
	while(a){b%=a;swap(a,b);}return b;
}
long long c,d;
long long cnt(long long a){
	long long ret=a;
	ret-=a/c;
	ret-=a/d;
	ret+=a/(c*d/gcd(c,d));
	return ret;
}
int main(){
	long long a,b;scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
	printf("%lld\n",cnt(b)-cnt(a-1));
}

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

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main() {
	string s, t;
	int cnt = 0;
	cin >> s >> t;
	rep(i, 3){
		if(s[i] == t[i]) cnt++;
	}
	cout << cnt << endl;
}

Measured memory_bytes: 256
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    D = il()
    cum = itertools.accumulate(D)
    print(sum(c * d for c, d in zip(cum, D[1:])))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3432
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#include<iomanip>
#include<map>
#include<queue>
#define int long long
using namespace std;

signed main() {
	int A,B;
	cin >> A >> B;
	cout << max(A + B,max(A - B,A * B)) << endl;
}

Measured memory_bytes: 256
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

A,B,C = I()
K = i()
m = max(A,B,C)
ans = A+B+C+m*(2**K-1)
print(ans)

Measured memory_bytes: 9912
<?php
class PriorityQueue extends SplPriorityQueue{
  public function compare($priority1, $priority2){
    if ($priority1 === $priority2) return 0;
    return $priority1 < $priority2 ? 1 : -1;
  }
}
$fp = fopen("php://stdin","r");

while(true){
  fscanf( $fp, "%d %d", $n, $m);
  if($n == 0 && $m == 0) break;
  for($i = 0 ; $i <= $n ; $i++ ){
    for($j = 0 ; $j < 2 ; $j++ ){
      $used[$i][$j] = false;
      $min_cost[$i][$j] = 10000000;
    }
  }
  $info = array();
  for($i = 0 ; $i < $m ; $i++){
    fscanf( $fp, "%d %d %d", $a, $b, $c);
    $info[$a][] = array($b,$c);
    $info[$b][] = array($a,$c);
  }
  $que = new PriorityQueue();
  $que -> setExtractFlags(PriorityQueue::EXTR_BOTH);
  $que -> insert(array(1,0),0);
  while(!$que -> isEmpty()){
    $que -> top();
    $pair = $que -> extract();
    $cost = $pair['priority'];
    $now = $pair['data'][0];
    $ticket = $pair['data'][1];
    if($now == $n){
      print($cost."\n");
      break;
    }
    if($used[$now][$ticket]) continue;
    $used[$now][$ticket] = true;
    for($i = 0 ; $i < count($info[$now]) ; $i++){
      $e = $info[$now][$i];
      if($cost + $e[1] < $min_cost[$e[0]][$ticket]){
        $min_cost[$e[0]][$ticket] = $cost + $e[1];
        $que -> insert(array($e[0],$ticket),$cost + $e[1]);
      }
      if($ticket == 0){
        for($j = 0 ; $j < count($info[$e[0]]) ; $j++ ){
          $ee = $info[$e[0]][$j];
          if($cost < $min_cost[$ee[0]][1]){
            $min_cost[$ee[0]][1] = $cost;
            $que -> insert(array($ee[0],1),$cost);
          }
        }
      }
    }
  }
}
?>

Measured memory_bytes: 7192
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    vector<int>e[55];
    while(m--)
    {
        int u,v;
        cin>>u>>v;
        e[u].push_back(v);
        e[v].push_back(u);
    }
    for(int i=1;i<=n;i++)
        printf("%d\n",e[i].size());
    return 0;
}




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

int main()
{
	char c;
	cin >> c;

	if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o')
		cout << "vowel\n";
	else
		cout << "consonant\n";
}


Measured memory_bytes: 256
import re
N,Q=map(int,input().split())
S=input()
t=[0]*(N+1)
for i in range(N):
    t[i+1]=t[i]+(1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
    l,r=map(int,input().split())
    print(t[r-1]-t[l-1])


Measured memory_bytes: 51384
// see https://gist.github.com/LumaKernel/ff55d49ee1af69b7388f15b707e75c15
const bool DEBUG = 1;
#include <iostream>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>
#include <iomanip>
#include <cassert>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef tuple<ll, ll> P;
typedef tuple<ll, ll, ll> P3;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<P> VP;
typedef vector<string> VS;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define FOR(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=int(b)-1;i>=int(a);--i)
#define RREP(i,n) RFOR(i,0,n)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique(ALL(a)),(a).end())
#define PB push_back
#define EACH(i,c) REP(i,(c).size())
#define REACH(i,c) RREP(i,(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))

#define BR cout<<"\n"

#define dump(x) if(DEBUG) cerr<<"["<<__LINE__<< "] "<<#x<<"="<<(x)<<"\n"
#define dump2(x,y) if(DEBUG) cerr<<"["<<__LINE__<< "] "<<#x<<"="<<(x)\
  <<" , "<<#y<<"="<<(y)<<"\n"
#define dump3(x,y,z) if(DEBUG)cerr<<"["<<__LINE__<<"] "<<#x<<"="<<(x)\
  <<" , "<<#y<<"="<<(y)<<"\n"\
  <<" , "<<#z<<"="<<(z)<<"\n"

#define SAY(x) if(DEBUG) cerr<<"["<<__LINE__<< "] "<<(x)<<"\n"

#define YES(x) cout<<((x)?"YES":"NO")<<"\n"
#define Yes(x) cout<<((x)?"Yes":"No")<<"\n"
#define yes(x) cout<<((x)?"yes":"no")<<"\n"

inline int omajinai_int_in(){omajinai;int n;cin>>n;return n;}
inline ll omajinai_ll_in(){omajinai;ll n;cin>>n;return n;}
inline string omajinai_string_in(){omajinai;string n;cin>>n;return n;}
inline int int_in(){int n;cin>>n;return n;}
inline ll ll_in(){ll n;cin>>n;return n;}
inline string string_in(){string n;cin>>n;return n;}
#define oini omajinai_int_in()
#define oinl omajinai_ll_in()
#define oins omajinai_string_in()
#define ini int_in()
#define inl ll_in()
#define ins string_in()

#define isInside(x,y) (0<=(x)&&(x)<w&&0<=(y)&&(y)<h)

#define fi(x) (get<0>(x))
#define se(x) (get<1>(x))
#define th(x) (get<2>(x))
#define fo(x) (get<3>(x))

template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { o << '['; EACH(i, v) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "]";  return o; }

const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9+7;

ll ans;

int main() {
	//#####//
cout<<48-ini<<endl;
}

//


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

int n,a[200010],b[200010];
long long jie[100010],inv[100010],dp[4010][4010],ans;
const long long mod=1e9+7;
inline int read()
{
	int x=0;
	char s=getchar();
	while(s>'9'||s<'0')
	s=getchar();
	while(s>='0'&&s<='9')
	{
		x=x*10+s-'0';
		s=getchar();
	}
	return x;
}
inline long long ksm(long long x,long long y)
{
	long long res=1;
	while(y)
	{
		if(y&1)
		res=res*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return res;
}
int main()
{
	n=read();
	for(int i=1;i<=n;++i)
	{
		a[i]=read();
		b[i]=read();
	}
	jie[0]=1;
	for(int i=1;i<=20000;++i)
	jie[i]=jie[i-1]*i%mod;
	inv[20000]=ksm(jie[20000],mod-2);
	for(int i=20000-1;i>=1;--i)
	inv[i]=inv[i+1]*(i+1)%mod;
	for(int i=1;i<=n;++i)
	dp[2001-a[i]][2001-b[i]]++;	
	for(int i=1;i<=4004;++i)
	{
		for(int j=1;j<=4004;++j)
		dp[i][j]=(dp[i][j]+dp[i-1][j]+dp[i][j-1])%mod;
	}
	for(int i=1;i<=n;++i)
	{
		ans=(ans+dp[a[i]+2001][b[i]+2001])%mod;
		ans=(ans-jie[2*(a[i]+b[i])]*inv[2*a[i]]%mod*inv[2*b[i]]%mod+mod)%mod;
	}	
	ans=ans*inv[2]%mod;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 128768
x,y = map(int, input().split())

# 操作1:反転 操作2:+1
# x y  rel1 rel2 rev1   rev2
# 正正  <     >    0      1
# 正負  -     >    -      1
# 負正  <     -    1      -
# 負負  <     >    0      2
# x 0
# 0 y
s = abs(abs(x)-abs(y))

if x>0 and y>0:
    if x<y:
        print(s)
    elif x>y:
        print(s+2)
elif x>0 and y<0:
    print(s+1)
elif x<0 and y>0:
    print(s+1)
elif x<0 and y<0:
    if x<y:
        print(s)
    elif x>y:
        print(s+2)
else:
    if x==0 and y<0:
        print(s+1)
    elif x==0 and y>0:
        print(s)
    elif y==0 and x<0:
        print(s)
    elif y==0 and x>0:
        print(s+1)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int N,H;
    cin >> N >> H;
    int a[N],b[N];
    for(int i=0;i<N;i++) {
        cin >> a[i] >> b[i];
    }
    sort(a,a+N,greater<int>());
    sort(b,b+N,greater<int>());
    int cnt = 0;
    for(int i=0;i<N;i++) {
        if(b[i] > a[0]) {
        //    cout << b[i] <<" used "<<endl;
            H -= b[i];
            cnt++;
            if(H <= 0) break;
        }else {
        //    cout << a[0] << " used "<<endl;
        //    cout << cnt << endl;
            cnt += ceil(H / (double)a[0]);
            H = 0;
            break;
        }
    }
    if(H > 0) cnt += ceil(H / (double)a[0]);
    cout << cnt << endl;
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  LL sum = 0;
  for (int i = 0; i < n; i ++) {
    cin >> a.at(i);
    sum += a.at(i) - 1;
  }

  cout << sum << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ll LINF=1e18;
const ld PI=abs(acos(-1));
int n,a;

int main(){
	cin >> n; ll pos=0, pot=0;
	REP(i,0,n){
		cin >> a;
		if(a) pot+=a;
		else pos+=pot/2,pot=0;
	}
	cout << pos+pot/2 << endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#define LL long long
using namespace std;
LL n,a[20],len=0;
int main()
{
	scanf("%lld",&n);
	while(n) a[++len]=n%10,n/=10;
	bool flag=true;
	for(int i=1;i<len;i++) if(a[i]!=9) {flag=false;break;}
	if(flag) {printf("%lld",9*(len-1)+a[len]);return 0;}
	printf("%lld",9*(len-1)+a[len]-1);
}

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


using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0; i<ll(n); i++)
#define FOR(i,m,n) for(int i=ll(m); i<ll(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }

const int  INF = (1 << 30) - 1;
const ll INFL = 1LL << 60;
const ll mod = 998244353;






int main(){

	cin.tie(0);
	ios::sync_with_stdio(0);

	int k;
	cin >> k;
	REP(i, k)cout << "ACL";
	cout << endl;

}

Measured memory_bytes: 3608
import java.util.*;

public class Main{
	
	public static void main (String[] args) {
		
		Main main = new Main();
		
		main.masume();
		
	}
	
	private void masume() {
		Scanner scanner = new Scanner (System.in);
		
		int height = scanner.nextInt();
		int width = scanner.nextInt();
		String [][] list = new String[height][width];
		
		scanner.nextLine();
		for (int tate=0; tate<height; tate++) {
			String temp =scanner.nextLine();
			String[] tempList = temp.split("");
			for (int yoko=0; yoko<width; yoko++) {
				list[tate][yoko]=tempList[yoko];
			}
		}
		
		for (int tate=0; tate<height; tate++) {
			list=hanteiYoko(list, tate, height, width);
		}
		
		for (int yoko=0; yoko<width; yoko++) {
			list=hanteiTate(list, yoko, height, width);
		}
		
		for (int tate=0; tate<height; tate++) {
			boolean nullFlag =true;
			for (int yoko=0; yoko<width; yoko++) {
				if (list[tate][yoko]=="null") {
				} else {
					System.out.print(list[tate][yoko]);
					nullFlag=false;
				}
			}
			if(nullFlag!=true) {
			System.out.println();
			}
		}
	}
	
	private String[][] hanteiYoko (String[][]list, int tate,int height, int width) {
		boolean hantei=true;
		
		for (int yoko=0; yoko<width; yoko++) {
			if (list[tate][yoko].equals(".")) {
			} else {
				hantei=false;
			}
		}
		if (hantei==true) {
			for (int yoko=0; yoko<width; yoko++) {
				list[tate][yoko]="null";
			}
		}
		
		
		return list;
	}
	
	private String[][] hanteiTate(String[][]list, int yoko, int height, int width) {
		boolean hantei=true;
		
		for (int tate=0; tate<height; tate++) {
			if (list[tate][yoko].equals(".")||list[tate][yoko].equals("null")) {
		} else {
			hantei=false;
		}
		}
		if (hantei==true) {
			for (int tate=0; tate<height; tate++) {
				list[tate][yoko]="null";
			}
		}
		
		return list;
	}
}

Measured memory_bytes: 24508
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

signed main() {
    int n;
    cin >> n;
    ll a[n];
    rep(i, n) {
        cin >> a[i];
    }
    ll now = 0;
    ll ans = 0;
    rep(i, n) {
        now = max(now, a[i]);
        ans += now - a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5180
# -*- coding: utf-8 -*-
n,m = list(map(int,input().split()))
s = input()


inf=float("inf")
#i番目のマスに行くための最小手数と、なんマス移動してきたか
dp = [(0,0)] + [(inf,None) for _ in range(n)]
for i in range(1,n+1):
    if s[i]=="0":
        for j in range(min(m,i),0,-1):
            if dp[i-j][0]<inf:
                dp[i]=(dp[i-j][0]+1,j)
                break
if dp[-1][1]:
    i = n
    ret = []
    ra = ret.append
    while dp[i][1]:
        ra(dp[i][1])
        i-=dp[i][1]
    print(" ".join(map(str,ret[::-1])))
else:
    print(-1)

Measured memory_bytes: 58548
x, y ,a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse = 1)
q = sorted(list(map(int, input().split())), reverse = 1)
r = sorted(list(map(int, input().split())), reverse = 1)

ans = 0
p = p[:x]
q = q[:y]
ans += sum(p) + sum(q)
pq = p+q
pq.sort()

for i in range(c):
    if pq[i] < r[i]:
        ans = ans - pq[i] + r[i]
    else:
        break
print(ans)


Measured memory_bytes: 23200
n,a,b=map(int,input().split())
h=[int(input()) for _ in range(n)]

#二部探索

ll=0
rr=10**9+1
ab=a-b
while ll<rr:
    half=(ll+rr)//2

    cnt=0
    for hh in h:
        if hh>b*half:
            cnt+=(-1*((-1*(hh-b*half))//ab))
    
    if cnt>half:
        ll=half+1
    elif cnt<half:
        rr=half
    else:
        print(half)
        exit()
print(ll)


    


Measured memory_bytes: 80828
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i < (n);i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define SCANF(i) int i;scanf("%d",&i)
typedef long long ll;
using namespace std;
using P = pair<int,int>;
const long long INF = 1LL << 60;
const int IINF=100000000;
const int MOD = (int)1e9 + 7;
//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    //sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
vector<int> dx={1,0,-1,0};vector<int> dy={0,-1,0,1};

signed main () {
    ll a,b,c,x,y;
    cin >> a >> b >> c >> x >> y;
    ll ans = a*x+b*y;
    if(x<y)ans=min(ans,c*2*x+b*(y-x));
    else ans = min(ans,c*2*y+a*(x-y));
    ans = min(ans,c*2*max(x,y));
    cout << ans << endl;
}//https://atcoder.jp/contests/abc095/tasks/arc096_a

Measured memory_bytes: 3584
#include <bits/stdc++.h>
 
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
#define pb push_back
#define MOD 1000000007
#define ull unsigned long long
#define all(x) (x).begin(), (x).end()
#define read(a, n) for(ll i = 0;i<n;i++) cin>>a[i];
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define FileIO freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)
const int INF = 1e9 + 5;

void solve() {
	string s, t;
	cin>>s>>t;
	
	int ans = INT_MAX;
	int n = s.size();
	int p = t.size();
	for(int i = 0;i<=n-p;i++) {
		string temp = s.substr(i, p);
		int total = 0;
		for(int j = 0;j<temp.size();j++) {
			if(temp[j] != t[j]) total++;
		}
		
		if(total < ans) ans = total;
	}
	
	cout<<ans<<"\n";
}

int main()
{
	fastio;
	
	int T = 1;
	//cin>>T;
	//int tc = 1; 
	while(T--) {
		//cout<<"Case #"<<tc<<": ";
		solve();
		//tc++;
	}	
	return 0;
}


Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s1 = sc.next();
		String s2 = sc.next();
		if (s1.equals(s2.substring(0,s2.length()-1))==false) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");
	}

}

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

long long N, M, K;
set<long long> can;

int main(){
	cin >> N >> M >> K;
	for(long long i = 0; i <= N; i++){
		for(long long j = 0; j <= M; j++){
			long long cur = 0;
			cur += i * M;
			cur += j * N;
			cur -= 2* i * j;
			can.insert(cur);
		}
	}
	if(can.count(K) == 0){
		cout << "No" << endl;
	}else{
		cout << "Yes" << endl;
	}
}


Measured memory_bytes: 13056
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

struct edge {
  int to;
  ll cost;
  edge(int t, ll c): to(t), cost(c) {};
};

using P = pair<ll, int>;

vector<ll> d;
vector<int> par;
void dijkstra(int s, int N, vector<vector<edge>>& G) {
  priority_queue<P, vector<P>, greater<P>> que;
  d = vector<ll>(N, longinf);
  par = vector<int>(N, -1);
  d[s] = 0;
  que.push(P(0, s));

  while(!que.empty()) {
    P p = que.top();
    que.pop();
    int v = p.second;
    if(d[v] < p.first) continue;

    for(int i=0; i<(int)G[v].size(); i++) {
      edge e = G[v][i];
      if(d[e.to] > d[v] + e.cost) {
        d[e.to] = d[v] + e.cost;
        que.push(P(d[e.to], e.to));
        par[e.to] = v;
      }
    }
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m; cin >> n >> m;
  vector<vector<edge>> G(3*n);
  rep(i, m) {
    int u, v;
    cin >> u >> v;
    u--; v--;
    rep(j, 3) {
      G[3*u+j].push_back({3*v+(j+1)%3, 1});
    }
  }
  int s, t; cin >> s >> t;
  s--; t--;
  dijkstra(3*s, 3*n, G);
  cout << (d[3*t]==longinf ? -1 : d[3*t]/3) << "\n";
  return 0;
}


Measured memory_bytes: 23188
sa = list(input())
sb = list(input())
sc = list(input())
turn = "a"
tmp=sa
flag = True
while (flag):
    if len(tmp) == 0:
        print(turn.upper())
        exit()
    if tmp[0]=="a":
        turn=tmp.pop(0)
        tmp=sa
    elif tmp[0]=="b":
        turn=tmp.pop(0)
        tmp=sb
    else:
        turn=tmp.pop(0)
        tmp=sc

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

Int arith_sum(Int a, Int n) {
    if (a <= 0) return 0;
    if (a > n) return 0;
    Int b = n / a;
    Int m = (a + b * a) * b / 2;
    return m;
}


int main(){
    Int K;
    cin >> K;
    Int ans = 0;
    for (Int i = 1; i <= K; i++) {
        ans += arith_sum(i,K);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3596
#include <iostream>
#include<cmath>
#include<stdio.h>
#include <vector>
using namespace std;


int main(){

	double n, num,dis,p1,p2,p3,p_infinity=0;
	vector <int> x, y;
	cin >> n;
	p1 = p2 = p3 = 0;

	for (int i = 0; i < n; i++){
		cin >> num;
	x.push_back(num);
    }
	for (int i = 0; i < n; i++){
		cin >> num;
		y.push_back(num);
	}

		for (int i = 0; i < n; i++){
	
		if (x[i] >= y[i])dis = (x[i] - y[i]);
		else dis = (y[i] - x[i]);

		//p=1??????????????????????????¢

		p1 += dis;


		//p=2??????????????????????????¢
		p2 += (dis*dis);

		//p=3?????????????????????????????¢
		p3 += (dis*dis*dis);

		//p=?????????????????????????????¢
		if (p_infinity < dis) { p_infinity = dis; }
	}
		p2 = sqrt(p2);
		p3 = pow(p3,1.0/3.0);
		printf("%.6lf\n", p1);
		printf("%.6lf\n", p2);
		printf("%.6lf\n", p3);
		printf("%.6lf\n", p_infinity);




	return 0;
}

Measured memory_bytes: 1296