akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String str;
		
		while((str = reader.readLine()) != null){
			String[] code = str.split(",",0);
			int sum = 0;
			
			int[] station = new int[12];
			for(int i = 0; i < 10; i++){
				station[i] = Integer.parseInt(code[i]);
				sum += station[i];
			}
			int v1 = Integer.parseInt(code[10]);
			int v2 = Integer.parseInt(code[11]);
			double x = 0,s = 0;
			for(int i = 0; i < 10; i++){
				x += station[i];
				s = x / v1;
				if(x + s * v2 >= sum){
					System.out.println(i + 1);
					break;
				}
				}
			}
		reader.close();
	}
}

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

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

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

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define PRINT(x) cout << x << endl
#define all(x) x.begin(),x.end()


int main() {

    int A,B,C;
    cin >> A >> B >> C;

    cout << min(A+B,min(A+C,B+C)) << endl;

}



Measured memory_bytes: 764
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);

ll fast_exp(ll base, ll exp) {
  ll res=1;
  while(exp>0) {
    if(exp%2==1) res=(res*base)%mod;
      base=(base*base)%mod;
      exp/=2;
  }
  return res%mod;
}
ll modadd(ll x, ll y){return (x%mod + y%mod)%mod;}
ll modmul(ll x, ll y){return (x%mod * y%mod)%mod;}
ll modsub(ll x, ll y){return (x%mod - y%mod + mod)%mod;}
ll moddiv(ll x, ll y){return modmul(x, fast_exp(y, mod-2));}

vll fact(200100, 0); 
void ff() {
	fact[0] = 1;
	for(ll i = 1; i < 200100; i++){
		fact[i] = modmul(i, fact[i-1]);
	}
}

ll ncr(ll n, ll k)  
{  
    ll res = 1;  
    if ( k > n - k )  
        k = n - k;  
  
    for (ll i = 0; i < k; ++i)  
    {  
        res = modmul(res, n-i); 
        res = moddiv(res, i + 1);
    }  
    return res;  
}  

int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ff();
  ll n, a, b;
  cin >> n >> a >> b;
  ll init = fast_exp(2, n);
  init = modsub(init, 1ll);
  ll ans = modsub(init, ncr(n, a));
  ans = modsub(ans, ncr(n, b));
  cout << ans << endl;
  return 0;
} //good night.

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;

int main() {
	#ifdef kvutxdy
	freopen("C:/Users/khanh/OneDrive/RoadtoPurple/Code/Codeforces/input.in", "r", stdin);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int n,k;
	bool hate[10]={false};
	cin>>n>>k;
	for(int i=0;i<k;++i){
		int x;
		cin>>x;
		hate[x]=true;
	}
	for(int i=n;i<100000;++i){
		int x=i;
		bool ok=true;
		while(x){
			int digit=x%10;
			x/=10;
			if(hate[digit]) ok=false;
		}
		if(ok){
			cout<<i;
			return 0;
		}
	}
}

Measured memory_bytes: 256
use proconio::*;
use proconio::marker::Chars;
use std::cmp::min;

#[fastout]
fn run() {
    input! {
        t: usize,
    }
    for _ in 0..t {
        input! {
            n: usize,
            mut a: [usize; n],
            s: Chars,
        }
        let mut ans = 0;
        for (i, c) in s.into_iter().enumerate().rev() {
            let v = a[i];
            if c == '1' {
                if v != 0 {
                    ans = 1;
                }
            } else {
                for a in a.iter_mut() {
                    *a = min(*a, *a ^ v);
                }
            }
        }
        println!("{}", ans);
    }
}

fn main() {
    run();
}


Measured memory_bytes: 2564
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

pub fn get_divisors(n: u64) -> Vec<u64> {
    let mut m = 1;
    let mut divs = vec![];
    while m * m <= n {
        if n % m == 0 {
            divs.push(m);
            if n / m != m {
                divs.push(n / m);
            }
        }
        m += 1;
    }
    divs.sort();
    divs
}

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      a: u64,
      mut b: u64,
    }
    let divs = get_divisors(a);
    let mut ans = 0;
    for d in divs {
        if b%d==0 {
            ans += 1;
            if d==1 {
                continue;
            }
            while b%d == 0 {
                b /= d;
            }
        }
    }
    puts!("{}\n", ans);
}


Measured memory_bytes: 4352
import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;


