akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define debug_print(var) cerr << #var << "=" << var <<endl;
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

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

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

struct UnionFind{
  ll N;
  llvec p;
  llvec cnt;
  UnionFind(ll n){
    N = n;
    p=llvec(N);
    cnt=llvec(N, 0);
    rep(i, N){
      p[i] = i;
      cnt[i] = 1;
    }
  }

  void con(ll a, ll b){
    P at = root(a);
    P bt = root(b);
    if(at.second!=bt.second){
      if(at.first>bt.first){
        swap(at, bt);
        swap(a, b);
      }
      p[at.second] = bt.second;
      cnt[bt.second]+=cnt[at.second];
      p[a]=bt.second;
    }
  }

  P root(ll a){
    ll atmp = a;
    ll c=0;
    while(atmp!=p[atmp]){
      atmp = p[atmp];
      c++;
    }
    p[a] = atmp;
    return {c, atmp};
  }

  bool is_con(ll a, ll b){
    P at=root(a);
    P bt=root(b);
    return at.second == bt.second;
  }
  
};

struct dijkstra{
  ll N;
  llvec d;
  vector<vector<edge>> e;
  dijkstra(ll n){
    N = n;
    //d = llvec(N, 1e18);
    e = vector<vector<edge>>(N);
  }

  void add_edge(ll from, ll to, ll cost){
    e[from].push_back({to, cost});
  }

  void run(ll start){
    priority_queue<P, vector<P>, greater<P>> que;
    que.push({0, start});
    d = llvec(N, 1e18);
    d[start]=0;
    while(!que.empty()){
      P q = que.top();que.pop();
      ll dc = q.first;
      ll x = q.second;
      if(dc>d[x]){
        continue;
      }else{
        for(auto ip: e[x]){
          if(d[ip.x]<=d[x]+ip.c){
            continue;
          }else{
            d[ip.x]= d[x]+ip.c;
            que.push({d[ip.x], ip.x});
          }
        }
      }
    }
  }  
};


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll N, D;
  cin >> N >> D;
  ll cnt=0;
  rep(i, N){
    ll a, b;
    cin >> a >> b;
    if(a*a + b*b <=D * D){
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; i < (long long)n; i++)
//#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Vl = vector<ll>;
using vi = vector<int>;
using Graph = vector<vi>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vi X(N);
  REP(i, N) cin >> X.at(i);
  ll min = 1e9;
  for (int j = 1; j <= 100; j++) {
    ll tmp = 0;
    for (int k = 0; k < N; k++) {
      tmp += (X.at(k) - j) * (X.at(k) - j);
    }
    if (tmp < min) min = tmp;
  }
  cout << min << endl;
}

Measured memory_bytes: 256
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let c: Vec<Vec<i32>> = (0..3).map(|_| (0..3).map(|_| read()).collect()).collect();

    let mut a = [0; 3];
    let mut b = [0; 3];
    for i in 0..3 {
        b[i] = c[0][i] - a[0];
    }
    for i in 1..3 {
        a[i] = c[i][0] - b[0];
    }
    for i in 0..3 {
        for j in 0..3 {
            if c[i][j] != a[i] + b[j] {
                println!("No");
                return;
            }
        }
    }
    println!("Yes");
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include "bits/stdc++.h"
using namespace std;

int GCD(int x, int y) {
	if (x < y) {
		x += y;
		y = x - y;
		x -= y;
	}
	while (x % y != 0) {
		int z = x % y;
		y = z;
		x = y;
	}
	return y;
}
int main() {
	int N, X, x, G;
	cin >> N >> X >> x;
	G = abs(X - x);
	for (int i = 1; i < N; i++) {
		cin >> x;
		G = GCD(G, abs(X - x));
	}
	cout << G;
}

Measured memory_bytes: 256
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end
N, K = gets_i_list

ab_list = []
N.times do
  ab_list.push gets_i_list
end

ab_list.sort!{|x,y| x[0] <=> y[0]}

total = 0
ab_list.each do |a, b|
  total += b
  if total >= K
    puts a
    exit
  end
end


Measured memory_bytes: 10768
#include <iostream>
#include <vector>
#include <cstdint>
#include <algorithm>

int calc(int a, int b){
  long long r,tmp;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a%b;
  while(r!=0){
    a=b;
    b=r;
    r=a%b;
  }
  return b;
}

