akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

ll A, B, K;

void solve() {
	cin >> A >> B >> K;
	ll c = min(A, K);
	A -= c;
	K -= c;
	B -= min(B, K);
	cout << A << " " << B << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 256
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
 
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <iterator>
#include <functional>
#include <limits>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <stack>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
typedef int64_t ll;
 
#define endl '\n'
#define int ll
ll mod=1e18;
ll mod1=1e9+5;
ll power(ll a,ll b)
{
    if(b==0) return 1;
    else if(b%2==0)
        return power((((a%mod)*(a%mod))%mod),b/2)%mod;
    else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
}

int32_t main()
{
    IOS
   
    string s;
    int count=1;
    map<string,int> m;
    cin>>s;
    int n=s.length();
    int count1[n+1];
    memset(count1,0,sizeof(count1));
    count1[0]=1;
    for(int i=1;i<n;++i)
    {
        if(count1[i-1]==2)
        {
            count1[i]=1;
            count++;
            continue;
        }
        if(s[i]==s[i-1] and i!=n-1)
        {
            //cout<<s[i]<<" "<<endl;
            count1[i]=2;
            count1[i+1]=2;
            i++;
            count++;
        }
        else if(s[i]!=s[i-1])
        {
            count1[i]=1;
            count++;
        }
    }
    cout<<count;

}



Measured memory_bytes: 2704
from itertools import accumulate
N, K = map(int, input().split())
S = input()

q = []
pre = S[0]
ans = cnt = 0
for s in S:
    if pre != s:
        q.append(cnt)
        cnt = 1
        pre = s
    else:
        cnt += 1
q.append(cnt)

J = 2*K+1
acc = list(accumulate(q))
acc += [acc[-1]]
if len(q) <= J:
    ans = acc[-1]-1
else:
    ans = acc[J-1]-1 + acc[-1]-acc[J]-(len(q)-J)
    for i, a in enumerate(acc):
        if i+J < len(q):
            tot = acc[i+J]-acc[i]-1
            tot += acc[i]+acc[-1]-acc[i+J+1]-(len(q)-J)
            if tot > ans:
                ans = tot

print(ans)


Measured memory_bytes: 13860
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
	string S;
	cin >> S;
	string ans = "Good";
	for (int i = 0; i < 3; i++) {
		int j = i + 1;
		if (S[i] == S[j]) ans = "Bad";
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3592
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<string>
#include<cstdio>
#include<vector>
#include<cassert>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for (int i=a; i<=b; i++)
#define per(i,a,b) for (int i=a; i>=b; i--)
#define debug(x) {cout<<(#x)<<" "<<x<<endl;}
using namespace std;
typedef long long LL;

inline int read() {
    int x=0,f=1; char ch=getchar();
    while (!(ch>='0'&&ch<='9')) {if (ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9') {x=x*10+(ch-'0'); ch=getchar();}
    return x*f;
}

const int N = 2005;

int n,m,q;
int sum1[N][N],sum2[N][N],sum3[N][N];

inline void ins(int a[][N],int x,int y,int val) {
	while (x<=n) {
		int j=y;
		while (j<=m) {
			a[x][j]+=val;
			j+=j&-j;
		}
		x+=x&-x;
	}
}

inline int query(int a[][N],int x,int y) {
	int ret=0;
	while (x) {
		int j=y;
		while (j) {
			ret+=a[x][j];
			j-=j&-j;
		}
		x-=x&-x;
	}
	return ret;
}

inline int query(int a[][N],int x1,int y1,int x2,int y2) {
	if (x1>x2||y1>y2) return 0;
	return query(a,x2,y2)-query(a,x1-1,y2)-query(a,x2,y1-1)+query(a,x1-1,y1-1);
}

char s[N][N];

int main() {

	#ifndef ONLINE_JUDGE
	//	freopen("data.in","r",stdin);
	//	freopen("data.out","w",stdout);
	#endif

	n=read(),m=read(),q=read(); 
	rep(i,1,n) scanf("%s",s[i]+1);
	rep(i,1,n) rep(j,1,m) if (s[i][j]=='1') ins(sum1,i,j,1);
	rep(i,1,n) rep(j,1,m-1) if (s[i][j]=='1'&&s[i][j+1]=='1') ins(sum2,i,j,-1);
	rep(i,1,n-1) rep(j,1,m) if (s[i][j]=='1'&&s[i+1][j]=='1') ins(sum3,i,j,-1);
	while (q--) {
		int x1=read(),y1=read(),x2=read(),y2=read();
		int ans=query(sum1,x1,y1,x2,y2)+query(sum2,x1,y1,x2,y2-1)+query(sum3,x1,y1,x2-1,y2);
		printf("%d\n",ans);
	}
	

	return 0;
}


Measured memory_bytes: 52608
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double
int main(void){
  ll n;
  cin>>n;
  vi d(n);
  rep(i,n)cin>>d[i];
  ll ans=0;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      ans+=d[i]*d[j];
    }
  }
  cout<<ans;
  return 0;
}

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

int main() {
  int N;
  int K;
  cin >> N >> K;
  vector<int> h(N);
  for (int i = 0; i < N; i++) {
    cin >> h.at(i);
  }
  vector<int> dp(N);
  dp.at(0) = 0;
  for (int i = 1; i < N; i++) {
    int dpmax = 0;
    for (int j = 1; j <= K; j++) {
      if(i - j >= 0) {
        dpmax = abs(h.at(i) - h.at(i - j)) + dp.at(i - j);
        if (j == 1) {
          dp.at(i) = dpmax;
        }
        else dp.at(i) = min(dp.at(i), dpmax);
      }
      else break;
    }
  }
  cout << dp.at(N - 1) << endl;
  return 0;
}


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

bool containsDigit(int number, int digit)
{
    while (number != 0)
    {
        int curr_digit = number % 10;
        if (curr_digit == digit) return true;
        number /= 10;
    }

    return false;
}

int main(){
	int n, k;
    bool f = false;
    cin>>n>>k;
    int a[k];
    for(int i = 0; i < k; ++i){
    	cin>>a[i];
    }
    while(1){
    	for(int i = 0; i < k; ++i){
        	if(containsDigit(n,a[i])){
            	n++;
            	break;
            }
            else if(i == k - 1)
            	f = true;
        }
        if(f){
        	cout<<n;
            return 0;
        }
    }

}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double PI=acos(-1.0);
#define t1(x)             cerr<<#x<<"="<<x<<endl
#define t2(x, y)          cerr<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl
#define t3(x, y, z)       cerr<<#x<<"=" <<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl
#define t4(a,b,c,d)       cerr<<#a<<"="<<a<<" "<<#b<<"="<<b<<" "<<#c<<"="<<c<<" "<<#d<<"="<<d<<endl
#define t5(a,b,c,d,e)     cerr<<#a<<"="<<a<<" "<<#b<<"="<<b<<" "<<#c<<"="<<c<<" "<<#d<<"="<<d<<" "<<#e<<"="<<e<<endl
#define t6(a,b,c,d,e,f)   cerr<<#a<<"="<<a<<" "<<#b<<"="<<b<<" "<<#c<<"="<<c<<" "<<#d<<"="<<d<<" "<<#e<<"="<<e<<" "<<#f<<"="<<f<<endl
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define tr(...) GET_MACRO(__VA_ARGS__,t6,t5, t4, t3, t2, t1)(__VA_ARGS__)
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fastio() ios::sync_with_stdio(0);cin.tie(0)
#define MEMS(x,t) memset(x,t,sizeof(x));
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/*-------------------------------------------------------------------------------------------------------------------------------------*/
//#define MOD 1000000007
#define endl "\n" 
#define int long long
#define inf 1e18
#define ld long double
/*-------------------------------------------------------------------------------------------------------------------------------------*/
 
int32_t main()
{
	fastio();
	int n;
	cin>>n;
	int ar[n];
	for(int i=0;i<n;i++)
	{
		cin>>ar[i];
	}
	sort(ar,ar+n);
	reverse(ar,ar+n);
	ld ans=ar[n-1];
	for(int i=n-2;i>=0;i--)
	{
		ans=(ans+ar[i])/2.0;
	}
	cout<<fixed<<setprecision(5)<<ans<<endl;
}


Measured memory_bytes: 256
n,x = map(int,input().split())

a = list(map(int,input().split()))

a.sort()

sweets=0

ans = 0

for i in range(n):
    sweets += a[i]
    if sweets <= x:
        ans += 1
    else:
        break

if sweets < x:
    print(ans-1)
else:
    print(ans)

Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'

int main(){

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

    string s, t; cin >>s >>t;

    int ans = s.length();
    int dif = s.length() - t.length();
    for(int i = 0; i<=dif; i++){
        int cnt = 0;
        for(int j = 0; j<t.length(); j++){
            if(s[i+j] != t[j]) cnt++;
        }
        ans = min(ans, cnt);
    }

    cout <<ans <<endl;

    return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
typedef uint64_t ll;
using std::cout ;
using std::endl ;
using std::cin ;
using std::string ;
using std::vector ;
using std::set ;
using std::map ;
using std::pair ;
#define rep(i,n) for(int i=0, i##_end=(n); i<i##_end; i++)
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
template<class T>bool updateMax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool updateMin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(c) c.begin(),c.end()
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

int main() {
    int a;
    cin >> a;
    
    cout << (a + a * a + a * a * a) << endl;
}


Measured memory_bytes: 3600
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int b[100006] ={0};
int main()
{
    int n,a[100006],mx=0,cnt=0,sum=0,k=0,no=0;
    cin>>n;
    memset(b,0,sizeof(b));
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

    for(int i=1;i<n;i++){
        if(a[i-1]>=a[i]){
            no=b[k];
            no++;
            b[k]=no;
        }else{
            k++;
            no=0;
           
        }
    }
    for(int j=0;j<=k;j++){
        if(mx<b[j]){
            mx=b[j];
        }
    }
    cout<<mx<<endl;
   


    return 0;
}

Measured memory_bytes: 1024
h,w,d = map(int, input().split())

a = [[0 for _ in range(w)] for _ in range(h)]
masu = {}
for i in range(h):
    a[i] = list(map(int, input().split()))
    for j in range(w):
        masu[a[i][j]] = (i,j)

point = [0] * (h*w+10)
for i in range(d+1,h*w+1):
    point[i] = point[i-d] + abs(masu[i][0] - masu[i-d][0]) + abs(masu[i][1] - masu[i-d][1])


q = int(input())
ans = [0] * q
for i in range(q):
    l, r = map(int, input().split())
    if l == r:
        ans[i] = 0
    else:
        ans[i] = point[r] - point[l]
 
for i in range(q):
    print(ans[i])


Measured memory_bytes: 27556
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  ll n;
    cin>>n;
    vector<ll> a(n+1);
    for(ll i=1;i<n+1;i++){
        cin>>a[i];
    }
    vector<ll> b(n+1);
    for(ll i=n/2+1;i<n+1;i++){
      if(a[i]==1)b[i]=1;
      else b[i]=0;
    }
    for(ll i=n/2;i>0;i--){
        ll count=1;
        ll sum=0;
        b[i]=0;
        for(ll j=i;j<n+1;j=i*count){
            sum+=b[j];
          count++;
        }
        if(sum%2!=a[i])b[i]=1;
    }
    ll ans1=0;
    for(ll i=1;i<n+1;i++){
        if(b[i]==1)ans1++;
    }
    cout<<ans1<<endl;
    for(ll i=1;i<n+1;i++){
        if(b[i]==1)cout<<i<<" ";
    }
}

Measured memory_bytes: 3968
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,x,t = map(int,input().split())
def ceil(x,y):
  return (x-1)//y+1
print(ceil(n,x)*t)

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 110

signed main()
{
    int N, X;
    cin >> N >> X;
    int min_m = LLINF;
    REP(i, N) {
        int m;
        cin >> m;
        min_m = min(min_m, m);
        X -= m;
    }
    printf("%lld\n", N + X / min_m);
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

func main() {
	r := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscan(r, &n)
	s := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r, &s[i])
	}

	min := math.MaxInt64
	sum := 0
	for i := 0; i < n; i++ {
		sum += s[i]
		if s[i]%10 != 0 {
			min = minInt(min, s[i])
		}
	}

	if sum%10 != 0 {
		fmt.Println(sum)
	} else if min == math.MaxInt64 {
		fmt.Println(0)
	} else {
		fmt.Println(sum - min)
	}
}

func minInt(x int, y int) int {
	if x < y {
		return x
	}
	return y
}


Measured memory_bytes: 640
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
long long int gcd(long long int a,long long int b){
    if(!b)return a;
    return gcd(b,a%b);
}
int main(){
    long long int A,B;
    cin>>A>>B;
    long long int ans=A*B/gcd(A,B);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3628
import sys
from math import sqrt
from collections import Counter, defaultdict, deque

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    n, m, x = MI()
    li = [LI() for _ in range(n)]

    min = float(inf)
    for i in range(2 ** n):
        flag = True
        total = [0] * (m + 1)
        for j in range(n):
            if (i >> j) & 1:
                total = [x + y for (x, y) in zip(total, li[j])]

        for t in total[1:]:
            if t < x:
                flag = False

        if flag:
            if total[0] < min:
                min = total[0]

    if isinstance(min, float):
        print(-1)
    else:
        print(min)


if __name__ == "__main__":
    main()


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

// GCD, LCM
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

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

    int temp = 0;

    while(1){

        if(temp>=N){
            cout<<temp-N<<endl;
            return 0;
        }
        temp+=1000;
    }

    return 0;
}

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

int main() {
  //input
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i,N) {
    cin >> A.at(i);
  }
  //calc
  string answer = "APPROVED";
  int target;
  rep(i,N) {
    target = A.at(i);
    if ( target % 2 == 0 ) {
      if ( target % 3 != 0 && target % 5 != 0 ) {
        answer = "DENIED";
        break;
      }
    }
  }
  //output
  cout << answer << endl;
}