public class Main {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int edgeCnt = Integer.parseInt(s.nextLine());
		ArrayList[] list = new ArrayList[edgeCnt];
		for(int i=0 ; i<edgeCnt ; i++) {
			list[i] = new ArrayList();
			String[] input = s.nextLine().split(" ");
			for(int j=0 ; j<Integer.parseInt(input[1]) ; j++) {
				list[Integer.parseInt(input[0])].add(new Main().new Edge(Integer.parseInt(input[0]), Integer.parseInt(input[j*2+2]),Integer.parseInt(input[j*2+3])));
			}
		}
		int[] result = daikusutora(list);
		for(int k=0 ; k<result.length ; k++) {
			System.out.println(k + " " + result[k]);
		}
	}

	@SuppressWarnings("unchecked")
	public static int[] daikusutora(ArrayList[] list) {
		int[] result = new int[list.length];
		Arrays.fill(result, Integer.MAX_VALUE);
		boolean[] visited = new boolean[list.length];
		Queue queue = new PriorityQueue();
		queue.offer(new Main().new Edge(0, 0, 0));
		result[0] = 0;
		while(true) {
			if(queue.isEmpty())
				break;

			Edge edge = (Edge) queue.poll();
			visited[edge.endNo] = true;
			if(result[edge.endNo] < edge.weight)
				continue;

				for(int i=0 ; i<list[edge.endNo].size() ; i++) {
					Edge e = (Edge)list[edge.endNo].get(i);


//					if(!visited[e.endNo]) {
						if((result[e.endNo] >= result[e.startNo] + e.weight)) {
							result[e.endNo] = result[e.startNo] + e.weight;
							queue.add(e);
						}
//					}
				}
		}
		return result;
	}

	class Edge implements Comparable<Edge> {

		int startNo;
		int endNo;
		int weight;

		public Edge(int startNo, int endNo, int weight) {
			this.startNo = startNo;
			this.endNo = endNo;
			this.weight = weight;
		}

		public int compareTo(Edge obj) {
			return this.weight - obj.weight;
		}
	}
}

Measured memory_bytes: 96740
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m,c,s,g;
  while(cin >> n >> m >> c >> s >> g && n) {
    s--,g--;
    int d2[c][n][n];
    for(int i=0; i<c; i++) 
      for(int j=0; j<n; j++) 
        for(int k=0; k<n; k++) d2[i][j][k]=(j==k?0:(1<<28));
    for(int i=0; i<m; i++) {
      int x,y,z,t;
      cin >> x >> y >> z >> t;
      x--,y--,t--;
      d2[t][x][y]=min(d2[t][x][y],z);
      d2[t][y][x]=min(d2[t][y][x],z);
    }
    int b[c];
    for(int i=0; i<c; i++) cin >> b[i];
    vector<int> a[c];
    vector<int> aa[c];
    for(int i=0,x; i<c; i++) {
      int bb[b[i]-1];
      for(int j=0; j<b[i]-1; j++) {
        cin >> x;
        bb[j]=x;
      }
      int z=0;
      a[i].push_back(0);
      for(int j=0; j<b[i]; j++) {
        cin >> x;
        aa[i].push_back(x);
        if(j==b[i]-1) break;
        while(z!=bb[j]) {
          z++;
          int dd=a[i][a[i].size()-1];
          a[i].push_back(dd+x);
        }
      }
    }
    int d[n][n];
    for(int i=0; i<n; i++) 
      for(int j=0; j<n; j++) d[i][j]=(1<<28);
    for(int i=0; i<n; i++) d[i][i]=0;
    for(int l=0; l<c; l++) {
      for(int k=0; k<n; k++) {
        for(int i=0; i<n; i++) {
          for(int j=0; j<n; j++) d2[l][i][j]=min(d2[l][i][j],d2[l][i][k]+d2[l][k][j]);
        }
      }
      for(int i=0; i<n; i++) {
        for(int j=0; j<n; j++) {
          int dd=d2[l][i][j],ddd;
          if(dd==(1<<28)) continue;
          if(dd<a[l].size()) ddd=a[l][dd];
          else ddd=a[l][(int)a[l].size()-1]+(dd-a[l].size()+1)*aa[l][(int)aa[l].size()-1];
          d[i][j]=min(d[i][j],ddd);
        }
      }
    }
    for(int k=0; k<n; k++) {
      for(int i=0; i<n; i++) {
        for(int j=0; j<n; j++) d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      }
    }
  if(d[s][g]==(1<<28)) cout << -1 << endl;
  else cout << d[s][g] << endl;
  }
  return 0;
}


Measured memory_bytes: 2900
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define VIEW(x) do {cerr << #x << ": "; for(auto i : x) cerr << i << " "; cerr << endl;} while(0)
#define ALL(x) (x).begin(),(x).end()
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}

template<typename A,size_t N,typename T> void FILL(A (&array)[N],const T &val){fill((T*)array,(T*)(array+N),val);}
template<typename T> void FILL(vector<T> &v, const T &x) {fill(v.begin(), v.end(), x);}
template<typename T> void FILL(vector<vector<T>> &v, const T &x) {for(auto &i:v)fill(i.begin(), i.end(), x);}

int main() {
  string n; cin >> n;
  ll sum = 0;
  for(auto c : n) {
    int d = c - '0';
    sum += d;
  }
  if(sum%9) puts("No");
  else puts("Yes");
}


Measured memory_bytes: 3744
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys

N = int(sys.stdin.readline())

A = tuple(map(int,sys.stdin.readline().split())) # single line with multi param

