akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <queue>

using std::cerr;
using std::cin;
using std::cout;
using std::pair;
using std::string;
using std::vector;
//region
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (b); i >= (b); --i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define repr(i, n) for (int i = (n)-1; i >= 0; --i)
#define repr1(i, n) for (int i = (n); i > 0; --i)
#define outif(b, t, f) cout << ((b) ? (t) : (f)) << endl
#define all(vec) (vec).begin(), (vec).end()
#define sz(x) (int((x).size()))
#define mset(v, n) std::memset((v), n, sizeof(v))
#define BIT(N) (1LL << (N))
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
using vint = vector<int>;
using vlong = vector<ll>;
using vstr = vector<string>;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpil = vector<pil>;
using vpll = vector<pll>;
using vvi = vector<vint>;
using vvl = vector<vlong>;
vector<string> split(const string &s, const string &delim) {
  vector<string> res;
  uint pos = 0;
  while (true) {
    const int found = s.find(delim, pos);
    if (found < 0) {
      res.push_back(s.substr(pos));
      break;
    }
    res.push_back(s.substr(pos, found - pos));
    pos = found + delim.size();
  }
  return res;
}
template<typename T> string join(vector<T> &vec, const string &sep) {
  size_t size = vec.size();
  if (!size) return "";
  std::stringstream ss;
  for (int i = 0; i < size - 1; i++)
    ss << vec[i] << sep;
  ss << vec[size - 1];
  return ss.str();
}
template<typename T> std::istream &operator>>(std::istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; }
template<typename Iter> inline void print(const Iter &first, const Iter &last, const std::string &d, bool endline) {
  cout << *first;
  for (Iter iter = first + 1; iter < last; ++iter) {
    cout << d << *iter;
  }
  if (endline) cout << "\n";
}
constexpr ll powmod(ll a, ull b, ull p) {
  ll res = 1;
  while (b > 0) {
    if (b % 2) res = res * a % p;
    a = a * a % p;
    b >>= 1u;
  }
  return res;
}
template<class T> bool chmax(T &a, const T &b) { return a < b ? (a = b, true) : false; }
template<class T> bool chmin(T &a, const T &b) { return a > b ? (a = b, true) : false; }
template <typename T> void bsort(vector<T>& v) { std::sort(v.begin(), v.end()); }
template <typename T> void rsort(vector<T>& v) { std::sort(v.begin(), v.end(), std::greater<T>()); }
struct iii {
    iii() {
      cin.tie(nullptr); cout.tie(nullptr);
      std::ios::sync_with_stdio(false);
      cout << std::fixed << std::setprecision(16);
    }
} init;
//endregion

void solve();

int main() {
  int t = 1;
  // scanf("%d", &t);
  rep(_,t) solve();
  return 0;
}

int divcnt(int n) {
  int res = 0;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i) continue;
    ++res;
    res += i * i < n;
  }
  return res;
}

void solve() {
  int n;scanf("%d",&n);
  int cnt=0;
  for(int i=1;i<=n;i+=2)cnt+=divcnt(i)==8;
  printf("%d",cnt);
}

Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.container;
import std.array;
import std.math;
import std.range;
import std.typecons;
import std.ascii;
import std.format;

void main()
{
  auto l = readln.chomp;
  if (l.equal(l.retro)) {
    writeln = "Yes";
  } else {
    writeln = "No";
  }
}

Measured memory_bytes: 256
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

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

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

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

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



def main():
    n=int(input())
    s=[input() for i in range(n)]
    s=sorted(s)
    s.append("")
    tempn=0
    temp=s[0]
    maxn=0
    aa=[]
    for i in range(n+1):
        if temp==s[i]:
            tempn+=1
        else:

            aa.append([s[i-1],tempn])
            maxn=max(maxn,tempn)
            tempn=1
            temp=s[i]
    aa=sorted(aa)

    for a,b in aa:
        if b==maxn:
            print(a)



if __name__ == "__main__":
    main()

Measured memory_bytes: 106328
package main

import "fmt"

func main(){
	var N, M int;

	fmt.Scan(&N);
	s1 := make([]string, N);

	for i:=0 ; i < N ; i++{
		fmt.Scan(&s1[i]);
	}
	fmt.Scan(&M);
	s2 := make([]string, M);
	m := make(map[string]int);
	for i:=0 ; i < M ; i++{
		fmt.Scan(&s2[i]);
	}

	for i := 0 ; i < N ; i++ {
		m[s1[i]]++;
	}
	for i := 0 ; i < M ; i++ {
		m[s2[i]]--;
	}

	max := 0;
	for i := 0 ; i < N ; i++{
		if max < m[s1[i]]{
			max = m[s1[i]];
		}
	}
	if max <0 {
		max = 0;
	}
	fmt.Println(max);
}

Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	/**
	 * problem solver
	 */
	public static class Problem {

		/**
		 * paramters
		 */
		private int n;
		private int m;
		private ArrayList<Integer> l;
		private ArrayList<Integer> r;

		/**
		 * constructor
		 */
		Problem() {
			l = new ArrayList<Integer>();
			r = new ArrayList<Integer>();
			n = 0;
			m = 0;
		}

		/**
		 * standard input
		 */
		void input() {
			Scanner sc = new Scanner(System.in);
			n = sc.nextInt();
			m = sc.nextInt();

			for (int i = 0; i < m; i++) {
				l.add(sc.nextInt());
				r.add(sc.nextInt());
			}
			sc.close();
		}


		/**
		 * solver
		 */
		void solve() {
			int lmax = -1;
			int rmin = Integer.MAX_VALUE;

			for (int i = 0; i < m; i++) {
				lmax = Math.max(lmax, l.get(i));
				rmin = Math.min(rmin, r.get(i));
			}

			int ans = 0;
			
			if (lmax <= rmin) {
				ans = rmin - lmax + 1;
			} else {
				ans = 0;
			}

			System.out.println(ans);

		}

	}

	public static void main(String args[]) {

		Problem p = new Problem();

		p.input();

		p.solve();
	}
}