Measured memory_bytes: 256
#include <string>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <limits>
#include <tuple>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

int main()
{
	int N, K;
	cin >> N >> K;
	vector<int> X(N);
	vector<int> Y(N);
	for (int i = 0; i < N; i++) {
		cin >> X[i] >> Y[i];
	}
	ll ans = numeric_limits<ll>::max();
	for (int i = 0; i < N - 1; i++) {
		for (int j = 0; j < N - 1; j++) {
			for (int i2 = i + 1; i2 < N; i2++) {
				for (int j2 = j + 1; j2 < N; j2++) {
					ll x1 = min(X[i], X[i2]);
					ll x2 = max(X[i], X[i2]);
					ll y1 = min(Y[j], Y[j2]);
					ll y2 = max(Y[j], Y[j2]);
					int n = 0;
					for (int k = 0; k < N; k++) {
						if (x1 <= X[k] && X[k] <= x2 && y1 <= Y[k] && Y[k] <= y2)
							n++;
					}
					if (n >= K) {
						ans = min(ans, abs(x1 - x2)*abs(y1 - y2));
					}
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.lang.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.math.BigInteger;

public class Main { //atcoder
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        char[] c = s.toCharArray();
        StringBuilder t = new StringBuilder();
        for(int i = 0; i<c.length; i++){
            if(i%2==0) t.append(c[i]);
        }
        out.println(t.toString());
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
}



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

int main() {
    int N;
    cin >> N;
    vector<string> W(N);
    rep(i, N) cin >> W[i];
    char last = W[0][0];
    rep(i, N) {
        if (last != W[i][0]) {
            cout << "No" << endl;
            return 0;
        }
        last = W[i].back();
    }
    rep(i, N) rep(j, i) if (W[i] == W[j]) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

const int C_10PW9 = 1000000000;

int main()
{
	int n;
	cin >> n;
	std::map<string, int> d;
	int max = -1;
	vector<string> v;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		auto it = d.find(s);
		if (it != end(d)) {
			d[s]++;
		}
		else {
			d.insert(make_pair(s, 1));
		}
		if (max < d[s]) {
			v = { s };
			max = d[s];
		}
		else if(max == d[s])
		{
			v.push_back(s);
		}

	}
	sort(v.begin(), v.end());

	for (auto i : v)cout << i << endl;
}


Measured memory_bytes: 26736
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String strWord = sc.next();
		
		if (strWord.equals("a") 
				|| strWord.equals("e") 
				|| strWord.equals("i") 
				|| strWord.equals("o") 
				|| strWord.equals("u")) {
			System.out.println("vowel");
		}else{
			System.out.println("consonant"); 
		}
	}
}

Measured memory_bytes: 9684
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define int long long
#define pb push_back
#define mkp make_pair
#define endl '\n'
#define mii map<int,int>
using namespace std;
const int MAX=1e6+3;
int mp[MAX]={0},hcf;
int solve()
{
	int n;
	cin>>n;
	int a[n];
	int hcf=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		mp[a[i]]++;
	}
	for(int i=0;i<MAX;i++){
		if(mp[i])
			hcf=__gcd(hcf,i);
	}
	if(hcf>1){
		cout<<"not coprime";
		return 0;
	}
	for(int i=2;i<MAX;i++){
		int cnt=0;
		for(int j=i;j<MAX;j+=i){
			if(mp[j])	cnt++;
			if(cnt>1){
				cout<<"setwise coprime";
				return 0;
			}
		}
		if(cnt>1){
			cout<<"setwise coprime";
			return 0;
		}
	}
	cout<<"pairwise coprime";
	return 0;
}
signed main()
{
	fastio;
	solve();
}



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

int main(){
	/*input*/
	int h, w;	cin >> h >> w; 
	vector<vector<char> >square(h + 2, vector<char>(w + 2, '.'));
	for(int i = 1; i <= h; i++){
		for(int j = 1; j <= w; j++){
			cin >> square[i][j];
		}
	}
	/*calculation*/
	bool flag = true;	//true:Yes false:No
	vector<bool>direction(4, false);	//0:right 1:left 2:up 3:down
	for(int i = 1; i <= h && flag; i++){
		for(int j = 1; j <= w && flag; j++){
			if(square[i][j] == '#'){
				if(square[i][j + 1] == '#')direction[0] = true;
				if(square[i][j - 1] == '#')direction[1] = true;
				if(square[i - 1][j] == '#')direction[2] = true;
				if(square[i + 1][j] == '#')direction[3] = true;
				if(direction[0] || direction[1] || direction[2] || direction[3]){
					flag = true;
				}else{
					flag = false;
				}
				for(int k = 0; k < 4; k++){
					direction[k] = false;
				}
			}else{
				continue;
			}
		}
	}
	/*output*/
	if(flag){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		no1();
	}

	static void no1() {
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			int a = sc.nextInt();
			int b = sc.nextInt();

			int d = b - a;
			if (d % 2 == 0) {
				System.out.println("Alice");
			} else {
				System.out.println("Borys");
			}
		}
	}

}


Measured memory_bytes: 24404
N = int(input())

f_vals = []
for i in range(N):
    f_vals.append([int(_) for _ in input().split()])
p_vals = []
for i in range(N):
    p_vals.append([int(_) for _ in input().split()])


def calc(pat):
    ret = 0
    for i in range(N):  # 店舗
        fcnt = 0
        for j in range(10):
            if pat[j] == 0: continue
            if f_vals[i][j] == 1:
                fcnt += 1
        ret += p_vals[i][fcnt]
    return ret


def solve():
    ans = -1e12
    for i in range(1, 2 ** 10):
        pat = [(i >> j) & 1 for j in range(10)]
        ans = max(ans, calc(pat))
    print(ans)

solve()

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <map>
#include <cmath>

int main(void) {
    long n;
    std::vector<long> A;
    std::map<long, long> num;

    std::cin >> n;

    A.resize(n);
    for (int i = 0; i < n; i++) {
        std::cin >> A[i];
        if (num.find(A[i]) != num.end()) {
            num[A[i]]++;
        } else {
            num[A[i]] = 1;
        }
    }

    for (auto itr = num.begin(); itr != num.end(); itr++) {
        while (itr->second > 1) {
            if (itr->second >= 3) {
                n -= 2;
                itr->second -= 2;
            } else {
                bool finish = true;
                for (auto itr2 = itr; itr2 != num.end();) {
                    itr2++;

                    if (itr2->second >= 2) {
                        n -= 2;
                        itr->second -= 1;
                        itr2->second -= 1;
                        finish = false;
                        break;
                    }
                }

                if (finish) {
                    n -= 2;
                    break;
                }
            }
        }
    }

    std::cout << n << std::endl;
}


Measured memory_bytes: 7296
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=100002;
int n,m,k;
char s[N],t[N];
bool cmp(char x,char y){
	return x>y;
}
int main(){
	scanf("%s%s",s+1,t+1);
	while(s[n+1])n++;
	while(t[m+1])m++;
	sort(s+1,s+n+1);
	sort(t+1,t+m+1,cmp);
	for(k=1;s[k]==t[k]&&s[k];k++);
	printf("%s\n",s[k]<t[k]?"Yes":"No");
	//while(1);
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <limits>
#include <set>
#include <map>
#include <random>
#include <cassert>
#define REP(i,n) for(long (i)=0;(i)<(n);(i)++)
#define REPI(i,a,b) for(long (i)=(a);(i)<(b);(i)++)
#define INF numeric_limits<double>::infinity()
constexpr long MOD = 1e9 + 7;
using namespace std;
using P = pair<long, long>;
using VI = vector<long>;
using VP = vector<P>;

int main() {
    int n;
    cin >> n;
    VI as;
    REP(i,n) {
        long a;
        cin >> a;
        as.push_back(a);
    }
    
    VI sums = {0};
    REP(i,n) {
        sums.push_back(sums.back() + as[i]);
    }
    
    map<long,long> m;
    for (auto s: sums) {
        m[s]++;
    }
    
    long ans = 0;
    for (auto &p: m) {
        long k = p.second;
        if (k > 1) {
            ans += k * (k - 1) / 2;
        }
    }
    
    cout << ans << endl;
}


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

int main() {
  int n;
  cin >> n;
  int s1 = 0, s2 = 0;
  vector<int> w(n);
  rep(i,0,n) {cin >> w[i]; s2 += w[i];}
  int ans = s2;
  rep(i,0,n) {
    s2 -= w[i];
    s1 += w[i];
    ans = min(ans, abs(s1-s2));
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3596
//#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<set>
#include<stack>
#include<iomanip>
#include<algorithm>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);i++)
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<T>>;
template<typename T =ll,typename U =ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;
template <int MOD>
struct ModInt {
    using lint = long long;
    int val;

    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };

    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }

    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }

    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }

    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }

    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;