cur = 1000
for i in range(N-1):
    if A[i] < A[i+1]:
        cur = (A[i+1]-A[i])*(cur//A[i])+cur
    #print(i,cur)
print(cur)


Measured memory_bytes: 9168
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
typedef long long lint;
const int N=505;
int row,col,q,val[N*N];

namespace utils{
	template <class T> inline void apn(T &x,const T y){x>y?x=y:0;}
	template <class T> inline void apx(T &x,const T y){x<y?x=y:0;}
	inline int nxi(){
		int x=0;
		char c;
		while(((c=getchar())>'9'||c<'0')&&c!='-');
		const bool f=(c=='-')&&(c=getchar());
		while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
		return f?-x:x;
	}
}
using namespace utils;

int main(){
	row=nxi(),col=nxi(),q=nxi();
	for(int i=1; i<=q; ++i){
		val[i]=nxi();
	}
	for(int i=1,j=1; i<=row; ++i){
		static int buk[N];
		int pt=i&1?1:col,ed=i&1?1:-1;
		for(; pt&&pt<=col; pt+=ed){
			buk[pt]=j;
			if(!--val[j]) ++j;
		}
		for(int i=1; i<=col; ++i){
			printf("%d ",buk[i]);
		}
		puts("");
	}
	return 0;
}


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

int table[501][501];

int main(void) {
  int H, W; cin >> H >> W;
  for (int h = 1; h <= H; h++) {
    for (int w = 1; w <= W; w++) {
      int a; cin >> a;
      table[h][w] = a;
    }
  }

  int state = 1;
  int x, y;
  vector<pair<pair<int, int>, pair<int, int> > > a;
  for (int h = 1; h <= H; h++) {
    for (int w = 1; w <= W; w++) {
      int hh = h, ww = h%2 ? w : W+1 - w;
      if (state == 1 && table[h][ww]%2 == 1) {
        state = 2;
      } else if (state == 2 && table[h][ww]%2 == 0) {
        if ((h%2 && ww == 1) || (!(h%2) && ww == W)) hh -= 1;
        else ww += 1-(h%2)*2;
        a.push_back(make_pair(make_pair(hh, ww), make_pair(h, h%2 ? w : W+1 - w)));
      } else if (state == 2 && table[h][ww]%2 == 1) {
        if ((h%2 && ww == 1) || (!(h%2) && ww == W)) hh -= 1;
        else ww += 1-(h%2)*2;
        a.push_back(make_pair(make_pair(hh, ww), make_pair(h, h%2 ? w : W+1 - w)));
        state = 1;
      }
    }
  }

  cout << a.size() << endl;
  for (int i = 0; i < a.size(); i++) cout << a.at(i).first.first << ' ' << a.at(i).first.second << ' ' << a.at(i).second.first << ' ' << a.at(i).second.second << endl;

  return 0;
}


Measured memory_bytes: 5232
# https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け


x, y = map(int, input().split())
if x * y < 0:  # 異符号ならば答えは一つ
    print(abs(abs(x) - abs(y)) + 1)
elif 0 <= x < y:
    print(y - x)
elif 0 < y < x:
    print(2 + x - y)
elif y == 0 and y < x:
    print(1 + x)
elif x < y <= 0:
    print(y - x)
elif y < x < 0:
    print(2 + x - y)
elif x == 0 and y < x:
    print(1 - y)


Measured memory_bytes: 61960
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n;
	cin>>n;
	ll a[100001];
	for(int i=0; i<n; i++) cin>>a[i];
	ll s=0;
	for(int i=0; i<n; i++){
		ll b; cin>>b; a[i]-=b;
		s+=a[i];
	}
	if(s<0){
		cout<<-1<<endl;
		return 0;
	}
	sort(a, a+n);
	ll s1=0;
	int i1;
	for(int i=0; i<n; i++){
		if(a[i]>=0){
			i1=i;
			break;
		}
		s1+=a[i];
	}
	s1=-s1;
	int ans=i1;
	for(int i=n-1; i>=i1; i--){
      if(s1<=0) break;
		s1-=a[i];
		ans++;
	}
	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 1024
#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
#pragma GCC optimize("Ofast")

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
#define int long long int
typedef complex<long double> cd;
const long double pi=acos(-1);
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<vector<int> > matrix;

#define m1 make_pair
#define pb push_back
#define flush fflush(stdout)
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define reset(x,v) memset(x,v,sizeof(x))

#define fi first
#define se second
#define endl "\n"
#define debug(x) (cerr << #x << ": " << x << "\n")
#define setbits(x) __builtin_popcount(x)
#define setbitsll(x) __builtin_popcountll(x)
#define all(x) x.begin(),x.end()
#define pii pair<int,int>

inline ll gcd(ll a,ll b){if(a==0) return b;return gcd(b%a,a);}
inline ll power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p%m*p%m)%m;if(n%2) return (p%m*a%m)%m;else return p;}
const double EPS = 1e-9;
const ll MOD =998244353;
const ll hell=1000000000;
const int INF = 1e17;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
template<typename T>
using ordered_set=tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
std::mt19937 rng(seed);

double startTime;
double getCurrentTime() {
    return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}
const int dx[] = { -1, 0, 1, 0 };
const int dy[] = { 0, 1, 0, -1 };

const int N=200005;

void solve()
{
    ldb r;
    cin>>r;
    ldb c=(ldb)22/7;
    c=2.0*c*r;
    cout<<setprecision(10);
    cout<<c<<endl;
}


int32_t main()
{
    IOS;
    int t;
    t=1;
    // cin>>t;
    while(t--)
    {
        
        solve();
    }
    return 0;
}


Measured memory_bytes: 3812
#include <stdio.h>

int main (void)
{

int i, x, y;
for(i = 1; i <= 3000; i++)
{
	
	scanf("%d %d", &x, &y);
		if( x==0 && y == 0 ){
			break;
		}
		if( x > y)
		{
			printf("%d %d\n", y, x);
		}
		else
		{
			printf("%d %d\n", x, y);
		}
}

return 0;
}

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