int main(){
  long long n,init;
  std::cin >> n >> init;
  std::vector<long long> x;
  
  for(int i=0; i<n; i++){
    long long tmp;
    std::cin >> tmp;
    int abs = (tmp-init>0)?tmp-init:init-tmp;
    x.push_back(abs);
  }
  long long res = x[0];
  for(int i=1; i<n;i++)
    res = calc(res, x[i]);
    
  std::cout << res << std::endl;
  return 0;
}

Measured memory_bytes: 1400
#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;//cnt, coodinate
string grid[1111];
int neiber[1111][1111];
int dx[] = {0, 1, 1,  1,  0, -1, -1, -1};
int dy[] = {1, 1, 0, -1, -1, -1,  0,  1};
int w, h;
bool renge(int x, int y){
  return (0 <= x && x < w &&
          0 <= y && y < h);
}
bool del(int x, int y){
  if(!renge(x, y) ||
     grid[y][x] == '.') return false;
  int cnt = 0;
  for (int i = 0; i < 8; i++) {
    int nx = x + dx[i], ny = y + dy[i];
    if(!renge(nx, ny))continue;
    if(grid[ny][nx] == '.')cnt++;
  }
  char tmp = grid[y][x];
  neiber[y][x] = cnt;
  return cnt >= atoi(&tmp);
}
 
int main(int argc, char *argv[]){
  queue<piii> que;
  cin >> h >> w;
  for (int i = 0; i < h; i++) {
    cin >> grid[i];
  }
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if(del(j, i)){
        que.push(mp(1, mp(j, i)));
      }
    }
  }
  int ans = 0;
  while(!que.empty()){
    int cnt = que.front().first;
    int x = que.front().second.first;
    int y = que.front().second.second;
    que.pop();
    if(grid[y][x] == '.')continue;
    grid[y][x] = '.';
    ans = cnt;
    for (int i = 0; i < 8; i++) {
      int nx = x + dx[i], ny = y + dy[i];
      if(!renge(nx, ny))continue;
      char tmp = grid[ny][nx];
      neiber[ny][nx]++;
      if(neiber[ny][nx] >= atoi(&tmp)){
        que.push(mp(cnt + 1, mp(nx, ny)));
      }
    }
  }
  std::cout << ans << std::endl;
  return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//main code