void d(){
    ll n,h;
    cin >> n >> h;
    
    v<p<>> ba(n,p<>(0,0));
    ll maxa = 0;
    
    rep(i,n) {
        cin >>ba[i].second >> ba[i].first;
        chmax(maxa,ba[i].second);
    }
    
    sort(ba.begin(),ba.end(),greater<p<>>());
    

    ll ans =0;
    rep(i,n){
        if(h<=0) break;
        if(maxa<=ba[i].first){
            h-=ba[i].first;
            ans++;
        }
    }
    if(h<=0){
        cout << ans <<endl;
    }else{
        cout << ans + h/maxa+(h%maxa==0?0:1)<<endl;
    }

}

int main(){
    d();
    return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	for (auto &u : v) os << u << el;
	return (os);
}

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

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

int main() {
	int N, M; cin >> N >> M;
	vector<Pi> bomb(N); cin >> bomb;
	vint sa(N+1);
	vector<Pi> dat(M); cin >> dat;
	vector<vector<Pi>> G(N+1);
	vint ans(M, 0);

	sort(begin(bomb), end(bomb));
	

	sa[0] = bomb[0].second, sa[N] = bomb[N-1].second;
	for (int i = 1; i < N; i++) sa[i] = (bomb[i].second ^ bomb[i-1].second);

	for (int i = 0; i < M; i++) {
		auto &v = dat[i];
		int l = v.first, r = v.second;
		int posl = lower_bound(begin(bomb), end(bomb), Pi(l, -INF)) - begin(bomb);
		int posr = upper_bound(begin(bomb), end(bomb), Pi(r, INF)) - begin(bomb);
		v.first = posl, v.second = posr;
		if (posl == posr) continue;
		G[posl].emplace_back(posr, i);
		G[posr].emplace_back(posl, i);
		//cout << " " << posl << " " << posr << endl;
	}
	
	vector<bool> flag(N+1);
	function<bool(int, int)> dfs = [&](int u, int index) -> bool {
		if (flag[u]) return (false);
		flag[u] = true;
		for (auto &v : G[u]) dfs(v.first, v.second);

		//cout << u << " " << index << " " << sa[u] << endl;
		if (sa[u] == 1) {
			if (index == -1) return (true);
			int a = dat[index].first, b = dat[index].second;
			//cout << a << " " << b << endl;
			sa[a] = 1 - sa[a], sa[b] = 1 - sa[b];
			ans[index] = 1;
		}
		return (false);
	};

	for (int i = 0; i <= N; i++) {
		if (dfs(i, -1)) {
			cout << -1 << endl;
			return (0);
		}
	}
	
	vint ansd;
	for (int i = 0; i < M; i++) {
		if (ans[i]) ansd.push_back(i+1);
	}
	cout << ansd.size() << endl;
	
	if (ansd.size() == 0) { cout << endl; return (0); }
	cout << ansd[0];
	for (int i = 1; i < ansd.size(); i++) cout << " " << ansd[i];
	cout << endl;
	return (0);
}