string s;
int k, m = 0, t, u;

int main()
{
	cin >> s >> k;

	t = s.size();
	u = s[0] - '0';

	if (t > k) {
		if (k == 1)
			m = 9 * (t - 1);
		else if (k == 2)
			m = 81 * (t - 1) * (t - 2) / 2;
		else
			m = 243 * (t - 1) * (t - 2) * (t - 3) / 2;
	}

	if (t >= k) {
		if (k == 1)
			m += u;
		else if (k == 2) {
			m += (u - 1) * 9 * (t - 1);

			int i = 1;
			while (i < t && s[i] == '0')
				i++;

			if (i < t) {
				int v = s[i] - '0';

				m += 9 * (t - i - 1) + v;
			}
		}
		else {
			m += (u - 1) * 81 * (t - 1) * (t - 2) / 2;

			int i = 1;
			while (i < t && s[i] == '0')
				i++;

			if (i < t - 1) {
				int v = s[i] - '0';

				m += 81 * (t - i - 1) * (t - i - 2) / 2 + (v - 1) * 9 * (t - i - 1);

				int j = i + 1;
				while (j < t && s[j] == '0')
					j++;

				if (j < t) {
					int w = s[j] - '0';

					m += 9 * (t - j - 1) + w;
				}
			}
		}
	}

	cout << m << endl;

	return 0;
}

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

#define int             long long
#define	ll				long long

#define	mod 			1000000007
#define	inf 			1000000000000000
#define infty			1000000000000000000LL
#define	md				998244353
#define	PI				acos(-1.0)
#define	endl 			"\n"
#define	rr				return
#define	br				cout<<"\n";
long long prime[1000000];

void sieve()
{
	prime[0]=0;
	prime[1]=0;
	for(int i=2;i<1000000;i++)
		prime[i]=1;

	for(int i=2;i*i<1000000;i++)
		if(prime[i]==1)
			for(int j=i*i;j<1000000;j+=i)
				prime[j]=0;
}

bool isPrime(int n)
{
    if (n <= 1)
        return false;
    for (ll i = 2; i <= floor(sqrt(n)); i++)
        if (n % i == 0)
            return false;

    return true;
}

int factorial(int n)
{
    int f=1;
    for(int i = 1;i<=n ; i++)
        f = (f*i)%mod;
    return f;
}

int gcd(int a, int b)
{
	return !b ? a : gcd(b, a % b);
}

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

int fastExponentiation(int n, int x, int modulo)
{
	int res = 1;
	while(x > 0)
       {
          if(x & 1)
          res = (res*n) % modulo;
          x = x >> 1;
          n = (n * n) % modulo;
       }
       return res;
}

int power(int n , int p )
{
	if(p==0)
	   return 1;

	 int res = power((n*n)%mod,p/2);
	 if(p%2==1)
	   res = (n*res)%mod;

	   	 return res;
}

bool isPowerOfTwo(int n)
{
   	return n && (!(n&(n-1)));
}

bool isSet(int n,int i)
{
	// To check if ith bit is set or not in binary representation of n
   	return n & (1 << i);
}

bool valid_coordinate(ll x,ll y,ll n,ll m)
{
    if(x<0 || y<0)
       return false;

   	else if(x>=n || y>=m)
       return false;

   	else
   		return true;
}

int sod(int n)
{
	int sum=0;
	while(n)
	{
		sum+=(n%10);
		n/=10;
	}
	return sum;
}



void solve()
{
	int l,r,n,count=0;
	cin>>l>>r>>n;
	for(int i=min(l,r);i<=max(l,r);i++){
		if(i%n==0)
		count++;
	}
	cout<<count<<endl;
}

int32_t main()
{

	//int t; cin>>t; while(t--)
	solve();

	return 0;
}


Measured memory_bytes: 3556
import numpy as np
N, K = map(int, input().split())

P=0
for i in range(1,N+1):
    if i < K:
        p = float((1/N)*(1/2)**np.ceil(np.log2(K/i)))
    elif  i >= K:
        p = float(1/N)
    P += p
print(P)      

Measured memory_bytes: 14444
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    ans = []
    A_ = A[:]
    A_.sort(reverse=True)
    for a in A:
        if a == A_[0]:
            ans.append(A_[1])
        else:
            ans.append(A_[0])
    return '\n'.join(map(str, ans))