int main(int argc, char const* argv[])
{
	int n,t;
	cin >> n >> t;
	int ans = INT32_MAX;
	for (int i = 0; i < n; i++) {
		int c,l;
		cin >> c >> l;
		if (l <= t) {
			ans = min(ans,c);
		}
	}
	if (ans == INT32_MAX) {
		cout << "TLE" << endl;
	}
	else {
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<string>
#include<deque>
#include<stack>
#include<map>
#include <random>
#include<queue>
#include<iterator>
#include <bitset>
#include <unordered_set>
#include<set>

using namespace std;
#define ll long long
#define endl "\n"
const int dx[] = { -1 , -1 , -1 , 0 , 0 , 0 , 1 , 1 , 1 };
const int dy[] = { -1 , 0 , 1 , -1 , 0 , 1 , -1 , 0 , 1 };
const ll integer = pow(2, 32) - 1; // 4294967295
#define N 8010000
#define TC int t;cin>>t;for(int T=1;T<=t;T++)
#define mod 1000000007
#define PI acos(-1)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
void AIA() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
//cout<<fixed<<setprecision(20);
// freopen("stand.in","r",stdin);
// freopen("stand.out","w",stdout);

/*
 _____________              __                ___        ___       ___________________________     ____        ____
|             |            /\ \              |   |      |   |     |                           |    \   \      /   /
|   __________|           / /\ \             |   |      |   |     |      _____      _____     |     \   \    /   /
|  |                     / /  \ \            |   |      |   |     |     |     |    |     |    |      \   \  /   /
|  |                    / /    \ \           |   |      |   |     |     |     |    |     |    |       \   \/   /
|  |______             / /      \ \          |   |______|   |     |     |     |    |     |    |        \      /
|         |           / /        \ \         |              |     |     |     |    |     |    |         \    /
|   ______|          / /          \ \        |    ______    |     |     |     |    |     |    |          |  |
|  |                / /============\ \       |   |      |   |     |     |     |    |     |    |          |  |
|  |               / /==============\ \      |   |      |   |     |     |     |    |     |    |          |  |
|  |              / /                \ \     |   |      |   |     |     |     |    |     |    |          |  |
|  |             / /                  \ \    |   |      |   |     |     |     |    |     |    |          |  |
|__|            /_/                    \_\   |___|      |___|     |_____|     |____|     |____|          |__|

										  <<<<<<<<<<< NEVER GIVE UP !! >>>>>>>>>>>
										<<<<<<<< YOU CAN DO IT IF YOU WANT !! >>>>>>>>
										 <<<<<<<<< BELIEVE IN YOURSELF !! >>>>>>>>>

*/
string tis(int n) {
	string num="";
	while (n > 0) {
		num = char((n % 10)+'0') + num;
		n /= 10;
	}
	return num;
}
ll tin(string s) {
	ll re = 0;
	for (int i = 0; i < s.size(); i++) {
		re *= 10;
		re += int(s[i] - '0');
	}
	return re;
}

int main()
{
	//cout << fixed << setprecision(6);
	//freopen("stand.in","r",stdin);
	//freopen("stand.out","w",stdout);
	AIA();
	ll a, b;
	cin >> a >> b;
	cout << a * b;
	
	return 0;
}

Measured memory_bytes: 3644
def main(argv)
  n = gets.chomp.to_i
  a = gets.chomp.split(' ').map(&:to_i)
  
  b = (1..n).to_a.map{|i| [i, a[i - 1]]}.sort{|lhs, rhs| lhs[1] <=> rhs[1]}.map{|x, y| x}
  puts b.map(&:to_s).join(' ')
end

if self.to_s == 'main' then
  main(ARGV)
end

Measured memory_bytes: 21436
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
s = list(input())
t = list(input())

for i in range(n):
    if s[i:] == t[:n-i]:
        print(n+i)
        exit()


print(2*n)

Measured memory_bytes: 3064
from scipy.sparse.csgraph import floyd_warshall

N, M, L, *I = map(int, open(0).read().split())
ABC, ST = I[:3 * M], I[3 * M + 1:]

E = [[0] * N for _ in range(N)]
for a, b, c in zip(*[iter(ABC)] * 3):
    E[a - 1][b - 1] = E[b - 1][a - 1] = c

E = floyd_warshall(E)
E = [[(eij <= L) for j, eij in enumerate(ei)] for i, ei in enumerate(E)]
E = floyd_warshall(E)

INF = float("inf")

A = []
for s, t in zip(*[iter(ST)] * 2):
    a = E[s - 1][t - 1] - 1
    A.append("-1" if a == INF else str(int(a)))

print("\n".join(A))


Measured memory_bytes: 40784
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, 0, n) cin >> a[i];

  int ans = 0;
  rep(i, 0, n) {
    while (a[i]%2==0) {
      a[i] /= 2;
      ans++;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3672
import java.util.*;

public class Main {
	private Stack<Integer> stackA, stackB, stackC;

	public static void main(String[] args) {
		new Main().run();
	}
	
	private void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		while (n-- > 0) {
			int[] ball = new int[10];
			for (int i = 0; i < 10; i++) {
				ball[i] = scan.nextInt();
			}
			
			stackA = new Stack<Integer>();
			stackB = new Stack<Integer>();
			stackC = new Stack<Integer>();
			stackB.push(0); stackC.push(0);
			
			for (int i = 9; i >= 0; i--) stackA.push(ball[i]);
			
			boolean flag = true;
			
			for (int i = 0; i < 10; i++) {
				int num = stackA.pop();
				int B = stackB.peek();
				int C = stackC.peek();
				if (num > B || num > C) {
					if (num < B) {
						stackC.push(num);
					}else if (num < C) {
						stackB.push(num);
					}else {
						if (B > C) {
							stackB.push(num);
						}else {
							stackC.push(num);
						}
					}
				}else {
					flag = false;
					break;
				}
			}
			System.out.println(flag?"YES":"NO");
		}
	}
	
	private void debug() {
		System.out.println();
	}
}

Measured memory_bytes: 18196
fun main (args : Array<String>) {
	val (n, k) = readLine()!!.split(" ")
	val N : Int = n.toInt()
	val K : Int = k.toInt()
	var calc1 : Int
	var count : Int = 0
	var list : MutableList<Int> = mutableListOf()
	var calc2 : Double = 0.0
	var calc3 : Double
	
	for (i in 1..N) {
		calc1 = i
		while (calc1 < K) {
			calc1 = calc1 * 2
			count++
		} 
		list.add(count)
		count = 0
	}
	
	calc3 = (1.0 / 2.0)
	
	for (i in 0..N - 1) {
 		//calc2 += ( (1.0 / N.toDouble()) * (calc3.pow(list[i])) )
		calc2 += ( (1.0 / N.toDouble()) * (Math.pow(calc3, list[i].toDouble())) )
	}
	println("${calc2}")
	
}

Measured memory_bytes: 38716
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <vector>
using namespace std;

struct P{
	double x,y,z;
};

double dist(P a,P b){
	double x = a.x - b.x;
	double y = a.y - b.y;
	double z = a.z - b.z;
	return x * x + y * y + z * z;
}
int main(){
	int N;
	P p[30];
	while( cin >> N && N){
		for(int i = 0 ; i < N ; i++)
			cin >> p[i].x >> p[i].y >> p[i].z;
		
		double e = 1.0;
		P pos;
		pos.x = 0;
		pos.y = 0;
		pos.z = 0;
		while( e > 1e-8 ){
			double dis = -1;
			int idx = 0;
			for(int i = 0 ; i < N ; i++){
				if( dis < dist(pos,p[i]) ){
					dis = dist(pos,p[i]);
					idx = i;
				}
			}
			double x = p[idx].x - pos.x;
			double y = p[idx].y - pos.y;
			double z = p[idx].z - pos.z;
			pos.x += x * e;
			pos.y += y * e;
			pos.z += z * e;
			e *= 0.9998;
		}
		double dis = -1;
		int idx = 0;
		for(int i = 0 ; i < N ; i++){
			if( dis < dist(pos,p[i]) ){
				dis = dist(pos,p[i]);
				idx = i;
			}
		}
		printf("%.8lf\n",sqrt(dis));
	}
}

Measured memory_bytes: 1248
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
  
#define repd(i,a,b) for (int i=(a);i<=(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}
  
int main()
{
  int a,b;

  cin >> a >> b;

  int ans = max(a+b, max(a-b, a*b));

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


Measured memory_bytes: 256
n = int(input())
s = list(input())

lb = [0]*len(s)
lw = [0]*len(s)

sb = 0
sw = 0
min = len(s)

for i in range(len(s)):
    if s[i] == '#':
        sb += 1
    if s[len(s)-(i+1)] == '.':
        sw += 1
    lw[len(s)-(i+1)] = sw
    lb[i] = sb

lb.insert(0,0)
lw.append(0)
#
# print(lb)
# print(lw)

for i in range(len(s)+1):
    if lb[i]+lw[i] < min:
        min = lb[i]+lw[i]

print(min)

Measured memory_bytes: 14180
#include <cstdio>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>

#include <numeric>

#include <map>

#include <deque>

#include <cassert>

#include <memory>

using namespace std;

typedef unsigned long long LL;

int main() {

    char s[222];
    scanf("%s", s+1);

    if (s[3]==s[4] && s[5]==s[6]) cout << "Yes";
    else cout << "No";


    

}

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

int main(){
  string S;
  cin >> S;
  for(int i=0;i<S.size()-1;i++){
    if(S.at(i)==S.at(i+1)){
      cout << "Bad" << endl;
      return 0;
    }
  }
  cout << "Good" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
const ll MAX = 1001001;
const ll MOD = 1000000007;
int main()
{
    ll n;
    cin >> n;
    vector<ll> d(n);
    vector<ll> co(13);
    rep(i, n)
    {
        cin >> d[i];
        co[d[i]]++;
    }
    if (co[0] > 0 || co[12] > 1)
    {
        cout << 0 << endl;
        return 0;
    }
    rep2(i, 1, 13)
    {
        if (co[i] >= 3)
        {
            cout << 0 << endl;
            return 0;
        }
    }
    ll ans = 0;
    for (int tmp = 0; tmp < (1 << 15); tmp++)
    {
        bitset<15> s(tmp);
        vector<bool> e(24);
        e[0] = true;
        rep2(i, 1, 13)
        {
            if (co[i] == 2)
            {
                e[i] = true;
                e[24 - i] = true;
            }
            else if (co[i] == 1)
            {
                if (s.test(i))
                {
                    e[i] = true;
                }
                else
                {
                    e[24 - i] = true;
                }
            }
        }
        ll now = 1001001;
        ll c = 0;
        rep2(i, 1, 24)
        {
            if (e[i])
            {
                now = min(now, i - c);
                c = i;
            }
        }
        now = min(now, 24 - c);
        ans = max(ans, now);
    }
    cout << ans << endl;
}

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

#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define pb push_back
#define FI first
#define SE second
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define test 1
#define TEST if(test)

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

const int MOD = 1000000007; // 998244353
const int INF = 2e9;
const ll INFLL = 1e18;
const int MAX_N = 1;

int N;
ll K;
vector<int> A;
ll ans = 0;

int main(){
	scanf("%d%lld", &N, &K);	
	for(int i=1; i<=N; i++){
		int x; scanf("%d", &x);
		A.pb(x);
	}
	for(int i=0; i<N; i++){
		for(int j=i+1; j<N; j++){
			if(A[i]==A[j])	continue;
			if(A[i]<A[j]){
				ans = (ans + K*(K-1)/2) % MOD;
			}else{
				ans = (ans + (K+1)*K/2) % MOD;
			}
		}
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
using System;
using static System.Console;

namespace A
{
  class Program
  {
    static void Main(string[] args)
    {
      int N = int.Parse(ReadLine());
      int H = int.Parse(ReadLine());
      int W = int.Parse(ReadLine());

      WriteLine((N-H+1)*(N-W+1));
    }
  }
}


Measured memory_bytes: 13140
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        Map<String,Integer> map = new TreeMap<>();
        for(int i = 0;i<n;i++){
            StringBuffer tmp = new StringBuffer();
            tmp.append(String.format("%-10s",sc.next()));
            tmp.append(String.format("%4s",String.valueOf(Integer.parseInt(sc.next()) - 100)));
            map.put(tmp.toString(),i + 1);
        }
        for(Integer num: map.values()){
            System.out.println(num);
        }
    }
}

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

bool hantei(ll x){
	for(ll i=2; i*i<=x; i++){
		if(x%i==0) return 0;
	}
	return x>1;
}

int main(){
	ll a,b; cin>>a>>b;
	ll c = __gcd(a,b);
	int cnt{1};
	if(hantei(c)){
		cout << 2 << endl;
		return 0;
	}
	
	for(int i=2; i<=c; i++){
		if(c%i==0){
			cnt++;
			while(1){
				if(c%i==0) c/=i;
				else break;
			}
			if(c==1) break;
			if(hantei(c)) {
				cnt++;
				break;
			}
		}
	}
	cout << cnt << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <ctime>
#define INF 999999999
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define MOD(x) (x%(mod))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
/*---------------------------------------------------*/

int main(){
  int n,cnt,sum;
  while(cin>>n){
    cnt=0;
    if(n==0)break;
    for(int i=1;i<n;i++){
      sum=0;
      for(int j=i;j<n;j++){
	sum+=j;
	if(sum==n){cnt++;break;}
	if(n<sum)break;
      }
    }
    cout<<cnt<<endl;
  }
}

Measured memory_bytes: 3092
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

long long int N, M, K, H, W, L, R;
//int N, M, K, H, W, L, R;



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

	cin >> N;
	cin >> M >> K;
	vector<long long int>v(N);
	for (auto &i : v)cin >> i;
	L = 0;
	R = MOD * MOD / K + 1;
	while (R - L > 1) {
		long long int mid = (R + L + 1) / 2;
		long long int cnt = 0;
		for (auto i : v) {
			long long int box = i - mid * K;
			if (box > 0) {
				box += (M - K - 1);
				cnt += box / (M - K);
			}
		}
		if (cnt <= mid)R = mid;
		else L = mid;
	}
	cout << R << endl;
}


Measured memory_bytes: 1024
import sys
def input():
    return sys.stdin.readline()[:-1]
sys.setrecursionlimit(200000)
class uf:
    def __init__(self,n):
        self.n=n
        self.l=[-1]*n
    def ro(self,n):
        if self.l[n]<0:
            return n
        r=self.ro(self.l[n])
        self.l[n]=r
        return r
    def me(self,a,b):
        ra=self.ro(a)
        rb=self.ro(b)
        if self.l[ra]>self.l[rb]:
            ra,rb=rb,ra
        if ra!=rb:
            self.l[ra]+=self.l[rb]
            self.l[rb]=ra
    def size(self,n):
        return -self.l[self.ro(n)]
    def sa(self,a,b):
        return self.ro(a)==self.ro(b)
N,M,K=map(int,input().split())
u=uf(N)
l=[-1]*N
for i in range(M):
    A,B=map(lambda x: int(x)-1,input().split())
    u.me(A,B)
    l[A]-=1
    l[B]-=1
for i in range(N):
    l[i]+=u.size(i)
for i in range(K):
    C,D=map(lambda x: int(x)-1,input().split())
    if u.sa(C,D):
        l[C]-=1
        l[D]-=1
print(*l)

Measured memory_bytes: 13340
import java.util.*;
import java.io.*;

public class Main{

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

	public static void solve(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int counter = 0;
		boolean judge = true;
		for(int a=0;a<n;a++){
			String s = sc.next();
			if(s.charAt(0)=='A'){
				counter++;
			}
			else{
				counter--;
			}
			if(counter<0){
				judge = false;
			}
		}
		if(counter==0 && judge){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
}

Measured memory_bytes: 26248
#include <stdio.h>

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

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N, K;
    cin >> N >> K;
    int i = 0;
    while (true) {
        if (pow(K, i) > N) {
            cout << i << endl;
            return 0;
        }
        i++;
    }
}


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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

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

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

template <typename A, typename T, size_t size>
void fill(A (&ary)[size], const T &val) {
    fill((T *)ary, (T *)(ary + size), val);
}

void solve() {
    const i64 mod = 1'000'000'007;

    i64 N,X;
    cin >> N >> X;
    vector<i64> S(N);
    rep(i,0,N){
        cin >> S[i];
    }

    sort(rbegin(S),rend(S));

    if(N==1){
        cout << X%S[0] << endl;
        return;
    }

    const i64 maxn=201,maxx=100010;
    static i64 dp[maxn][maxx];
    fill(dp,i64(0));

    dp[0][X]=1;
    rep(i,0,N){
        rep(j,0,X+1){
            dp[i+1][j%S[i]]+=dp[i][j];
            dp[i+1][j%S[i]]%=mod;
            if(i+1<N){
                dp[i+1][j]+=dp[i][j]*(N-i-1);
                dp[i+1][j]%=mod;
            }
        }
    }

    i64 ans=0;
    rep(i,0,X+1){
        ans+=dp[N][i]*i;
        ans%=mod;
    }

    cout << ans << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


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

int N;
vector<pair<int,int>> A;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

int main(){
    cin >> N;
    A = vector<pair<int,int>>(N);
    for(int i=0;i<N;i++){
        int in; cin >> in;
        A[i] = make_pair(in*-1,i);
    }
    sort(A.begin(),A.end());
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(A[j].second == i) continue;
            cout << A[j].first*-1 << endl;
            break;
        }
        
    }

}


Measured memory_bytes: 3200
#include <cstdio>
int main(void){
    int a[3];
    scanf("%d%d%d",&a[0],&a[1],&a[2]);
    for(int i=0;i<3;i++){
        int min=a[i];
        for(int j=i;j<3;j++){
            if(min>a[j]){
                min=a[j];
                a[j]=a[i];
                a[i]=min;
            }
        }
        
    }
    printf("%d %d %d\n",a[0],a[1],a[2]);
    return 0;
}


Measured memory_bytes: 2692
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

#define MAXN (1 << 20)

int score[3];
int n, k;
string s;
string c = "rsp";
string w = "201";
int a[MAXN];

int getscore(vector<int> v) {
	v.push_back(3);
	int i = 0;
	int ret = 0;
	while (i < v.size() - 1) {
		int cur = i;
		while (v[i + 1] == v[cur]) {
			i++;
		}
		i++;
		//cerr << ret << " " << i << " " << cur << " " << score[v[cur]] << endl;
		ret += ((i - cur + 1) / 2) * score[v[cur]];
	}
	return ret;
}

int main() {
	cin >> n >> k;
	for (int i = 0; i < 3; i++) {
		cin >> score[i];
	}
	cin >> s;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 3; j++) {
			if (c[j] == s[i]) {
				a[i] = w[j] - '0';			
			}
		}
	}
	for (int i = 0; i < n; i++) {
//		cerr << a[i];
	}
	//cerr << endl;
	int ret = 0;
	for (int i = 0; i < k; i++) {
		vector<int> cur;
		for (int j = i; j < n; j += k) {
			cur.push_back(a[j]);
		}
		//cerr << ret << endl;
		ret += getscore(cur);
	}
	cout << ret << endl;
	return 0;
}


Measured memory_bytes: 5032
#include <bits/stdc++.h>
using namespace std;
int main(){
    string a,b,c;
    char e,f,g;
    cin >>a>>b>>c;
    e = a.at(0) - 32;
    f = b.at(0) - 32;
    g = c.at(0) - 32;
    cout << e<< f << g<<endl;
}

Measured memory_bytes: 256
#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;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tree<T, L, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using gpp_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

//const int mod = 1000000007;
const int mod = 998244353;
//#define Add(x, y) x = (x + (y)) % mod
//#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int N, L; cin >> N >> L;
    vec T(N); cin >> T;

    double x = 0.0, y = 0.0;
    REP(i, N) FOR(j, i + 1, N){
        int n = j - i - 1;
        double theta = M_PI * (T[i] + T[j]) / L;
        x += cos(theta) * (N - 2 - n); y += sin(theta) * (N - 2 - n);
        x += cos(theta + M_PI) * n; y += sin(theta + M_PI) * n;
    }
    int t = N * (N - 1) / 2 * (N - 2);
    x /= t; y /= t;
    x *= 3; y *= 3;

    cout << x << " " << y << endl;

    return 0;
}


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

int main()
{
    int n;
    bool flag;
    int answer = 0;
    cin >> n;
    vector<int> h(n);
    for (int i = 0; i < n; i++)
    {
        cin >> h.at(i);
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < i; j++)
        {
            if (h.at(j) > h.at(i))
            {
                flag = 1;
                break;
            }
        }
        if (flag == 0)
        {
            answer++;
        }
        else
        {
            flag = 0;
        }
    }
    cout << answer << endl;
    return 0;
}

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