Measured memory_bytes: 17532
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ACC ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mod 1000000007
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
int dx8[]={1,-1,0,0,1,1,-1,-1};
int dy8[]={0,0,1,-1,1,-1,1,-1};
bool isvowel(char c)
{
    switch(c)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':return true;
        default : return false;
    }
}
bool isValid(ll x,ll y,ll n,ll m)
{
    if(x<0||x>n-1||y<0||y>m-1)return false;
    return true;
}
bool comp(pair<ll,ll> x,pair<ll,ll> y)
{
    if(x.first==y.first)
        return x.second<y.second;
    return x.first<y.first;
}
int main()
{
    ACC
    int T;
    T=1;
    //cin>>T;
    while(T--)
    {
      ll n,x,t;
      cin>>n>>x>>t;
      ll ans=0;
      ans=n/x;
      if(n%x)ans++;
      cout<<ans*t<<"\n";
    }
    return 0;
}


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

#define ll long long
#define ull unsigned long long

using namespace std;

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

	if (b == 'A'){
		cout << "T" << "\n";
		return 0;
	} 
	if (b == 'T'){
		cout << "A" << "\n";
		return 0;
	} 
	if (b == 'G'){
		cout << "C" << "\n";
		return 0;
	} 
	if (b == 'C'){
		cout << "G" << "\n";
		return 0;
	} 




	return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<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; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

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

    a += b;
    int x = stoi(a);

    bool ok = false;
    for (int i = 1; i * i <= x; ++i) {
        if (i * i == x) ok = true;
    }

    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

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