Measured memory_bytes: 67448
N = gets.to_i
h = Hash.new(0)

(1..100).each do |x|
  (1..100).each do |y|
    (1..100).each do |z|
      h[x**2+y**2+z**2+x*y+y*z+z*x] += 1
    end
  end
end

(1..N).each{|n| puts h[n]}

Measured memory_bytes: 16696
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
// Welcome to my source code!

int main() {
    int n, m;
    cin >> n;
    string s[n];
    map<string, int> mp;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        mp[s[i]]++;
    }
    cin >> m;
    string t[m];
    for (int i = 0; i < m; i++) {
        cin >> t[i];
        mp[t[i]]--;
    }
    int ans = 0;
    for (auto x : mp) {
        ans = max(ans, x.second);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def fib_bad(n):
    if not n or n == 1:
        return 1
    return fib_bad(n - 2) + fib_bad(n - 1)


def fib_dp(n):
    fib_list[:1] = [1, 1]
    for i in range(2, n + 1):
        fib_list[i] = fib_list[i - 2] + fib_list[i - 1]
    return fib_list.pop()


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    index = int(_input[0])
    fib_list = [None] * index
    # print(fib_bad(index))
    print(fib_dp(index))

Measured memory_bytes: 7700
#include<stdio.h>
#define max(a,b) (a>b?a:b)
signed main(){
	int Max=0,n,ima=0;
	char c;
	scanf("%d",&n);
	for(register int i=0;i<n;i++){
		scanf(" %c",&c);
		if(c=='I')++ima;
		else --ima;
		Max=max(Max,ima);
	}
	printf("%d\n",Max);
}


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

using namespace std;

#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)

set<lli> enum_div(lli n){
	set<lli> ret;
	for(lli i=1;i*i<=n;i++){
		if(n%i==0){
			ret.insert(i);
			ret.insert(n/i);
		}
	}
	return ret;
}

lli judge(lli n,lli div){
	if(n/div == n%div){
		return 1;
	}
	else return 0;
}

signed main(){

	lli n;
	cin>>n;
	set<lli> s;
	s = enum_div(n);

	lli ans=0;
	for(auto e:s){
		if(e==1)continue;
		if(judge(n,e-1)){
			ans+=(e-1);
		}
	}

	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip> //cout << fixed << setprecision(10) << num << endl;
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
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;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    string s; cin >> s;
    if(s[2]==s[3]&&s[4]==s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
}



Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] arg){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
		int M = sc.nextInt();
		String ans = "";
		List<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++){
			list.add(sc.next());
		}
		Collections.sort(list);
		for(int j = 0; j < N; j++){
			ans += list.get(j);
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 24276
#include<bits/stdc++.h>
using namespace std;
int main(){
  int temp,go=0,si=0;
  for(int i=0;i<3;i++){
    cin >> temp;
    if(temp == 5){
      go++;
    }
    if(temp == 7){
      si++;
    }
  }
  if(go==2 && si==1){
    cout << "YES";
  }else{
    cout << "NO";
  }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int sum,i;
    char N[1003]={'\0'};
    for(;;){
        scanf("%s",N);
        if(N[0]=='0'){
            break;
        }
        sum=0;
        i=0;
        while(N[i]!='\0'){
            sum+=N[i]-48;
            i++;
        }
        printf("%d\n",sum);
    }
    return 0;
}


Measured memory_bytes: 2100
#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0422"

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

#define call_from_test
#ifndef call_from_test
#include<bits/stdc++.h>
using namespace std;
#endif
//BEGIN CUT HERE
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
//END CUT HERE
#ifndef call_from_test
//INSERT ABOVE HERE
signed main(){
  return 0;
}
#endif

#ifndef call_from_test
#include<bits/stdc++.h>
using namespace std;
#endif
//BEGIN CUT HERE
template<typename T>
struct Rint{
  static T mod;
  static void set_mod(T nmod){mod=nmod;}

  T v;
  Rint():v(0){}
  Rint(signed v):v(v){}
  Rint(long long t){v=t%mod;if(v<0) v+=mod;}

  Rint pow(long long k){
    Rint res(1),tmp(v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }

  static Rint add_identity(){return Rint(0);}
  static Rint mul_identity(){return Rint(1);}

  Rint inv(){return pow(mod-2);}

  Rint& operator+=(Rint a){v+=a.v;if(v>=mod)v-=mod;return *this;}
  Rint& operator-=(Rint a){v+=mod-a.v;if(v>=mod)v-=mod;return *this;}
  Rint& operator*=(Rint a){v=1LL*v*a.v%mod;return *this;}
  Rint& operator/=(Rint a){return (*this)*=a.inv();}

  Rint operator+(Rint a) const{return Rint(v)+=a;}
  Rint operator-(Rint a) const{return Rint(v)-=a;}
  Rint operator*(Rint a) const{return Rint(v)*=a;}
  Rint operator/(Rint a) const{return Rint(v)/=a;}

  Rint operator-() const{return v?Rint(mod-v):Rint(v);}

  bool operator==(const Rint a)const{return v==a.v;}
  bool operator!=(const Rint a)const{return v!=a.v;}
  bool operator <(const Rint a)const{return v <a.v;}

  static Rint comb(long long n,int k){
    Rint num(1),dom(1);
    for(int i=0;i<k;i++){
      num*=Rint(n-i);
      dom*=Rint(i+1);
    }
    return num/dom;
  }
};
template<typename T> T Rint<T>::mod;
template<typename T>
ostream& operator<<(ostream &os,Rint<T> m){os<<m.v;return os;}
//END CUT HERE
#ifndef call_from_test
signed main(){
  return 0;
}
#endif

#undef call_from_test

signed main(){

  int n,k,m;
  cin>>n>>k>>m;

  using R = Rint<int>;
  R::set_mod(m);
  if(n>k*2) drop(R(k).pow(n));

  int sz=1<<(k*2-1);
  vector< vector<R> > dp(k,vector<R>(sz,0));
  for(int i=0;i<k;i++) dp[i][0]=1;

  R ans=R(k).pow(n);
  for(int bit=0;bit<sz;bit++){
    for(int i=0;i<k;i++){
      if(dp[i][bit]==0) continue;
      if(__builtin_popcount(bit)+1==n){
        ans-=dp[i][bit];
      }
      for(int j=0;j<k;j++){
        int d=(i-j)+(k-1);
        if((bit>>d)&1) continue;
        dp[j][bit|(1<<d)]+=dp[i][bit];
      }
    }
  }

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



Measured memory_bytes: 25272
#include<stdio.h>

int main()
{
    int h,w,n;
    scanf("%d%d%d",&h,&w,&n);
    if(h<=w){
        if(n%w==0)
            printf("%d\n",n/w);
        else
            printf("%d\n",n/w+1);
    }else{
        if(n%h==0)
            printf("%d\n",n/h);
        else
        {
            printf("%d\n",n/h+1);
        }
        
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <set>
using namespace std;

#define __int64 long long
#define long __int64
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
const int Vec = 4;
const int Vecy[Vec] = {0,-1,0,1};
const int Vecx[Vec] = {1,0,-1,0};
const int Modd = 1000000007;

set<int> d;

int main(){
    int n;
    int in;
    cin >> n;
    rep(i,n){
        cin >> in;
        d.insert(in);
    }

    cout << d.size() << endl;

}

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


#define     Boost               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define     all(cont)           cont.begin(),cont.end()
#define     rall(cont)          cont.rbegin(),cont.rend()
#define     foreach(cont)       for(auto &val: cont)
#define     dbg(args...)        do {   cerr << #args << "-> " ;  show(args); } while(0); cerr<< endl ;
#define     TS                  template < typename T >
#define     TP                  template < typename F, typename S >
#define     TM                  template<typename T1, typename... T2>
#define     flush               cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define     Case                cout<< "Case "<< ++cs <<": "
#define     PI                  3.1415926535897932384
#define     pf                  printf
#define     sf                  scanf
#define     mp                  make_pair
#define     pb                  push_back
#define     ff                  first
#define     ss                  second

typedef     long long                   ll ;
typedef     unsigned long long          ull ;
typedef     pair <int, int>             pii ;

/** Debugging Tool **/
TS void show(const T& v) {    cerr << v << ' ' ;}
TM void show(const T1& first,const T2&... rest){show(first);show(rest...);}
TP ostream& operator<<(ostream& os,const pair<F,S>& p){return os<<"("<<p.ff<<", "<<p.ss<<")";}
TS ostream& operator<<(ostream& os,const vector<T>& v){os << "{"; typename vector< T >::const_iterator it;
    for(it=v.begin();it!=v.end();it++){if( it != v.begin() )os<<", ";os<<*it;}return os<<"}";}
TS ostream& operator<<(ostream& os,const set<T>& v){os<<"[";typename set<T>::const_iterator it;
    for(it=v.begin();it!=v.end();it++){if(it!=v.begin())os<<", ";os<<*it;}return os<<"]";}
TP ostream& operator<<(ostream& os,const map<F,S>& v){os<<"[";typename map<F,S>::const_iterator it;
    for(it=v.begin();it!=v.end();it++){if(it!=v.begin())os<<", ";os<<it->ff<<" = "<<it->ss;}return os<<"]";}
/** Ends **/

const double eps = 1e-9 ;
/*
int const dr[] = { 0, 0, 1, -1, -1, -1, 1, 1 } ;
int const dc[] = { 1, -1, 0, 0, -1, 1, -1, 1 } ;
int const drH[] = { 2, 1, -1, -2, -2, -1, 1, 2 } ;
int const dcH[] = { 1, 2, 2, 1, -1, -2, -2, -1 } ;
*/


void solve(){
    ll n ;
    cin>> n ;
    ll temp = (n/1000LL) ;
    if(n%1000LL ==0) cout<< "0" << endl ;
    else{
        ll rem = ((temp+1)*1000LL)-n ;
        cout<< rem << endl ;
    }

}


int main()
{
    Boost;

    #ifndef ONLINE_JUDGE
    clock_t tStart = clock();
    freopen("input.txt","r",stdin);    // Read
    freopen("output.txt","w",stdout);  // Write
    #endif

    int t = 1,cs = 0 ;
    //cin>> t ;

    while(t--){
        //Case ;
        solve() ;
    }

    #ifndef ONLINE_JUDGE
    fprintf(stderr, "\n>> Runtime: %.10fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC);
    #endif

    return 0;
}



Measured memory_bytes: 3636
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
template <class T> inline void chmax(T & a, T const & b) { a = max(a, b); }
 
int main() {
    int n, t; scanf("%d%d", &n, &t);
    ll offset = 0, interval = 0;
    while (n --) {
        int h; scanf("%d", &h);
        chmax<ll>(interval, h);
        ll p = (t - offset) / interval;
        ll q = (t - offset) % interval;
        int result = max<ll>(0, p + (q >= h));
        printf("%d\n", result + 1);
        offset += h;
    }
    return 0;
}

Measured memory_bytes: 3216
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<29;

int dp[110][110];

int main(){
  int n,m;
  cin >> n >> m;
  rep(i,n)rep(j,n) dp[i][j]=inf;
  rep(i,n) dp[i][i]=0;
  vector<bool> ans(m,1);
  vector<tiii> to(m);
  rep(i,m){
    int a,b,c; cin >> a >> b >> c;
    a--; b--;
    dp[a][b]=c;
    dp[b][a]=c;
    to[i]=tiii(a,b,c);
  }
  rep(k,n)rep(i,n)rep(j,n) chmin(dp[i][j],dp[i][k]+dp[k][j]);
  rep(i,n)rep(j,n){
    rep(k,m){
      int a,b,c;
      tie(a,b,c)=to[k];
      if(dp[i][j]==dp[i][a]+c+dp[b][j]) ans[k]=0;
    }
  }
  int cnt=0;
  rep(i,m){
    if(ans[i]) cnt++;
  }
  cout << cnt << endl;
  
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define INF 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
ll a[100005];
int op[100005];
ll dp[100005][10];

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lld%*c",&a[i]);
		if(i!=n-1){
			char c;
			scanf("%c%*c",&c);
			if(c=='+')op[i+1]=1;
			else op[i+1]=-1;
		}
	}
	op[0]=1;
	for(int i=0;i<=n;i++){
		for(int j=0;j<10;j++){
			dp[i][j]=-(ll)(INF)*n;
		}
	}
	dp[0][0]=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<9;j++){
			int cp=op[i];
			if(j%2==1)cp=-cp;
			dp[i+1][j]=max(dp[i+1][j],(ll)dp[i][j]+a[i]*cp);
			if(op[i]==-1){
				dp[i+1][j+1]=max(dp[i+1][j+1],(ll)dp[i][j]+a[i]*cp);
			}
			if(j>0){
				dp[i+1][j-1]=max(dp[i+1][j-1],(ll)dp[i][j]+a[i]*cp);
			}
		}
	}
	printf("%lld\n",dp[n][0]);
	return 0;
}


Measured memory_bytes: 9216
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		int num = scan.nextInt();
		int alice = scan.nextInt();
		int borys = scan.nextInt();

		// check
		boolean turn = true;
		while(true){
			if(turn){	// alice
				if(alice == 1 && borys == alice + 1){
					System.out.println("Borys");
					break;
				} else if(alice + 1 != borys){
					alice++;
				} else {
					alice--;
				}
			} else {	// borys
				if(borys == num && alice == borys - 1){
					System.out.println("Alice");
					break;
				} else if(borys - 1 != alice){
					borys--;
				} else {
					borys++;
				}
			}

			turn = !turn;
		}

	}
}


Measured memory_bytes: 23124
// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

const i64 MOD = 1e9 + 7;
const i64 INF = i64(1e18) + 7;

const string YES = "Yes";
const string NO = "No";

template <typename T>
bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}