long long int sum15n(int n){
    long long int a;
    a = n / 15;
    return 15 * a * (a + 1) / 2;
}


long long int sum3n(int n){
    long long int b;
    b = n / 3;
    return 3 * b * (b + 1) / 2;
}

long long int sum5n(int n){
    long long int c;
    c = n / 5;
    return 5 * c * (c + 1) / 2;
}


int main(void){
    long long int n,ans,sum;
    cin >> n;
    sum = n * (n + 1) / 2;
    ans = sum - sum3n(n) - sum5n(n) + sum15n(n);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3588
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int num = sc.nextInt();
			if(num == 0) break;
			int sum = sc.nextInt();
			int max = sum;

			for(int i = 0; i < num - 1; i++){
				int tmp = sc.nextInt();
				if(tmp > tmp + sum)
					sum = tmp;
				else
					sum = tmp + sum;
				max = Math.max(max, sum);
			}
			System.out.println(max);
		}
	}
}

Measured memory_bytes: 26416
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	n, a, b, c := nextInt(), nextInt(), nextInt(), nextInt()
	var s []string
	for i := 0; i < n; i++ {
		s = append(s, next())
	}

	d := make(map[string]int)
	d["A"] = 0
	d["B"] = 1
	d["C"] = 2

	ans := search([]int{a, b, c}, s, d)
	if ans == nil {
		fmt.Fprintln(out, "No")
	} else {
		fmt.Fprintln(out, "Yes")
		for i := n - 1; i >= 0; i-- {
			fmt.Fprintln(out, ans[i])
		}
	}
}