#define    ll    long long int

const int N = 200005;
ll n, k;
ll ara[N];
ll sum[N];
ll c = 0;
map<ll, ll> mp;

int main( )
{
    ll i, j, v;
    cin >> n >> k;
    for (i = 1; i <= n; i++)
    {
        cin >> ara[i];
        sum[i] = (sum[i - 1] + ara[i]) % k;
    }
    for (i = 0; i <= n; i++)
    {
        j = i - k;
        if (j >= 0)
        {
            v = ((sum[j] - j) % k + k) % k;
            mp[v]--;
        }
        v = ((sum[i] - i) % k + k) % k;
        c += mp[v];
        mp[v]++;
    }
    cout << c << '\n';
    return 0;
}


Measured memory_bytes: 15872
main :: IO ()
main = do
    str <- getLine
    let inputs = [read word :: Int | word <- words str]
    let a = head inputs
    let b = head $ tail inputs

    putStrLn $ ans a b

ans :: Int -> Int -> String
ans a b
    | a < b = "a < b"
    | a == b = "a == b"
    | otherwise = "a > b"

Measured memory_bytes: 3476
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
int n;
vector<ll> h;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    h.resize(n);
    rep(i,0,n) cin>>h[i];
    rev(h);
    ll res=h[0];
    rep(i,1,n){
        if(res+1<h[i]){
            cout <<"No"<<"\n";
            return 0;
        }
        if(res+1>h[i]){
            res=h[i];
        }
    }
    cout <<"Yes"<<"\n";
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const double PI = acos(-1);