def main():
    N = read_int()
    A = [read_int() for _ in range(N)]
    print(slv(N, A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 31300
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
using namespace std;

int main() {
	int K;

	cin >> K;

	string ans;
	for (int i = 0; i < K; i++) {
		ans += "ACL";
	}
	cout << ans << endl;
}

Measured memory_bytes: 3036
use std::io::*;
use std::str::FromStr;

//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let x = read();
    let n:usize = read();
    let mut p:Vec<i32> = (0..n).map(|_| read()).collect();

    p.sort();

    let x_pos = p.iter().position(|&v| v==x );

    if x_pos == None {
        println!("{}",x);
    }else{
        //小さい方を探索
        let min;
        if x_pos.unwrap() == 0 {
            min = x - 1;
        }else{
            let mut i = x_pos.unwrap() - 1;
            let mut c = 1;
            loop{
                //println!("i{}",i);
                if p[i] == x - c {
                    //println!("c{}",c);
                    if i == 0{
                        //println!("min_i{}",i);
                        min = x-c-1;
                        break;
                    }
                    i -= 1;
                    c += 1;
                }else{
                    //println!("else i{}",i);
                    min = x-c;
                    break;
                }
            }
        }
        //大きい方を探索
        let max;
        if x_pos.unwrap() == n-1 {
            max = x + 1;
        }else{
            let mut i = x_pos.unwrap() + 1;
            let mut c = 1;
            loop{
                //println!("i{}",i);
                if p[i] == x + c {
                    //println!("c{}",c);
                    i += 1;
                    c += 1;
                }else{
                    //println!("else i{}",i);
                    max = x+c;
                    break;
                }
                if i == n{
                    //println!("max_i{}",i);
                    max = x+c;
                    break;
                }
            }
        }
        let l = (x-min).abs();
        let r = (x-max).abs();
        if l <= r{
            println!("{}",min);
        }else{
            println!("{}",max);
        }
        //println!("min{:?} max{:?}",min,max);
    }

}


Measured memory_bytes: 2112
#include<bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i <  (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;

void answer() {
  ll N;
  vector<ll> A, B;
  cin >> N;
  A.resize(N);
  B.resize(N);
  rep(i, N) cin >> A[i] >> B[i];
  sort(ALL(A));
  sort(ALL(B));
  if(N%2) {
    ll l = A[N/2];
    ll r = B[N/2];
    cout << (r-l)+1 << "\n";
  } else {
    ll l = A[(N-1)/2] + A[N/2];
    ll r = B[(N-1)/2] + B[N/2];
    cout << (r-l)+1 << "\n";
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 6304
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
    string s;
    cin >> s;
    vector<int> ans(s.length()+1, 0);
    for(int i = 0; i < s.length(); i++){
        if(s[i] == '<') ans[i+1] = ans[i]+1;
    }
    for(int i = s.length()-1; i >= 0; i--){
        if(s[i] == '>') ans[i] = max(ans[i], ans[i+1]+1);
    }
    long long int fans = 0;
    for(int i = 0; i < ans.size(); i++) fans += ans[i];
    cout << fans << endl;
    return 0;
}

Measured memory_bytes: 5864
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let mut s: Vec<char> = input::<String>().chars().collect();
    let t: Vec<char> = input::<String>().chars().collect();

    let mut restorable = false;
    for i in (0..s.len() - t.len() + 1).rev() {
        let mut ok = true;
        for j in 0..t.len() {
            if s[i + j] != t[j] && s[i + j] != '?' {
                ok = false;
                break;
            }
        }
        if ok {
            for j in 0..t.len() {
                s[i + j] = t[j];
            }
            restorable = true;
            break;
        }
    }

    let ans = if restorable {
        for i in 0..s.len() {
            if s[i] == '?' {
                s[i] = 'a';
            }
        }
        s.iter().cloned().collect()
    } else {
        "UNRESTORABLE".to_string()
    };
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;
int main()
{
    // 文字列の入力
    int N, K;
	cin >> N >> K;
	
	int pn[1000];
	
	for(int i = 0; i < N; i++) {
		cin >> pn[i];
	}
	
	// シンプルにバブルソート
	
	for(int i = 0; i < N; i++) {
		for(int j = i; j < N; j++) {
			if(pn[i] > pn[j] ) {
				int temp = pn[i];
				pn[i] = pn[j];
				pn[j] = temp;
			}
		}
	}
	
	// k個加算
	int sum = 0;
	for(int i = 0; i < K; i++) {
		sum += pn[i];
	}
	
	printf("%d\n", sum);
	
    return 0;
}

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

int gcd(int a, int b)
{
    int temp = 0;
    if (a < b)
    {
        temp = a;
        a = b;
        b = temp;
    }

    while (b != 0)
    {
        temp = b;
        b = a % b;
        a = temp;
    }

    return a;
}


int main(void)
{
    int n = 0;
    cin >> n;

    set<int> st[2] = {{0}, {0}};

    int tmp = 0, pInx = -1, sInx = -1;
    set<int> tmpSet;
    for(int i = 0; i < n; i++) {
        pInx = i % 2;
        sInx = (i + 1) % 2;
        st[sInx].clear();
        if(*st[pInx].begin() != 0 || *st[pInx].rbegin() == 0) {
            st[sInx].insert(*st[pInx].begin());
        } else {
            st[sInx].insert(*++st[pInx].begin());
        }
        
        cin >> tmp;
        for(int n : st[pInx]) {
            st[sInx].insert(gcd(n, tmp));
        }
    }

    cout << *(st[sInx].rbegin()) << endl;

    return 0;
}


Measured memory_bytes: 256
import bisect

alphabetlist=['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']

A=input()
N=len(A)

dic={moji:[] for moji in alphabetlist}
dp=[0 for i in range(N)]
check=set([A[-1]])
dic[A[-1]].append(N-1)
for i in range(N-2,-1,-1):
    check.add(A[i])
    dic[A[i]].append(i)
    if len(check)==26:
        dp[i]=dp[i+1]+1
        check=set([])
    else:
        dp[i]=dp[i+1]

for moji in alphabetlist:
    dic[moji].sort()

L=dp[0]+1
ans=[]
pos=-1
flag=0

for i in range(L-1):
    if flag==1:
        break
    for moji in alphabetlist:
        if dic[moji]:
            index=bisect.bisect_left(dic[moji],pos)
            npos=dic[moji][index]
            if npos+1<N and dp[npos+1]<L-(i+1):
                pos=npos+1
                ans.append(moji)
                break
            elif npos==N-1:
                pos=N
                ans.append(moji)
                flag=1
                break

if pos==N:
    ans.append("a")
    print("".join(ans))
else:
    s=set([])
    for i in range(pos,N):
        s.add(A[i])
    for moji in alphabetlist:
        if moji not in s:
            ans.append(moji)
            break
    print("".join(ans))

Measured memory_bytes: 53624
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
typedef int64_t llong;
char moji[26]={'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'};
char moji2[26]={'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'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define ld PRId64



int main(){
    int a,b;
    cin >> a >> b;
    int A[13]={};
    A[2]=28;
    A[4]=30;
    A[6]=30;
    A[9]=30;
    A[11]=30;
    if(A[a]==A[b]) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import numpy as np

N = int(input())

"""
4xyz = n(xy+yz+zx)
(4xy-ny-nx)z = nxy
"""

UP = 3501

for x in range(1, UP):
    y = np.arange(1, UP, dtype=np.int64)
    den = N * x * y
    num = 4*x*y - N*y - N*x
    y = y[(den % num == 0) & (num > 0)]
    if len(y) > 0:
        y = y[0]
        z = (N * x * y) // (4*x*y - N*y - N*x)
        break
print(x, y, z)

Measured memory_bytes: 12584
#pragma once
#include <stdio.h>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define bit(x,v) ((ll)x << v)

const ll INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}

// res[i][c] := i 文字目以降で最初に文字 c が登場する index (存在しないときは n)
vector<vector<int> > calcNext(const string& S) {
	int n = (int)S.size();
	vector<vector<int> > res(n + 1, vector<int>(26, n));
	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < 26; ++j) res[i][j] = res[i + 1][j];
		res[i][S[i] - 'a'] = i;
	}
	return res;
}
// mod 1000000007 の世界で a += b する関数
int n;
int bit[100010];
void add(int v, int x) {

	while (v <= n)
	{
		bit[v] += x;
		v += v & -v;
	}
}

ll sum(int v) {
	ll r = 0;
	while (v > 0)
	{
		r += bit[v];
		v -= v & -v;
	}
	return r;
}
void put(string v) {
	cout << "a" << v<< "b" << endl;
}
void solv() {
	int w, h, x, y, r;
	cin >> w >> h >> x >> y >> r;
	if (x - r < 0 || y - r < 0 || x + r > w || y + r > h) {
		cout << "No" << endl;
	}
	else cout << "Yes" << endl;

}


int main() {
	//	COMinit();
	solv();

	return 0;
}



Measured memory_bytes: 3108
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((int)(x).size())
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007      //10^9+7
#define root sqrt
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vs = vector<string>;
using ll = long long;
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : ' ');
  }
  // os << '}';
  return os;
}