func search(a []int, s []string, d map[string]int) []string {
	if len(s) == 0 {
		return s
	}
	for i := 0; i < 2; i++ {
		if a[d[s[0][1-i:1-i+1]]] > 0 {
			a[d[s[0][i:i+1]]] += 1
			a[d[s[0][1-i:1-i+1]]] -= 1
			r := search(a, s[1:], d)
			if r != nil {
				return append(r, s[0][i:i+1])
			}
			a[d[s[0][i:i+1]]] -= 1
			a[d[s[0][1-i:1-i+1]]] += 1
		}
	}
	return nil
}

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

// PrintOut with util device
func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "fuck")
	}
}


Measured memory_bytes: 39804
#include <bits/stdc++.h>
    using namespace std;
    #define LL long long
    #define Max(a,b) ((a)>(b)?(a):(b)) 
    #define Min(a,b) ((a)<(b)?(a):(b)) 
     
    //FILE *fp,*fp2;
    //fp=fopen("input.txt","r");
    //fp2=fopen("output.txt","w");
     
    int main()
    {
        int n;
        set<LL int> num;
        set<LL int>::iterator it;
        cin>>n;
        LL int x;
        while(n--)
        {
            cin>>x;
            it=num.find(x);
            if (it ==num.end())
            {
                num.insert(x);
            }
            else
            {
                num.erase(it);
            }
        }
        x=num.size();
        cout<<x<<endl;
        
        return 0;
    }
     

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