double to_degree(double theta){
	return theta*180.0/PI;
}
int main(){
	ios::sync_with_stdio(0);
	double a, b, x;
	cin >> a >> b >> x;
	double area = x/a;
	if(area>(a*b)/2.0){
		double al = 2.0*(area-(a*b)/2.0);
		area -=al;
		b = (2.0*area)/a;
	}
	else{
		a = (2.0*area)/b;
	}
	double theta = atan(b/a);
	cout << fixed << setprecision(20) << to_degree(theta) << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second

int main() {
    int d, t, s;
    cin>>d>>t>>s;

    int time = d/s + (d%s != 0);

    if(time <= t) printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
//vector<vector<int>> a(5, vector<int>(5, 0)) 5*5-0
int main(){
    int l, r, d;
    cin >> l >> r >> d;
    int count = 0;

    for(int i = l; i <= r; i++){
        if(i % d == 0){
            count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 3648
#include<algorithm>
#include<map>
#include<iostream>
#include<string>
using namespace std;

int main(){
    map<string,int> sent;
    string freq,lngest="";
    size_t N=0;

    string word;
    while(cin>>word){
        ++sent[word];
        if(sent[word]>N){
            N=sent[word];
            freq=word;
        }
        lngest=(word.size()>lngest.size()?word:lngest);
    }
    cout<<freq<<" "<<lngest<<"\n";
}

Measured memory_bytes: 3164
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	bool a=true;
	char s[30];
	cin>>s;
	for(int i=0;i<=strlen(s);i++)
	{
		for(int j=i+1;j<=strlen(s);j++)
		{
			if(s[i]==s[j])
			{
				a=false;
			}
		}
	}
	if(a==false)
		cout<<"no"<<endl;
	else
		cout<<"yes"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()
 
using namespace std;
using ll  = long long;
using pll = pair<ll, ll>;
 
const ll MOD  = 1e9+7;
const ll LINF = 1LL << 60;
const int INF = 1e9 + 7;

int main(){
    string s;
    cin >> s;
    if(s == "AAA" || s == "BBB")cout << "No";
    else cout << "Yes";
}

Measured memory_bytes: 256
/*
   Creator - Glitched
   Yeet!!
*/
#include "bits/stdc++.h"
using namespace std;

#define testcases ll T;cin>>T;while(T--)
#define ll long long
#define loop(i,x,n) for(ll i=x;i<n;i++)

int main()
{
  bool ans = 0;
  ll x,y;
  cin>>x>>y;
  ll a, b;
  loop(i,0,x+1){
    a = i;
    b = x-a;
    if(2*a + 4*b == y)ans = true;
  }
  cout<<(ans?"Yes":"No");
}

Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
using namespace std;



const long long int mod=1000000007;
const long long int INF=99999999999999999;
long long int mode=0;
string s,t;

long long int n,a,b,c;
pair<long long int,long long int>pa[300005];

int main() {
	cout << fixed << setprecision(18);
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;
        pa[i]={a,0};
    }
    for(int i=0;i<n;i++){
        cin>>a;
        pa[n+i]={a-1,1};
    }
    for(int i=0;i<n;i++){
        cin>>a;
        pa[i+2*n]={a-2,2};
    }
    n*=3;
    a=0;
    b=0;
    c=0;
    sort(pa,pa+n);
    for(int i=0;i<n;i++){
        if(pa[i].second==0){
            a++;
        }else if(pa[i].second==1){
            b+=a;
        }else{
            c+=b;
        }
    }
    cout<<c;
} 


Measured memory_bytes: 4992
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	sx, sy, tx, ty := nextInt(), nextInt(), nextInt(), nextInt()

	dx := tx - sx
	dy := ty - sy

	ans := ""

	// Path1
	ans += strings.Repeat("U", dy) + strings.Repeat("R", dx)

	// Path2
	ans += strings.Repeat("D", dy) + strings.Repeat("L", dx)

	// Path3
	ans += "L" + strings.Repeat("U", dy+1) + strings.Repeat("R", dx+1) + "D"

	// Path4
	ans += "R" + strings.Repeat("D", dy+1) + strings.Repeat("L", dx+1) + "U"

	fmt.Println(ans)
}


Measured memory_bytes: 768
#include <stdint.h>

#include <algorithm>
#include <bitset>
#include <cassert>
#include <functional>
#include <iostream>
#include <string>
#include <vector>

uint64_t ModMul(uint64_t a, uint64_t b, uint64_t p) { return (a * b) % p; }

uint64_t ModPow(uint64_t n, uint64_t k, uint64_t p) {
  // returns n ^ k (mod p)
  uint64_t v = n;
  uint64_t result = 1;
  for (int i = 0; i < 64; i++) {
    if ((k >> i) == 0) break;
    if ((k >> i) & 1) {
      result = ModMul(result, v, p);
    }
    v = ModMul(v, v, p);
  }
  return result;
}

void TestModPow() {
  constexpr uint64_t kMod = 1e9 + 7;
  for (int i = 1; i < 10; i++) {
    assert(ModPow(i, kMod, kMod) == i);
  }
  for (int i = 1; i < 10; i++) {
    assert(ModPow(i, kMod - 1, kMod) == 1);
  }
}

std::vector<uint64_t> MakeInverseElementTable(int max, int mod) {
  std::vector<uint64_t> invTable;
  invTable.resize(max + 1);
  for (int i = 1; i <= max; i++) {
    invTable[i] = ModPow(i, mod - 2, mod);
  }
  return invTable;
}

uint64_t ModDiv(const std::vector<uint64_t> &invTable, int mod, uint64_t a,
                uint64_t b) {
  assert(0 <= b && b < invTable.size());
  return ModMul(a, invTable[b], mod);
}

uint64_t ModMultiChoice(const std::vector<uint64_t> &invTable, int mod,
                        uint64_t n, uint64_t k) {
  uint64_t result = 1;
  for (int i = 1; i <= n + k - 1; i++) {
    result = ModMul(result, i, mod);
  }
  for (int i = 1; i <= k; i++) {
    result = ModDiv(invTable, mod, result, i);
  }
  for (int i = 1; i <= n - 1; i++) {
    result = ModDiv(invTable, mod, result, i);
  }
  return result;
}

int main(int argc, char *argv[]) {
  TestModPow();

  constexpr uint64_t kMod = 1e9 + 7;
  std::vector<uint64_t> invTable = MakeInverseElementTable(1e5 * 2, kMod);

  uint64_t N, M;
  std::cin >> N >> M;

  std::vector<uint64_t> facto_counts;

  uint64_t count;

  count = 0;
  while (!(M % 2)) {
    count++;
    M /= 2;
  }
  if (count) facto_counts.push_back(count);

  for (uint64_t i = 3; M != 1; i += 2) {
    count = 0;
    while (!(M % i)) {
      count++;
      M /= i;
    }
    if (count) facto_counts.push_back(count);
  }

  uint64_t result = 1;
  for (int cnt : facto_counts) {
    result = ModMul(result, ModMultiChoice(invTable, kMod, cnt + 1, N - 1), kMod);
  }
  
  std::cout << result << std::endl;

  return 0;
}


Measured memory_bytes: 4232
#include<stdio.h>
int main(void)
{
	int r;
	scanf("%d",&r);
	if(r<1200){
		printf("ABC\n");
	}
	else if(r<2800){
		printf("ARC\n");
	}
	else {
		printf("AGC\n");
	}
	return 0;
}

Measured memory_bytes: 128
import math

N, D = map(int, input().split())

X = []

for i in range(N):
    X.append(list(map(int, input().split())))

count = 0
count2 = 0
for i in range(N):
    for j in range(N):
        buff = 0
        flag = False
        for d in range(D):
            if i != j:
                count2 += 1
                flag = True
                buff += abs(X[i][d]-X[j][d])**2
        if math.sqrt(buff) % 1 == 0 and flag:
            # print(buff)
            count += 1

# print(count2)
# print(X)
print(count//2)

Measured memory_bytes: 38384
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */

#include <bits/stdc++.h>
//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class ABlackjack {
public:
    void solve(std::istream &in, std::ostream &out) {
        vector<int> a(3);
        for (int &x: a) {
            in >> x;
        }
        int sum = accumulate(a.begin(), a.end(), 0);
        bool res = sum < 22;
        out << (res ? "win" : "bust") << "\n";
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    ABlackjack solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for(int i = (s); i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
typedef long long ll;
const int INF = 1001001001;
const int mod = 1000000007;

void dfs(int x, int y) {}

int main() {
    int A, B;
    char S;
    cin >> A >> S >> B;
    if(S == '+'){
        cout << A + B << endl;
    }
    else if(S == '-'){
        cout << A - B << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import numpy as np
def I(): return int(input())
def LI(): return list(map(int,input().split()))
N = I()
xy = np.array([LI() for _ in range(N)])
sum_norm = 0
for i in range(N):
    for j in range(i,N):
        sum_norm += np.linalg.norm(xy[j]-xy[i])
print(2*sum_norm/N)


Measured memory_bytes: 12424
#include <iostream>
#include<string>
#include<algorithm>
#include<stdio.h>

using namespace std;

int main(){
    int a[3];
    cin>>a[0]>>a[1]>>a[2];

    sort(a, a+3);
    if(a[0]==5 && a[1]==5 && a[2]==7)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;

    return 0;
}

Measured memory_bytes: 256