void solve(long long h, long long n, std::vector<long long> a){
    cout << (accumulate(a.begin(), a.end(), 0LL) >= h ? "Yes" : "No") << endl;
}


signed main(){
    long long H;
    scanf("%lld",&H);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(H, N, std::move(A));
    return 0;
}


Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <map>

using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define ll long long

#define MAX_V 300

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

	int res = 0;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		res += min(x, (k - x)) * 2;
	}


	cout << res << endl;
	


	return (0);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main(){
  
    string n;
    cin >> n;
	
  	rep(i, n.length()){
		if(n[i] == '1')
          n[i] = '9';
      	else if(n[i] == '9')
          n[i] = '1';
    }
  	cout << n << endl;
  
    return 0;
}


Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
using ld = long double;
using Pair = pair<int, int>;
using Graph = vector<vector<int>>;
#define MOD 1000000007
#define INF 1000000007
#define SEP " "

int     main()
{
	ll n;
	cin >> n;
	string ans;
	ll d = 26;
	for (int i = 0; ; i++) {
		n--;
		char tmp = n % d;
		ans += tmp + 'a';
		if (n < 26)
			break ;
		n /= d;
	}
	reverse(ans.begin(), ans.end());
	cout << ans << endl;
}






Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#include <sstream>
#include <string>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
using namespace std;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=100001;
bool vis[N];
vector <int> adj[N];
ll gcd(ll a, ll b) { if (a == 0) return b; return gcd(b % a, a); } 
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
// ll binaryNum[64];
// void decToBinary(ll n, ll k) 
// { 
//     // binaryNum[64]={0};
//     rep(i,64){
//         binaryNum[i]=0;
//     }
//     int i = 0; 
//     while (n > 0) { 
//         binaryNum[i] = n % k; 
//         n = n / k; 
//         i++; 
//     } 
// }
// ll dp[2001][2001]; 
// ll countPartitions(ll n, ll k) 
// {   
//     if (n < k) 
//         return 0;
//     if (n < 2 * k) 
//         return 1; 
//     if (dp[n][k] >= 0) 
//         return dp[n][k]; 
//     ll answer = 1; 
//     for (int i = k; i < n; i++) 
//         answer = answer + countPartitions(n - i, k); 
//     dp[n][k] = answer%mod; 
//     return answer%mod; 
// } 