int main() {
    int n; cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a.at(i);

    int ans = 0;
    rep(i, n) {
        ans += (a.at(i) - 1);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

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

	a := []int64{1, 2, 3, 4, 5, 6, 7, 8, 9}

	for i := 0; i < k; i++ {
		m := a[i] % 10
		if m >= 1 {
			a = append(a, a[i] * 10 + m - 1)
		}
		a = append(a, a[i] * 10 + m)
		if m <= 8 {
			a = append(a, a[i] * 10 + m + 1)
		}
	}
	fmt.Println(a[k - 1])
}

Measured memory_bytes: 9600
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {
            var N = GetInt();
            var num = new string(GetCharArray()).Distinct().Count();
            var ans = num == 3 ? "Three" : "Four";

            Console.WriteLine(ans);
            Console.ReadKey();
        }

        static void Solve()
        {
        }


        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Split(' ').Select(char.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
    }
}

Measured memory_bytes: 13280
package main

import (
  "fmt"
)

func main() {
  var a, b, c int64
  
  fmt.Scanf("%d %d %d\n", &a, &b, &c)
  
  d := c - a - b
  if d < 0 {
    fmt.Println("No")
    return
  }
 
  if 4 * a * b < d * d {
    fmt.Println("Yes")
  }else{
    fmt.Println("No")
  }
}