int main()
{
  ll k, s, ans = 0;
  cin >> k >> s;
  rep(i, k)
  {
    rep(j, k)
    {
      ll z = s - (i + j);
      if (0 <= z && z <= k)
        ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 384
#include<iostream>
using namespace std; 
#define N 9
#define rep(i, n) for ( int i = 0; i < n; i++)
#define NE 0
#define NW 1
#define SW 2
#define SE 3
#define VERTICAL 0
#define HORIZON 1
static const int dx[4] = {1, -1, -1, 1};
static const int dy[4] = {1, 1, -1, -1};
bool M[N][N][N][N];
int n;

void move( int &x, int &y, int &dir, int vh ){
    if ( vh == VERTICAL ){
	if ( dir == 0 ) dir = 1;
	else if ( dir == 1 ) dir = 0;
	else if ( dir == 2 ) dir = 3;
	else if ( dir == 3 ) dir = 2;
    } else {
	if ( dir == 0 ) dir = 3;
	else if ( dir == 1 ) dir = 2;
	else if ( dir == 2 ) dir = 1;
	else if ( dir == 3 ) dir = 0;
    }
    x += dx[dir];
    y += dy[dir];
}

void simulate(){
    int x = 2, y = 1, dir = NE;
    while(1){
	if ( x % 2 == 0 && M[x/2][(y-1)/2][x/2][(y+1)/2]){ // vertical mirror
	    move(x, y, dir, VERTICAL);
	} else if ( y % 2 == 0 && M[(x-1)/2][y/2][(x+1)/2][y/2]){
	    move(x, y, dir, HORIZON);
	} else {
	    if ( x == 0 || y == 0 || x == 16 || y == 16 ){
		cout << x*50 << " " << y*50 << endl;
		return;
	    }
	    x += dx[dir];
	    y += dy[dir];
	}
	
	if ( x == 2 && y == 1 && dir == NE ){
	    cout << 75 << " " << 25 << endl; return;
	}
	
    }
}

main(){
    char ch;
    int x, y;
    while(1){
	cin >> n;
	if ( n < 0 ) break;
	rep(i, N) rep(j, N) rep(k, N) rep(l, N) M[i][j][k][l] = false;
	rep(i, n){
	    cin >> ch >> x >> y;
	    if ( ch == 'x' ) M[x][y][x+1][y] = M[x+1][y][x][y] = true;
	    else M[x][y][x][y+1] = M[x][y+1][x][y] = true;
	}
	simulate();
    }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string ans="Yes";
  int n,a,e=0,f=0,o=0;cin>>n;
  for(int i=0;i<n;i++){
    cin>>a;
    if(a%2){o++;}
    else if(a%4==0){f++;}
    else{e++;}
  }
  if(f<o-1){ans="No";}
  else if(f==o-1&&e!=0){ans="No";}
  cout<<ans;
}

Measured memory_bytes: 256
from bisect import bisect
T = list()
def make_list(i):
    number = ''
    n_4 = i
    while n_4 > 0:
        number = str(n_4 % 4) + number
        n_4 = n_4//4
    return number 
for n in range (0,3*10**5):
    number = make_list(n)
    if (('0' in number) or ('1' not in number) or ('2' not in number) or ('3' not in number)):
        continue
    number = number.replace('3','7')
    number = number.replace('2','5')
    number = number.replace('1','3')
    T.append(int(number))
N = int(input())
X = bisect(T,N)
print(X)

Measured memory_bytes: 4328
#include<iostream>
#include<string>
using namespace std;
int main(void){
  int n;
  string s;
  cin>>n;
  cin>>s;
  int max(0);
  int cnt(0);
  for(int i(0);i<n;i++){
    if(s[i]=='I'){
      cnt++;
      if(cnt>max)max=cnt;
    }else{
      cnt--;
    }
  }
  cout<<max<<endl;
  return 0;
}

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

using namespace std;

long long N;

void func(long long cur, int use, long long &counter){
    if(cur > N) return;
    if(use == 0b111) counter++;

    func(cur*10+7,use | 0b001, counter);
    func(cur*10+5,use|0b010,counter);
    func(cur*10+3,use|0b100,counter);
}

int main(){
    cin>>N;
    long long res = 0;
    func(0,0,res);
    
    cout << res << endl;
    return 0;
}

    

Measured memory_bytes: 256
s = list(input())
n = len(s)
srev = list(reversed(s))
a = s[:(n-1)//2]
arev = list(reversed(a))
b = s[(n+3)//2-1:]
brev = list(reversed(b))
if s == srev and a == arev and b == brev:
  print("Yes")
else:
  print("No")


Measured memory_bytes: 3060
N,M=map(int, input().split())
H=list(map(int, input().split()))

g = []
for i in range(M):
    a, b = map(int, input().split())
    if H[a-1] == H[b-1]:
        g += [a, b]
    if H[a-1] > H[b-1]:
        g += [b]
    else:
        g += [a]

g = set(g)
r = N - len(g)
print(r)


Measured memory_bytes: 20116
#include<iostream>
#include<cstdio>
#include<queue>
#include<vector>
#include<string.h>
#include<algorithm>

using namespace std;

int N,K;

int main()
{
  cin >> N;
  vector<pair<int,int>> A(N+1);
  int i,j,k,a;
  for(i=1;i<N+1;i++)
  {
    cin >> a  ;
    j=i;
    A[i]=make_pair(a,j);
  }
    sort(A.begin(),A.end());
  
    for(i=1;i<N+1;i++)
  {
      a=A[i].second;

    cout << a << " ";
  }
  
  
  
}

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

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define ms(a, x) memset(a, x, sizeof(a))
#define F first
#define S second
#define all(x) (x).begin(),(x).end()

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
mt19937 gen(random_device{}());

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string st;
    cin>>st;
    if(st.find('7')!=st.npos) cout<<"Yes";
    else cout<<"No";
    return 0;
}



Measured memory_bytes: 3640
//#include<bits/stdc++.h>
#include<iostream>
#include<set>
#include<vector>
#include<cmath>
#include<list>
#include<map>
#include<algorithm>
#include<unordered_map>
#include<unordered_set>
#include<iomanip> 
#include<cstdlib> 

#define ll long long

using namespace std;

int main() {
	int n;
	cin >> n;
	int d = n % 10;
	if (d == 2 || d == 4 || d == 5 || d == 7 || d == 9)  cout << "hon" << endl;
	else if (d == 0 || d == 1 || d == 6 || d == 8) cout << "pon" << endl;
	else cout << "bon" << endl;

	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 1000000007;
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(n%2 == 0) {
        if(s.substr(0, n/2) == s.substr(n/2, n/2)) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

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

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:String,
    b:String,
    c:String,
    }
    let a=a.chars().collect_vec();
    let b=b.chars().collect_vec();
    let c=c.chars().collect_vec();
    println!("{}{}{}",a[0],b[0],c[0])
}

Measured memory_bytes: 2188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

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

Measured memory_bytes: 256
function main(input) {
  input=input.trim()
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  const c = parseInt(input.split(" ")[2], 10);
  if(a+b<c||a>c){
    console.log("NO");
  }else{
    console.log("YES");
  }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));



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

typedef long long st_t;

st_t st[1 << 18];
// 1 << 18 = 262144

void init(int n, st_t* st){
    int nn = 1;
    while(nn < n) nn *= 2;
    fill(st, st + 2 * nn - 1, 0);
}

void add(int i, st_t a, int k, int l, int r, st_t* st){
    if(i < l || r <= i) return;
    if(r - l == 1) st[k] += a;
    else{
        int chl = 2 * k + 1;
        int chr = 2 * k + 2;
        add(i, a, chl, l, (l + r) / 2, st);
        add(i, a, chr, (l + r) / 2, r, st);
        st[k] = st[chl] + st[chr];
    }
}

st_t get_sum(int a, int b, int k, int l, int r, st_t* st){
    if(r <= a || b <= l) return 0;
    if(a <= l && r <= b) return st[k];
    st_t res_l = get_sum(a, b, 2 * k + 1, l, (l + r) / 2, st);
    st_t res_r = get_sum(a, b, 2 * k + 2, (l + r) / 2, r, st);
    return res_l + res_r;
}

int main(){
    int n, q;
    scanf("%d%d", &n, &q);
    init(n, st);
    for(int _ = 0; _ < q; ++_){
        int c, x, y;
        scanf("%d%d%d", &c, &x, &y);
        if(c == 0){
            add(--x, y, 0, 0, n, st);
        }else{
            long long ret = get_sum(--x, --y + 1, 0, 0, n, st);
            printf("%lld\n", ret);
        }
    }
    
    return 0;
}

Measured memory_bytes: 3236
from itertools import combinations_with_replacement

n,m,q = map(int,input().split())
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q

for i in range(q):
    a[i],b[i],c[i],d[i] = map(int,input().split())
    a[i] -= 1
    b[i] -= 1


arr = [0]*(n+m)
for j in range(m):
    arr[j] = 1

ans = 0

for A in combinations_with_replacement(range(1,m+1),n):
    score = 0
    for l in range(q):
        if A[b[l]] - A[a[l]] == c[l]:
            score += d[l]

    ans = max(ans,score)

print(ans)

Measured memory_bytes: 9076
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    s = [input() for i in range(n)]
    d = defaultdict(lambda : 0)
    for i in s:
        d[i] += 1
    d = list(d.items())
    d.sort(key = lambda x:(-x[1],x[0]))
    a = d[0][1]
    for i,j in d:
        if j == a:
            print(i)
            
    return

#Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 119248
package main

import (
	"bufio"
	"fmt"
	"math/big"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

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

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

func main() {

	N := nextInt()

	h, n, w := 1, 1, 1

	for h = 1; h <= 3500; h++ {
		for n = 2; n <= 3500; n++ {
			f := big.NewFloat(float64(N*h*n) / float64(4*h*n-N*h-N*n))
			if f.Sign() == 1 && f.IsInt() {
				a, _ := f.Uint64()
				w = int(a)
				goto l
			}
		}
	}
l:
	fmt.Printf("%d %d %d\n", h, n, w)
}


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



int main() {
    double r;
    cin >> r;
    double area = 3.141592653589*r*r;
    double circ = 2*3.141592653589*r;
    printf("%f %f", area, circ);
    
    return 0;
}


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

int main()
{
	while(true)
	{
	  int x, y;
	  cin >> x >> y;
	  if(x == 0 && y == 0) break;
	  else
	  {
	    for(int i = 0; i < x; i++)
	    {
	      for(int j = 0; j < y; j++)
	      {
	        cout << "#";
	      }
	      cout << endl;
	    }
	    cout << endl;
	  }
	}
	
}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int i,m=0,max=0;
  char t;
  string s;
  cin >> s;
  for (i=0;i<s.size();i++){
    t=s.at(i);
    if (t!='A'&&t!='T'&&t!='G'&&t!='C'){
      if (max<i-m) max=i-m;
      m=i+1;
    }
  }
  if (max<i-m) max=i-m;
  cout << max << endl;
  return 0;
}

Measured memory_bytes: 256
n = int(input())
for i in range(1,n+1):
    if i % 3 == 0:
        print(" {0}".format(i), end="")
    else:
        x = i
        while x != 0:
            if x % 10 == 3:
                print(" {0}".format(i), end="")
                break;
            x //= 10;
print("")


Measured memory_bytes: 5876
/*------------------------- Bism Allah Alruhmin Alrahim -------------------------------*/
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < n; i++)
#define ford(i, n) for (int i = n - 1; i > -1; i--)
#define forl(i, l, r) for (int i = l; i <= r; i++)
#define vc vector
#define f first
#define s second
#define pb(i) push_back(i)
#define mx(ar, n) (*max_element(ar, ar + n))
#define mn(ar, n) (*min_element(ar, ar + n))

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

ll LCM(ll x , ll y){
	return (x*y) / __gcd(x,y) ;
}

ll NumOfDiv(ll a , ll b , ll k){
	return b/k - a/k + (a%k == 0) ;
}
void start(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
int main()
{
	start();
	ll H , W; 
	cin >> H >> W ;
	ll x , y;
	cin >> x >> y ;
	cout << (H*W/2.0) << " " << (x*2 == H and y*2 == W) << endl ; 
	return 0 ;
}

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

int main(){
        while(1){
        int w, h;
        cin >> h >> w;
        if(h == 0 && w == 0)break;

        for(int i = 1; i <= h; i++){
                for(int j = 1; j <= w; j++){
                        if(i == 1 || i == h)cout << '#';
                        else if(j == 1 || j == w)cout << '#';
                        else cout <<'.';
                        }cout <<endl;
                }
        cout << endl;
        }

        return 0;
}

Measured memory_bytes: 1152