void solve(){
    int n;
    cin>>n;
    vl a;
    rep(i,n){
        int u,v;
        cin>>u>>v;
        if(u==v){
            a.pb(i);
        }
    }
    int prev=-2;
    int count=0;

    rep(i,a.size()){
        if(a[i]==prev+1){
            count++;
        }
        else{
            if(count>=2){
                cout<<"Yes";
                return;
            }
            count=0;
        }
        if(i==a.size()-1){
            if(count>=2){
                cout<<"Yes";
                return;
            }
        }
        prev=a[i];
    }
    cout<<"No";
}


int main()
{

    // cout<<1<<endl;
    #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif
    
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    // cin>>T;
    int t=0;
    while(t++<T)
    {
        // cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 6192
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")

//#include<bits/stdc++.h>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

#define _USE_MATH_DEFINES
#define ll long long
#define ins Not Needed Thing
#define ull unsigned long long
#define ld long double
#define Accepted 0
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define sz(x) (int)(x.size())
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define SORRY FUL Accepted 
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0)
#define Toktama Kazakhstan 

using namespace std;

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 3e5 + 123;                                          
const int PRI = 555557;
const int pri = 997;

int tests = 1;

inline void Solve () {
	//easy
	int n;
	cin >> n;

	multiset < int > cur;
	ll ans = 0;
	for (int i = 1; i <= n * 3; i ++) {
		int x;
		cin >> x;
		cur.insert(x);
	}

	while(cur.size()) {
		int mx = *cur.rbegin();
		cur.erase(cur.find(mx));
		mx = *cur.rbegin();
		ans += mx;
		cur.erase(cur.find(mx));
		mx = *cur.begin();
		cur.erase(cur.find(mx)); 
	}


	cout << ans;
}

int main () {
	SpeedForce;
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);	
	// cin >> tests;
	while(tests --) {
		Solve ();
		// Ee Zadrot
	}

	return Accepted; 
}

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