Measured memory_bytes: 512
// Package main provides
//
// File:  main.go
// Author: ymiyamoto
//
// Created on Sat Jul 20 21:10:49 2019
//
package main

import "fmt"

func main() {
	var n, d int
	fmt.Scan(&n, &d)
	m := d*2 + 1
	fmt.Println((n + (m - 1)) / m)
}


Measured memory_bytes: 512
/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(__,v.size()){rep(_,v[__].size())cout<<" "<<v[__][_];cout<<endl;}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

signed main(){
	int n,m,MOD=1000000007;
	cin>>n>>m;
	string s;
	cin>>s;
	vi co(n+1);
	rep(i,n)co[i+1]=co[i]+(s[i]=='1');
	vi ma(n);
	rep(i,n)ma[i]=i+1;
	rep(i,m){
		int a,b;
		cin>>a>>b;
		a--;
		cmax(ma[a],b);
	}
	int w=0;
	vi dp(n+1);
	dp[0]=1;
	rep(i,n){
		if(w<ma[i]&&co[ma[i]]-co[w])
			for(int j=n;j>=0;j--)if(j+co[ma[i]]-co[w]<=n)
				dp[j+co[ma[i]]-co[w]]=dp[j],dp[j]=0;
		cmax(w,ma[i]);
		rep(j,n)(dp[j]+=dp[j+1])%=MOD;
		loop(j,w-i,n+1)dp[j]=0;
	}
	cout<<dp[0]<<endl;
}















Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
vector<long long>vec;
 