int main() {
  int N;cin>>N;
  vector<pair<int,int>> tasks;
  for(int i=0;i<N;i++){
    int a,b;cin>>a>>b;
    tasks.emplace_back(b,a);
  }
  sort(tasks.begin(),tasks.end());
  int flow=0;
  bool can=true;
  for(int i=0;i<N;i++){
    flow += tasks[i].second;
    if(flow>tasks[i].first){
      can =false;
      break;
    }
  }
  if(can) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 5336
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
const int mod=1000000007;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<int> a(n);
	int ans=1;
	rep(i,n){
		cin >> a.at(i);
		if(a.at(i)%2==0) ans*=2;
	}
	cout << (int)pow(3,n)-ans << endl;
}

Measured memory_bytes: 256
n = int(input())
csf = [tuple(map(int, input().split())) for _ in range(n - 1)]

for i in range(n):
    t = 0
    for j in range(i, n - 1):
        c, s, f = csf[j]
        t = max(s, ((t + f - 1) // f) * f) + c
    print(t)

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
int main(void){
	string s,t;
	int cnt;
	int i;
	cin>>s>>t;
	cnt=0;
	for(i=0;i<3;i++){
		if(s[i]==t[i]){
			cnt++;
		}
	}
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
using namespace std;

int main(){
    int N;cin>>N;
    vector<vector<int>> A(200010,vector<int>(30)),S(200010,vector<int>(30,0));
    for(int i=1;i<=N;i++){
        int a;cin>>a;
        int k=0;
        while(k<=19){
            A[i][k]=a%2;
            S[i][k]=S[i-1][k]+A[i][k];
            a/=2;
            k++;
        }
    }
    
    int l=1,r=1;
    long long ans=0;
    while(l<=N){
        if(r<N){
            bool b=true;
            while(b){
                for(int i=0;i<20;i++)
                    if(S[r+1][i]-S[l-1][i]>=2)b=false;
                if(b)r++;
                if(r==N)break;
            }
        }
        ans+=r-l+1;
        l++;
        if(r<l)r=l;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 59648
from sys import stdin
import math
N = int(stdin.readline().rstrip())

ans = math.floor(N / 1.08)

while True:
    if math.floor(ans * 1.08) > N:
        print(':(')
        exit()
    if math.floor(ans * 1.08) == N:
        print(ans)
        exit()
    else:
        ans += 1


Measured memory_bytes: 2940
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    for (i in 1 .. n) {
        var x = i
        while (x != 0) {
            if (x % 10 == 3 || i % 3 == 0) {
                print(" $i")
                break
            }
            x /= 10
        }
    }
    println()
}



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

using namespace std;

int keta_sm(int m){
  int tmp=m;
  int sm=0;
  while(tmp!=0){
    sm+=tmp%10;
    tmp/=10;
  }
  return sm; 
}

int main(){
  int n;
  int a, b;
  cin >> n;
  cin >> a >> b;
  int sm=0;
  for(int i=1;i<=n;i++){
    int tmp=keta_sm(i);
    if(a<=tmp && tmp<=b){
      sm+=i;
    }
  }
  cout << sm << endl;
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string alphabet = "abcdefghijklmnopqrstuvwxyz";

            char[] alpahbetdef = alphabet.ToCharArray();

            //??????????????°???????´?????????????
            int[] resultcount1D = new int[26];


            while (true)
            {
                string input = Console.ReadLine();

                if (string.IsNullOrEmpty(input)) break;

                char[] inputchar = input.ToCharArray();

                for (int i = 0; i < alphabet.Length; i++)
                {

                    for (int j = 0; j < inputchar.Length; j++)
                    {
                        //??§????????¨?°??????????????????????????????´?????????????????????
                        if (alphabet[i].ToString().ToUpperInvariant() == inputchar[j].ToString().ToUpperInvariant())
                        {
                            resultcount1D[i] += 1;
                        }
                    }
                }

            }

            //????????????
            for (int a = 0; a < alpahbetdef.Length; a++)
            {
                Console.WriteLine("{0} : {1}", alpahbetdef[a], resultcount1D[a]);
            }
        
        }
    
    }

}

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

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

    // B1          B2          B3          ...
    // max(A1, A2) max(A2, A3) max(A3, A4) ...

    // A1* == B1
    // A2* == min(B1, B2)
    // A3* == min(B2, B3)
    // ...
    // A(N - 1)* == min(B(N - 2), B(N - 1))
    // AN* == B(N - 1)

    vector<int> B(N + 1, 1e6);
    for (int i = 1; i <= N - 1; i++)
    {
        cin >> B[i];
    }

    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        ans += min(B[i], B[i + 1]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  if (b % a == 0){
    cout << a + b << '\n';
  }
  else{
    cout << b - a << '\n';
  }
  return 0; 
}

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

using namespace std;

int main(){
    long long n,k;
    cin >> n;
    n++;
    k = int(log10(n));
    for(int i=0;i<k;i++)n/=10;
    cout << (n-1)+k*9 << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const int MOD = 1e9+7;

struct UnionFind {
	vector<int> data;

	UnionFind(int sz) {
		data.assign(sz, -1);
	}

	void unite(int x, int y) {
		x = find(x), y = find(y);
		if (x == y) return;
		if (data[x] > data[y]) swap(x, y);
		data[x] += data[y];
		data[y] = x;
	}

	int find(int k) {
		if(data[k] < 0) return(k);
		return data[k] = find(data[k]);
	}

	bool same(int x, int y)	{
		return find(x) == find(y);
	}

	int size(int k)	{
		return -data[find(k)];
	}
};

struct edge{
	int u, v;
	double cost;
};

struct sphere{
	double x, y, z, r;
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	// ifstream in("input.txt");
	// cin.rdbuf(in.rdbuf());


	while(true) {
		int n; cin >> n;
		if (!n) break;

		vector<sphere> a(n);
		rep(i, n) {
			double x, y, z, r; cin >> x >> y >> z >> r;
			a[i] = sphere{x, y, z, r};
		}

		vector<edge> b;
		rep(i, n) FOR(j, i, n) {
			if (i==j) continue;
			double distance = 
				pow(a[i].x-a[j].x, 2) +
				pow(a[i].y-a[j].y, 2) +
				pow(a[i].z-a[j].z, 2);
			distance = max(0.0, pow(distance, 0.5) - a[i].r - a[j].r);
			b.push_back(edge{i, j, distance});
		}

		UnionFind uf(n);
		sort(all(b), [](edge& a, edge& b){return a.cost<b.cost;});

		// for(const auto&e: b) {
		// 	cout << e.u <<" " << e.v << " " << e.cost << endl;
		// }

		double ans = 0;
		for(const auto& bb: b) {
			if (!uf.same(bb.u, bb.v)) {
				uf.unite(bb.u, bb.v);
				ans += bb.cost;
			}
		}

		cout << fixed << setprecision(3) << ans << endl;
	}
}


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

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

#define MOD 1000000007

using namespace std;

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

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  int N, d[55];

  std::cin >> N;

  for (int i = 0; i < N; i ++)
    std::cin >> d[i];

  long long S = 0;

  for (int i = 0; i < N; i ++)
    for (int j = i + 1; j < N; j ++)
      S += d[i] * d[j];

  std::cout << S << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <cctype>
#include <cstdio>
using namespace std;
typedef long long int64;
inline int read(int f = 1, int x = 0, char ch = ' ')
{
    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;
    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();
    return f*x;
}
const int N = 1e5+5;
struct Edge
{
    int next, to, w;
    Edge(int next = 0, int to = 0, int w = 0):next(next), to(to), w(w) {};
}edge[N<<1];
int tot, head[N];
void add(int x, int y, int z) { edge[++tot] = Edge(head[x], y, z); head[x] = tot; }
int n, m, c[N];
int64 ans, f[3], s;
bool color(int x, int col)
{   
    if(c[x]) return c[x] == col+1;   
    c[x] = col+1, ++f[col];
    bool ret = true;
    for(int i = head[x]; i; i = edge[i].next)
    {
        int y = edge[i].to, z = edge[i].w; s += z == 1;
        if(!color(y, col+z >= 3?col+z-3:col+z)) ret = false;
    }
    return ret;
}
int main()
{
    n = read(), m = read();
    for(int i = 1; i <= m; ++i)
    {
        int x = read(), y = read();
        add(x, y, 1), add(y, x, 2);
    }
    for(int x = 1; x <= n; ++x)
        if(!c[x])
        {
            s = f[0] = f[1] = f[2] = 0;
            if(!color(x, 1)) s = f[0]+f[1]+f[2], ans += s*s;
            else if(f[0]&&f[1]&&f[2]) ans += f[0]*f[1]+f[1]*f[2]+f[0]*f[2];
            else ans += s;
        }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 7936
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int A, B;
	cin >> A >> B;
	int ans = A + B;
	if (ans >= 10) {
		cout << "error" << endl;
	}
	else {
		cout << A + B << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

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

	private Scanner scan;

	private void mainrun() {
		scan = new Scanner(System.in);

		while(scan.hasNext()){
			int a = scan.nextInt();
			int b = scan.nextInt();
			int n = scan.nextInt();
			
			looprun(a,b,n);
		}
	}
	
	private void looprun(int a,int b,int n) {
		int Ans = 0;
		int num = (a % b) * 10;
		for(int i = 0;i < n;i++) {
			Ans += num / b;
			
			num = (num % b) * 10;
		}
		
		System.out.println(Ans);
	}
}


Measured memory_bytes: 26560
#include <bits/stdc++.h>
using  namespace  std;
using ll=long long;
int main(){
  vector<int> n(3);
   for(int i=0;i<3;i++) cin>>n.at(i);
  sort(n.begin(),n.end(),greater<int>());
  cout<<n.at(0)*10+n.at(1)+n.at(2)<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class B
{
	public static void Main() => (new Solver()).Solve();
}


public class Solver
{
	public void Solve()
	{
		string S = GetString();

		bool ok = true;
		for(int i = 0; i < S.Length; i++)
		{
			if(i % 2 == 0)
			{
				if(S[i] == 'L')
				{
					ok = false;
					break;
				}
			}
			else
			{
				if(S[i] == 'R')
				{
					ok = false;
					break;
				}
			}
		}

		Console.WriteLine(ok ? "Yes" : "No");

	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(int N) => Enumerable.Range(0, N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(int N) => Enumerable.Range(0, N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(int N) => Enumerable.Range(0, N).Select(_ => GetDouble()).ToArray();
	public static string[] GetStrings(int N) => Enumerable.Range(0, N).Select(_ => GetString()).ToArray();
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree < pairs ,  null_type , greater<pairs>,  rb_tree_tag ,  tree_order_statistics_node_update > 
#define ll long long
#define lld long double
#define vc vector<ll>
const ll MOD=(1e9 +7);
typedef pair<ll,ll>pairs;
ll power(ll a, ll b){ll res=1;a=a%MOD;while(b>0){if(b&1){res=(res*a)%MOD;b--;}a=(a*a)%MOD;b>>=1;}
    return res;}

int main() {
	// your code goes here
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	ll t,n,i,j,k,l,c,f;
	cin>>n;
	if(n>=30)cout<<"Yes";
	else cout<<"No";
	return 0;
}


Measured memory_bytes: 3604
#include<iostream>
#include<cstdio>
#include<map>
using namespace std;
int T;
long long n;
int a,b,c,d;
map<long long,long long>f;
long long dfs(long long n)
{
	if(n==0) return 0;
	if(n==1) return d;
	if(f[n]) return f[n];
	long long x=n/2*2,y=(n+1)/2*2;
	f[n]=min(dfs(x/2)+1LL*(n-x)*d+a,dfs(y/2)+1LL*(y-n)*d+a);
	x=n/3*3,y=(n+2)/3*3;
	f[n]=min(f[n],min(dfs(x/3)+1LL*(n-x)*d+b,dfs(y/3)+1LL*(y-n)*d+b));
	x=n/5*5,y=(n+4)/5*5;
	f[n]=min(f[n],min(dfs(x/5)+1LL*(n-x)*d+c,dfs(y/5)+1LL*(y-n)*d+c));
	f[n]=min((__int128)f[n],(__int128)n*d);
	return f[n];
}
void solve()
{
	scanf("%lld%d%d%d%d",&n,&a,&b,&c,&d);
	f.clear();
	printf("%lld\n",dfs(n));
	return;
}
int main()
{
	scanf("%d",&T);
	while(T--)
		solve();
	return 0;
}

Measured memory_bytes: 4596
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;



public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		int n = sc.nextInt();
		
		HashMap<Integer, TreeSet<Integer>> map = new HashMap<>();
		for (int i=1;i<=h;i++) {
			map.put(i, new TreeSet<>());
		}
		
		for (int i=0;i<n;i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			map.get(x).add(y);
		}
		
		int yMax = 1;
		for (int i=2;i<=h;i++) {
			//System.out.println((i-1)+" "+yMax);
			if (map.get(i).isEmpty()) {
				yMax++;
			} else if (map.get(i).first()<=yMax) {
				System.out.println(i-1);
				return;
			} else if (map.get(i).first()>yMax+1) {
				yMax++;
			}
		}
		System.out.println(h);
	}

}




Measured memory_bytes: 173632
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

using namespace std;

int my_abs_A(int num) {
    if (num > 0)
        return num;
    else
        return -num;
}

int my_abs_B(long long num,long long numb) {
    if (num - numb >= 0)
        return num - numb;
    else
        return -1 * (num - numb);
}

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

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

int main() {
    long long A, B, C;
    cin >> A >> B >> C;
    vector<long long> ans(A);
  	bool ok = true;
    if (C == 1000000000) {
        ok = false;
    }
    
    for (long long i = 0; i < B; i++) {
        ans.at(i) = C;
    }
    if (ok == true) {
        C = C + 1;
    }
    else {
        C = 1;
    }
    
    for (long long j = B; j < A; j++) {
        ans.at(j) = C;
    }
    for (long long k = 0; k < A; k++) {
        cout << ans.at(k) << " ";
    }
    cout << endl;
}


Measured memory_bytes: 2048
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int MOD = 1000000007;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		out.printf("%d %d%n", Math.min(a, b), Math.max(0, a+b-n));
	}
}


Measured memory_bytes: 21844
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
#include<deque>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
const int mod = 1000000007;
const int INF = 1001001001;
vector<int> cost;
vector<P> grid;
int h, w, d;
int dfs(int p) {
  if(cost[p] != INF) return cost[p];
  if(p + d > h * w) return cost[p] = 0;
  int x = grid[p].first, y = grid[p].second;
  int nextx = grid[p + d].first, nexty = grid[p + d].second;
  return cost[p] = abs(nextx - x) + abs(nexty - y) + dfs(p + d);
}

int main() {
  cin >> h >> w >> d;
  grid.resize(h * w + 2);
  rep(i, h)rep(j, w) {
    int a;
    cin >> a;
    grid[a] = P(i, j);
  }
  cost.resize(h * w + 2, INF);
  rep(i, h*w) dfs(i + 1);
  int q;
  cin >> q;
  rep(i, q) {
    int l, r;
    cin >> l >> r;
    int ans = cost[l] - cost[r];
    printf("%d\n", ans);
  }

}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		if(A %2 == 1 || B %2 == 1 || C %2 == 1){
			Console.WriteLine(0);
			return;
		}
		if(A == B && B == C){
			Console.WriteLine(-1);
			return;
		}
		int cnt = 0;
		while(true){
			if(A == B && B == C){
				Console.WriteLine(-1);
				return;
			}
			if(A %2 == 1 || B %2 == 1 || C %2 == 1){
				break;
			}
			ch(ref A, ref B, ref C);
			cnt++;
		}
		Console.WriteLine(cnt);
		
	}
	
	void ch(ref int a, ref int b, ref int c){
		var na = (b + c) / 2;
		var nb = (a + c) / 2;
		var nc = (a + b) / 2;
		a = na; b = nb; c = nc;
	}
	
	int A,B,C;
	public Sol(){
		var d = ria();
		A = d[0]; B = d[1]; C = d[2];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11092