int main() {
    int X, Y, Z, K;
	cin >> X >> Y >> Z >> K;
    vector<long long> A(X),B(Y),C(Z);
	for (int i=0; i<X; ++i) cin >> A[i]; sort(A.begin(), A.end(), greater<long long>());
	for (int i=0; i<Y; ++i) cin >> B[i]; sort(B.begin(), B.end(), greater<long long>());
	for (int i=0; i<Z; ++i) cin >> C[i]; sort(C.begin(), C.end(), greater<long long>());

    priority_queue<pair<long long, vector<int> > > pq;
    set<vector<int> > history;

    const int N = 3;

    long long init = A[0]+B[0]+C[0];
    pq.push(make_pair(init, vector<int>(N, 0)));
    history.insert(vector<int>(N, 0));

	for (int i = 0; i < K; ++i) {
        long long sum;
        vector<int> index;

        tie(sum, index) = pq.top(); pq.pop();
        cout << sum << endl;

        if(index[0] < X - 1) {
            vector<int> index1 = index;
            ++index1[0];
            if(history.find(index1) == history.end()){
                long long sum1 = sum - A[index[0]] + A[index1[0]];
                pq.push(make_pair(sum1, index1));
                history.insert(index1);
            }
        }
        if(index[1] < Y - 1) {
            vector<int> index1 = index;
            ++index1[1];
            if(history.find(index1) == history.end()){
                long long sum1 = sum - B[index[1]] + B[index1[1]];
                pq.push(make_pair(sum1, index1));
                history.insert(index1);
            }
        }
        if(index[2] < Z - 1) {
            vector<int> index1 = index;
            ++index1[2];
            if(history.find(index1) == history.end()){
                long long sum1 = sum - C[index[2]] + C[index1[2]];
                pq.push(make_pair(sum1, index1));
                history.insert(index1);
            }
        }
    }

	return 0;
}


Measured memory_bytes: 1408
N = list(input())
num_1 = 0
num_2 = 0

for i in range(len(N)):
    if i == 0:
        num_1 += int(N[i]) - 1
    else:
        num_1 += 9

for n in N:
    num_2 += int(n)

print(max(num_1, num_2))

Measured memory_bytes: 3060