akhauriyash/Code-Regression huggingface dataset:
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;


int main() {
  char X, Y;
  cin >> X >> Y;
  
  if ((int)X < (int)Y) cout << '<' << endl;
  else if((int)Y < (int)X) cout << '>' << endl;
  else cout << '=' << endl;
}

Measured memory_bytes: 3596
#include"bits/stdc++.h"
#include"math.h"

using namespace std;
int main() {
	while (1) {
		int d, e, j;
		double sa, mn = 100000;
		cin >> d >> e;
		if (d == 0 && e == 0)break;
		for (int i = 0; i < d; i++) {
			j = d - i;
			sa=abs((double)sqrt(i*i + j * j) - e);
			if (sa < mn) {
				mn = sa;
			}
		}
		cout << mn << endl;
	}
		
	return 0;
}




Measured memory_bytes: 3260
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}

#[allow(unused_macros)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

#[derive(PartialEq, PartialOrd, Debug)]
pub struct OrdFloat<T>(pub T);

impl<T: PartialEq> Eq for OrdFloat<T> {}

impl<T: PartialOrd> Ord for OrdFloat<T> {
    fn cmp(&self, other: &OrdFloat<T>) -> Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

fn main() {
    let n = read!(i32);
    let v: Vec<f32> = read![[f32]];

    let mut bh = BinaryHeap::new();
    for vv in v {
        bh.push(OrdFloat(-1.0 * vv));
    }

    for i in 0..(n - 1) {
        let o = -1.0;
        let OrdFloat(x) = bh.pop().unwrap();
        let x = o * x;
        let OrdFloat(y) = bh.pop().unwrap();
        let y = o * y;

        let t = (x + y) / 2.0;

        bh.push(OrdFloat(o * t));
    }

    let OrdFloat(ans) = bh.pop().unwrap();
    println!("{}", -1.0 * ans);
}


Measured memory_bytes: 4352
<?php
$N  = fgets(STDIN);
$array = array(0);
$count = 0;

for($i = 0; $i < $N; $i++) {
  $flag = 0;
  $input_line = fgets(STDIN);
  foreach ($array as $j) {
    // echo "$count\n";
    if($input_line == $j) {
      $flag = 1;
      break;
    }
  }
  if($flag == 0) {
    $count++;
    $array[] = $input_line;
  }
}
// var_dump($array);
echo "$count\n";
exit;
?>


Measured memory_bytes: 4856
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Dynamic;
using System.Linq;
using System.Numerics;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
 
namespace atcorder
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();
            int count = 0;
            for(int i = 0; i < N - 2; i++)
            {
                string ABC = S.Substring(i, 3);
                if(ABC == "ABC")
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
    }
}
 

Measured memory_bytes: 27484
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
    long long N;
    cin >> N;
    vector<char> name(100000);
    int count = 0;
    while (true)
    {
        N--;
        name[count] = char((N % 26) + 'a');
        N /= 26;
        if (N == 0)
        {
            break;
        }
        count++;
    }
    for (int i = count; i >= 0; i--){
        cout << name[i];
    }
    cout << endl;
    return 0;
}


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

int main() {
    string S, T;
    cin >> S;
    cin >> T;
    int count = 0;
    for (int i = 0; i < S.size(); i++) {
        if (S.at(i) == T.at(i)) {
            count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
let ncr n r =
  if r >= 0 && n >= r then
    let min = if r > n-r then n-r else r in
    let rec loop n1 r1 i = function
        j when j = min + 1 -> n1/r1
      | j -> loop (n1*i) (r1*j) (i-1) (j+1)
    in loop 1 1 n 1
  else
    0
;;

let a = Array.init 51 (fun x -> 0);;
let () =
  let rec loop b = function
      19 -> ()
    | i ->
       let t = ncr (i+3) i and
           v = b + 4*(ncr (i-8) (i-10)) in
       a.(i) <- t-v;
       a.(36-i) <- a.(i);
       loop v (i+1)
  in loop 0 0;;

let rec read () =
  try let n = read_int () in
      Printf.printf "%d\n" a.(n);read ()
  with End_of_file -> ()
;;

let () = read ();;

Measured memory_bytes: 2276
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;



int main(){
  
  int n,m,k;
  cin >> n >> m >> k;
  if(k == 0){
    cout << "Yes" << endl;
    return 0;
  }
  vector<vector<int>> dp(n+2,vector<int>(m+2));
  rep(i,n+1){
    rep(j,m+1){
      if(dp[i][j] == k){
        cout << "Yes" << endl;
        return 0;
      }
      dp[i+1][j] = dp[i][j]+m-j*2;
      dp[i][j+1] = dp[i][j]+n-i*2;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 7516
import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long num = 0L;
		String s = "";
		HashMap<Long, Long> map = new HashMap<>();
		if(n <= 1) {
			System.out.println(0); //1以下の場合
		return;
		}
		for(long i = 2 ; i <= Math.sqrt(n) ; i++) {
			if(n % i != 0)
				continue;
			n /= i;
			map.put(i, map.getOrDefault(i,  0L) + 1L);
			s += i;
			if(n == 1)
				break;
			s += " * ";
          i--;
		}
      if(n != 1) {
        s += n;
        map.put(n, map.getOrDefault(n,  0L) + 1L);
        }
      for(long i : map.keySet()) {
    	  long j = 0L;
    	  long t = map.get(i);
    	  for(long k = 1 ; ; k++) {
    		  if(t >= k) {
    			  t -= k;
    			  j++;
    		  }
    		  else
    			  break;
    	  }
    	  num += j;

      }
		System.out.println(num);



	}
	public static long pow(long ml, long a, long b){
    if(b == 1)
      return ml;
      ml *= a;
      b--;
		return b == 0 ? ml : pow(ml , a ,b);
	}

}











Measured memory_bytes: 39736
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

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

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {
	int n,a,b;
	string s;
	cin>>n>>a>>b>>s;
	int curr=0,bs=0;
	for(char c:s) {
		if(c=='a') {
			if(a+b>curr) curr++,cout<<"Yes\n";
			else cout<<"No\n";
		}else if(c=='b') {
			if(a+b>curr&&bs<b)curr++,bs++,cout<<"Yes\n";
			else cout<<"No\n";
		}else cout<<"No\n";
	}
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3736
#include <stdio.h>

main(){
  int N,i,max,min;
  int a[100];
  
  scanf("%d",&N);
 
  for(i=0;i<N;i++){
  scanf("%d",&a[i]);
  }
  
  max=0; min=1000;
  
  for(i=0;i<N;i++){
  if(max<=a[i]){max=a[i];}
  if(min>=a[i]){min=a[i];}  
  }
  
  printf("%d\n",max-min);
  
  return(0);
}


Measured memory_bytes: 128
#include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
static const ll MAX_L = (ll)1 << 62;

//////////////////////////////////////////////////
//nCr Calculation/////////////////////////////////
//////////////////////////////////////////////////
static const ll FACT_SIZE = 1000000;
ll fact[FACT_SIZE] = {};

ll Pow(ll n, ll p) {
	if (p == 0)return 1;
	if (p == 1)return n;
	ll t = Pow(n, p / 2);
	if (p & 1) return (t * t % MOD) * n % MOD;
	else return t * t % MOD;
}
void factorial(ll f) {
	fact[0] = fact[1] = 1;
	rep(i, 1, FACT_SIZE) fact[i] = fact[i - 1] * i % MOD;
}

ll nCr(ll n, ll r) {
	if (fact[0] == 0)	factorial(1000000);
	return ((fact[n] * (Pow(fact[r], MOD - 2) % MOD)) % MOD * Pow(fact[n - r], MOD - 2)) % MOD;
}

int main() {
	ll h, w, a, b; cin >> h >> w >> a >> b;

	ll ans = 0;
	rep(i, b, w) {
		ll s = nCr(h - 1 - a + i, i);
		ll t = nCr(a - 1 + w - 1 - i, a - 1);
		ans = (ans + s * t % MOD) % MOD;
		//ans += nCr(h - 1 - a + i, i) * nCr(a - 1 + w - 1 - i, a - 1) % MOD;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 8064
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] P = new int[N];
		for (int i = 0; i < N; ++i) {
			P[i] = sc.nextInt();
			--P[i];
		}
		long[] f = new long[N + 1];
		for (int i = 0; i < N; ++i) {
			f[P[i] + 1] = f[P[i]] + 1;
		}
		long ans = 0;
		for (int i = 0; i <= N; ++i) {
			ans = Math.max(ans, f[i]);
		}
		ans = N - ans;
		System.out.println(ans);
	}

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

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


Measured memory_bytes: 87620
/*
	Created by : imay_10
	" It won't be EASY, but I'll make it "
*/

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

typedef long long int ll;
const int mod = 1e9+7;
const ll inf = 1e18;
const double pi = 3.1415926535897932384626;

// Utility for fast exponentiation
ll mpow(ll a,ll b,ll m){
    ll res=1;
    //a%=m;
    while(b){
    	if(b%2) res=res*a%m;
		a=a*a%m;
		b/=2;
	}
	return res;
}

// Utility for modular inverse
ll inv(ll a,ll m){
	return mpow(a,m-2,m);
}

// Utility for GCD Calculation
ll gcd(ll a,ll b){
	if(b==0) return a;
	return gcd(b,a%b);
}

// Utility for binomial coefficient
ll ncr(ll n,ll k)
{
    if(n<k)
        return 0;
    ll C[n + 1][k + 1];
    ll i,j;
    for(i=0;i<=n;i++){
        for(j=0;j<=min(i,k);j++){
            if (j==0 || j==i)
                C[i][j]=1;
            else
                C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
        }
    }
    return C[n][k];
}

void solve(){
	//code
	string s;
	cin>>s;
	int n=s.length();
	if(s[n-1]=='s') cout<<s<<"es";
	else cout<<s<<"s";
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	solve();
 	return 0;
}


Measured memory_bytes: 3660
#include <stdio.h>
 
int main(void) {
	int a, b, ans;
	char op;
	
	scanf("%d %c %d", &a, &op, &b);
	
	switch (op){
		case '+': ans = a+b; break;
		
		case '-': ans = a-b; break;
	}
	
	printf("%d\n", ans);
	
	return 0;
}

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

int main() {
  int X, Y, Z;
  cin >> X >> Y >> Z;
  
  vector<int> result(3);
  result.at(0) = Z;
  result.at(1) = X;
  result.at(2) = Y;
  
  cout << result.at(0) <<" "<< result.at(1) <<" "<< result.at(2) << endl;
}


Measured memory_bytes: 256
import sys
bbn=1000000007
	
#+++++

		
def main():
	b , c = map(int, input().split())
	if b > c:
		b,c=c,b
	ret=''.join([str(b)]*c)
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 38256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
vector<int> S[1000];
void Calc(){
	int N = rei();
	int K;
	for(K=0;K*(K-1)/2<N;K++);
	if(K*(K-1)/2 != N){
		cout << "No" << endl;
		return;
	}
	cout << "Yes" << endl;
	int c = 1;
	for(int i=0;i<K;i++){
		for(int j=i+1;j<K;j++){
			S[i].push_back(c);
			S[j].push_back(c++);
		}
	}
	cout << K << endl;
	for(int i=0;i<K;i++){
		cout << S[i].size() << " ";
		for(int j=0;j<S[i].size()-1;j++){
			cout << S[i][j] << " ";
		}
		cout << S[i][S[i].size()-1] << endl;
	}
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 2304
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}
var mod = 1e9+7;

console.log(main());
function main(){
  var l = o.a(1);
  var dp0 = 2;
  var dp1 = 1;
  for(var i = 1; i < l.length; i++){
    dp1 *= 3;
    if(l[i] === "1"){
      dp1 += dp0;
      dp0 *= 2;
      dp0 %= mod;
    }
    dp1 %= mod;
  }
  return (dp0+dp1)%mod;
}

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

int main(){
    int anss[3], k, maxind, i, ttl;
    maxind = 0;
    ttl = 0;

    scanf("%d %d %d", &anss[0], &anss[1], &anss[2]);
    scanf("%d", &k);

    if(anss[0] < anss[1]){
        maxind = 1;
    }

    if(anss[maxind] < anss[2]){
        maxind = 2;
    }
    for(i = 0; i < k; i++){
        anss[maxind] *= 2;
    }

    for(i = 0; i < 3; i++){
        ttl += anss[i];
    }
    printf("%d\n", ttl);
    return 0;
}

Measured memory_bytes: 128
n,k=map(int,input().split())
s=input()

how_many=[]
num=[]

counter=0
for i in range(1,n):
    counter+=1
    if s[i-1]!=s[i]:
        how_many.append(counter)
        num.append(int(s[i-1]))
        counter=0
how_many.append(counter+1)
num.append(int(s[-1]))


ans=0
accumulate=[0]
for i in range(len(how_many)):
    accumulate.append(accumulate[-1]+how_many[i])

for g in range(len(num)):
    l=g
    if num[l]==0:
        r=min(g+2*k,len(num))
    else:
        r=min(g+2*k+1,len(num))
    ans=max(ans,accumulate[r]-accumulate[l])
print(ans)

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

#define mp make_pair
#define pb push_back

#define int int64_t

const int MOD = 1e9+7;
 
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,m;
    cin>>n>>m;
    if(n==m)
    cout<<"Yes";
    else
    cout<<"No";   

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
// make pair, tuple
// __gcd(int, int)
// bool isPrime(int n){
//       if(n <= 1)return false;
//       if(n <= 3)return true;
//       if(n % 2 == 0 || n % 3 == 0)return false;
//       for(int i = 5;i * i <= n;i += 6){
//             if(n % i == 0 || n % (i + 2) == 0)return false;
//       }
//       return true;
// }
// int countSubString(string s, string temp){
//       int ans = 0;
//       size_t f = s.find(temp);
//       while(f != string::npos){
//             ans++;
//             f = s.find(temp, f + 1);
//       }
//       return ans;
// }

int main(){
    long long int n;cin >> n;
    long long int ans = INT64_MAX;
    long long int f = pow(n, 0.5);
    for(long long int i = 1ll;i <= f + 5;i++){
        if(n / i == (n + (i - 1ll)) / i){
            ans = min(ans, (n / i) - 1ll + (i - 1ll));
        }
    }
    cout << ans;
}

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

int main()
{
    
    int n,m;
    
    cin>>n>>m;
    
    int arr[n] , sum=0;
    
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        
        sum+=arr[i];
    }
    
    float x  = sum/(float)(4*m);
    
    int cnt=0;
    
    
    for(int i=0;i<n;i++)
    {
        if((float)arr[i]>=x)
        cnt++;
    }
    
    if(cnt<m)
    cout<<"No"<<endl;
    else
    cout<<"Yes"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;

void prvec(vector<ll> vec){ //for debug
    ll n = vec.size();
    cout << "------------------------------------\n" ;
    rep(i,n) cout << i << " " << vec.at(i) << "\n";
    cout << "------------------------------------\n" ;
}

void pr2d(vector<vector<ll>> vec){ // for debug
    ll h = vec.size();
    ll w = vec.at(0).size();
    cout << "------------------------------------\n" ;
    rep(i,h){
        rep(j,w){
            cout << vec.at(i).at(j) << " ";
        }
        cout << "\n";
    }
    cout << "------------------------------------\n" ;
}

int main(){
    ll n , m , q; cin >> n >> m >> q;
    vector<vector<vector<ll>>> v(n+1,vector<vector<ll>>(0,vector<ll>(0))); //v[a][b][c] 長さaの数列たちを入れる。

    for(int i=1;i<=m;i++){
        v.at(1).push_back({i});
    }

    for(int i=1;i<n;i++){
        for(auto a:v.at(i)){//長さiの数列を全部持ってくる
            ll am = a.back();
            for(int b = am;b<=m;b++){
                auto c = a; //cに持ってきた数列をコピーする
                c.emplace_back(b);
                v.at(i+1).emplace_back(c);
            }
        }
    }

    vector<vector<ll>> query(q,vector<ll>(4,0));

    rep(i,q){
        rep(j,4){
            cin >> query[i][j];
        }
    }

    ll ans = 0;
    for(auto a:v.at(n)){
        ll aans = 0;
        rep(i,q){
            if(a.at(query[i][1]-1) - a.at(query[i][0] - 1) == query[i][2]) aans+=query[i][3];
        }
        ans = max(ans,aans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 23088
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int X = scanner.nextInt();
		    
		    if( A<= X && X <= B + A ) 
		    {
		    	System.out.println("YES");
		    }
		    else 
		    {
		    	System.out.println("NO");
		    }
		    scanner.close(); }
		  }

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

long long func(long long a, long long b){
    return a*a*a*a*a - b*b*b*b*b;
  }



int main(){
  using lint = long long;
  
  
  
  lint a=0,b=0,x;
  cin >> x;
  
  bool not_yet = true;
  
  while(not_yet){
    a++;
    for(lint i=(-1)*a; i<=a; i++){
      if( func(a,i)==x ){
        b=i;
        not_yet = false;
        break;
      }
    }
  }
  
  cout << a << ' ' << b << endl;
}
        
  

Measured memory_bytes: 3592
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

int main()
{
	string S;
	cin >> S;

	int count = 0;
	for (int i = 0; i < S.length(); i++) {
		if (S[i] == '1') {
			count++;
		}
	}
	cout << count << endl;
}


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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

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

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

int main() {
  llong N, M;
  vector<llong> H, other;
  vector<lpair> AB;

  cin >> N >> M;
  H.resize(N);
  other.resize(N);
  for (auto &in: H) {
    cin >> in;
  }
  AB.resize(M);
  for (auto &in: AB) {
    cin >> in.first >> in.second;
    other[in.first - 1] = max(other[in.first - 1], H[in.second - 1]);
    other[in.second - 1] = max(other[in.second - 1], H[in.first - 1]);
  }

  llong ans = 0;
  for (int i = 0; i < N; ++i) {
    ans += H[i] > other[i];
  }

  cout << ans << endl;

  return 0;
}

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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
struct BIT {
	int n;
	std::vector<int> data;
	BIT (int n) : n(n) {
		data.resize(n + 1);
	}
	void add(int i, int val) {
		for (i++; i <= n; i += i & -i) data[i] += val;
	}
	int sum(int r) {
		int res = 0;
		for (; r; r -= r & -r) res += data[r];
		return res;
	}
};

int main() {
	int n = ri();
	int q = ri();
	int a[n];
	for (auto &i : a) i = ri();
	
	std::map<int, std::vector<int> > index;
	for (int i = 0; i < n; i++) index[a[i]].push_back(i);
	
	struct Info {
		int l;
		int r;
		int val;
	};
	std::vector<Info> add[n + 1];
	
	for (auto &i : index) {
		auto x = i.second;
		i.second.push_back(n);
		int last = 0;
		for (auto j : i.second) {
			add[last].push_back({last, j, 1});
			add[j].push_back({last, j, -1});
			last = j + 1;
		}
	}
	
	std::vector<std::pair<int, int> > qs[n];
	for (int i = 0; i < q; i++) {
		int l = ri() - 1;
		int r = ri() - 1;
		qs[l].push_back({r, i});
	}
	BIT tree(n + 1);
	int res[q];
	for (int i = 0; i < n; i++) {
		for (auto j : add[i]) {
			tree.add(j.l, j.val);
			tree.add(j.r, -j.val);
		}
		for (auto j : qs[i]) res[j.second] = index.size() - tree.sum(j.first + 1);
	}
	for (auto i : res) printf("%d\n", i);
	
	return 0;
}


Measured memory_bytes: 125208
# -*- coding: utf-8 -*-

# 整数の入力
s = int(input())

#初項 sは入力で与えられる。
#関数 f(n)を以下のように定める: n が偶数なら f(n)=n/2、n が奇数なら f(n)=3n+1
#i=1のとき ai=s、i>1 のとき ai=f(ai−1)
#    am=an(m>n)

a_list=[]
a_list.append(s)
i=0
flag=0
while(flag==0):
  i+=1
  before_a = a_list.pop(-1)
  a_list.append(before_a)
  
  if before_a%2==0:
    after_a = before_a/2
  else:
    after_a = (3 * before_a) + 1
  
  #print(after_a)
  
  for j in range(i):
    if a_list[j]==after_a:
      flag = 1
      break
  else:
    a_list.append(after_a)
    
print(i+1)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

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

	switch (age)
	{
	case 1:
		cout << "Hello World" << endl;
		break;
	case 2:
	{
		int a, b;
		cin >> a >> b;
		cout << a + b << endl;
		break;
	}
	}
	return 0;
}

Measured memory_bytes: 256
N = int(input())
L=[]
for i in range(N):
    tmp = input().split()
    L.append((tmp[0],int(tmp[1]),i+1))
    
L.sort(reverse=True, key=lambda x:x[1])
L.sort(key=lambda x:x[0])

for i in L:
    print(i[2])

Measured memory_bytes: 3060
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors


N = int(input())
A = make_divisors(N)
print(len(str(A[-1])))


Measured memory_bytes: 3060
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline()


n, q = map(int, input().split())
GRAPH = [[] for _ in range(n + 1)]
COUNTS = [0] * (n + 1)

for _ in range(n - 1):
    a, b = map(int, input().split())
    GRAPH[a].append(b)
    GRAPH[b].append(a)

for _ in range(q):
    p, x = map(int, input().split())
    COUNTS[p] += x

def dfs(now, prev):
    for vertex in GRAPH[now]:
        if vertex == prev:
            continue
        else:
            next = vertex
        COUNTS[next] += COUNTS[now]
        dfs(next, now)
dfs(1, 0)

answer = " ".join(map(str, COUNTS[1:]))
print(answer)


Measured memory_bytes: 232312
fn main() {
    let rdx = read_vec::<usize>();
    let r = rdx[0];
    let d = rdx[1];
    let mut x = rdx[2];

    for _ in 0..10 {
        x = r * x - d;
        println!("{}", x);
    }
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

Measured memory_bytes: 4352
object Main extends App {

  import scala.io.StdIn._
  import scala.math._

  implicit object TeamOrdering extends Ordering[Team] {
    override def compare(x: Team, y: Team): Int = {
      if (x.ac == y.ac){
        if (x.wa == y.wa) {
          y.id.compare(x.id)
        }else {
          y.wa.compare(x.wa)
        }
      }else {
        x.ac.compare(y.ac)
      }
    }
  }
  solve
  def solve: Unit ={
    val n = readLine.trim.toInt
    if (n == 0) return
    val teams = Array.tabulate(n){_ ⇒
      val Array(i, u, a, p) = readLine.trim.split(' ').map(_.toInt)
      Team(i, u, a, p)
    }.sorted.reverse
    val group = Array.tabulate(1001){_ ⇒ 0}
    var sum = 0
    for (t ← teams){
      if (sum < 10 && group(t.associate) < 3){
        println(t.id)
        sum += 1
        group(t.associate) += 1
      }else if (sum < 20 && group(t.associate) < 2){
        println(t.id)
        sum += 1
        group(t.associate) += 1
      }else if (sum < 26 && group(t.associate) < 1){
        println(t.id)
        sum += 1
        group(t.associate) += 1
      }
    }


    solve
  }
  case class Team(id: Int, associate: Int, ac: Int, wa: Int)
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}


Measured memory_bytes: 44844
#include<bits/stdc++.h>
#define fast ios::base_sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long int
#define M 1000000000+7
using namespace std;

signed main(){
    int x,k;
    cin>>k>>x;
    for(int i=(x+1-k);i<x;i++)
        cout<<i<<" ";
    for(int i=x;i<x+k;i++)
        cout<<i<<" ";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb(x) push_back(x)

int main()
{
    ll n,cnt=0;
    cin>>n;
    ll k=100;
    while(1)
    {
        ll p=(ll)(k*0.01)+k;
        k=p;
        cnt++;
        if(p>=n)
        {
            break;
        }
    }
    cout<<cnt<<endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#define mst(a,b) memset((a),(b),sizeof(a))
#define debug printf("debug\n")
#define INF 0x3f3f3f3f
#define lson lef,mid,rt<<1
#define rson mid+1,rig,rt<<1|1
const int maxn=1e5+5;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int arr[maxn];
int main()
{
	int n;scanf("%d",&n);
	int maxi=-INF;int mini=INF;
	int minicnt=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&arr[i]);
		maxi=max(maxi,arr[i]);
		mini=min(mini,arr[i]);
	}
	for(int i=1;i<=n;i++){
		if(arr[i]==mini) minicnt++;
	}
	if(maxi-mini>1||maxi>n-1){
		puts("No");
	}else if(maxi==mini){
		if(mini==n-1||mini==1) puts("Yes");
		else{
			if(n/mini>=2){
				puts("Yes");
			}else{
				puts("No");
			}
		}
	}else if(maxi!=mini){
		int x=n-minicnt;
		int y=maxi-minicnt;
		if(y==0) puts("No");
		else{
			if(x/y<2) puts("No");
			else puts("Yes");
		}
	}
	return 0;
}

Measured memory_bytes: 640
package main

import (
	"fmt"
)

// go run ./main.go < in

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

	a := n % k
	b := k - (n % k)

	if a >= b {
		fmt.Println(b)
	} else {
		fmt.Println(a)
	}
}


Measured memory_bytes: 1752
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,n,j) for(int i=(j);i<(n);++i)
#define ssort(n) sort((n).begin(),(n).end())
using ll=long long;
using ld=long double;
typedef pair<int,int> P;
#define INF 10101010

int main()
{
    ll a,b,x;
    cin >> a >> b >> x;

    ll ans=(b)/x-(a-1)/x;
    if(a==b&&a==0){
        cout << 1 << endl;
    }else if(a==0){
        cout << (b/x)+1 << endl;
    }
    else{
        cout << ans << endl;
    }
    
    
    

}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
long long a[100005], b[100005];
long long have[100005];

long long min(long long a,long long b){ return a>b?b:a; }

int main(){
    int n;
    scanf("%d",&n);
    for(int i = 1; i <= n; i++) scanf("%lld",&a[i]);
    for(int i = 1; i <= n; i++) scanf("%lld",&b[i]);
    long long need = 0; int size = 0;
    int ans = 0;
    for(int i = 1; i <= n; i++){
        if(a[i]<b[i]) need += b[i]-a[i], ans++;
        else if(a[i]>b[i]) have[++size] = a[i]-b[i];
    }
    std::sort(have+1,have+1+size);
    for(int i = size; i >= 1; i--){
        if(need==0) break;
        else{
            ans++;
            need -= min(have[i],need);
        }
    }
    if(need!=0) printf("-1\n");
    else printf("%d\n",ans);
    return 0;
}


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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)

#define mod 1e9+7;
#define inf 1e18+7;

typedef long long ll;

int main() {
    ll n,T;
    cin>>n>>T;

    vector<ll>t(n);
    rep(i,n){
        cin>>t[i];
    }

    ll ans=T*n;
    rep(i,n-1){
        if(t[i+1]-t[i]<T){
            ans-=(T-(t[i+1]-t[i]));
        }
    }

    cout<<ans<<endl;

}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define pb push_back
#define eq push
#define dq pop
#define f front
#define inf 100000000
int main()
{
	lli n;
	cin>>n;
	lli a[n];
	for(lli i=0;i<n;i++)
		cin>>a[i];
	
	lli max=0;
	lli m=0;
		
	for(lli i=0;i<n;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
			m=i;
		}
	}
	
	lli max2=0;
	lli m2=0;
	
	for(lli i=0;i<n;i++)
	{
		if(a[i]>max2 && a[i]<=max && i!=m)
		{
			max2=a[i];
			m2=i;
		}
	}
	
	 for(lli i=0;i<n;i++)
	 {
	 	if(i!=m)
	 		cout<<max<<endl;
	 	else
	 		cout<<max2<<endl;
	 }
	
 return 0;
}


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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back

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

  int N;
  cin >> N;

  if(N < 4) {
    cout << "No" << endl;
    return 0;
  }

  bool flag = true;



  rep(i, N) {
    rep(j, N) {
      if(i * 4 + j * 7 > N) continue;
      if(i * 4 + j * 7 == N) {
        cout << "Yes" << endl;
        flag = false;
        i = 101;
        j = 101;
      }
    }
  }

  if(flag == true) cout << "No" << endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

struct info{
    int n,w,s,e,p;
    info(int n, int w, int s, int e, int p):n(n), w(w), s(s), e(e), p(p){}
    info(){}
    void decrease(){
        n--; w--; s--; e--;
    }
    bool isvalid(){
        return n>0 && w>0 && s>0 && e>0;
    }
    bool operator < (const info &a) const{
        return (n +(w<<3) +(s<<6) +(e<<9) +(p<<12)) < (a.n +(a.w<<3) +(a.s<<6) +(a.e<<9) +(a.p<<12));
    }
};

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;

        vector<vector<int> > w(n, vector<int>(17));
        for(int i=0; i<n; i++){
            for(int j=1; j<=16; j++){
                cin >> w[i][j];
            }
        }
        set<info> s;
        if(w[0][6] +w[0][7] +w[0][10] +w[0][11] == 0){
            s.insert(info(6, 6, 6, 6, 6));
        }
        for(int i=1; i<n; i++){
            set<info> ns;
            for(set<info>::iterator itr=s.begin(); itr != s.end(); itr++){
                info e = *itr;
                int x = (e.p -1) %4;
                int y = (e.p -1) /4;
                e.decrease();
                for(int d=0; d<4; d++){
                    for(int t=(d==0)?0:1; t<=2; t++){
                        int nx = x +t*dx[d];
                        int ny = y +t*dy[d];
                        info ni = e;
                        ni.p = 4*ny +nx +1;
                        if(nx<0 || nx>2 || ny<0 || ny>2) break;
                        if(w[i][ni.p] +w[i][ni.p+1] +w[i][ni.p+4] +w[i][ni.p+5] > 0) continue;
                        if(ni.p == 1) ni.n = 7;
                        if(ni.p == 3) ni.w = 7;
                        if(ni.p == 9) ni.s = 7;
                        if(ni.p == 11) ni.e = 7;
                        if(ni.isvalid()) ns.insert(ni);
                    }
                }
            }
            s = ns;
        }
        
        if(s.size()!=0){
            cout << 1 << endl;
        }else{
            cout << 0 << endl;
        }
    }
    return 0;
}



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

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

    for (int i = 0; i < B; i++)
    {
        if (A * i % B == C)
        {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
}

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

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 1e9+7;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
typedef long long i64;

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

  int h, w, n;
  cin >> h >> w >> n;
  vi a(n);
  rep(i, 0, n) cin >> a[i];

  vvi ans(h, vi(w));
  int x = 0, y = 0;
  rep(i, 0, n) {
    while(a[i]) {
      ans[y][x] = i + 1;
      if((y % 2 == 1 && x == 0) || (y % 2 == 0 && x == w - 1)) {
        y++;
      }
      else {
        if(y % 2 == 1) x--;
        else x++;
      }
      a[i]--;
    }
  }

  rep(i, 0, h) {
    cout << ans[i][0];
    rep(j, 1, w) cout << " " << ans[i][j];
    cout << endl;
  }
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define REP(i,n,m) for(int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

const char en = '\n';

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

template<class T> inline bool chmax(T& a, T b) { if (a <= b) { a = b; return true; } else return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } else return false; }

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

	ll n, m; cin >> n >> m; 
	vector<ll> a(n); rep(i,n) { cin >> a[i]; a[i] %= m; }
	vector<ll> sum(n + 1);
	sum[0] = 0;
	rep(i, n) {
		sum[i + 1] = (sum[i] + a[i]) % m;
	}
	map<ll,ll> mp;
	rep(i,n+1) mp[sum[i]]++;
	ll ans = 0;
	for (auto& v : mp) {
	  ans += v.second % 2 == 0 ? v.second/2 * (v.second-1) : (v.second-1)/2 * v.second;
	}

	cout << ans << endl;
}


Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define vout(v) cout<<#v<<": ";for(int i=0;i<(int)v.size()-1;i++){cout<<v[i]<<" ";}cout<<v[v.size()-1]<<"\n";
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define vsum(v) accumulate(all(v), 0LL);
#define MOUT(m,r,c) rep(i,r){rep(j,c){cout<<m[i][j]<<" ";}cout<<endl;}
#define mout(m) MOUT(m,m.size(),m[0].size())
#define debg(a) cerr<<#a<<" "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef vector<ll> V;
// const long long MOD=1000000007;
const long long INF = 1e18;
#define EPS (1e-7)
#define PI (acos(-1))
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) { a = b; return true; }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) { a = b; return true; }
    return false;
}


void solve_wa(long long N, long long K, std::vector<long long> A, std::vector<long long> F){
    priority_queue<ll> que;
    for (ll i = 0; i < N; i++) {
        que.push(A[i]);
    }
    for (ll i = 0; i < K; i++) {
        que.push(que.top()-1);
        que.pop();
    }
    SORT(F);
    vout(F);
    ll ret=0;
    cout << "Q: ";
    for (ll i = 0; i < N; i++) {
        cout << que.top() << " ";
        ret = max(que.top()*F[i], ret);
        que.pop();
    }
    cout<<endl;
    cout << ret << "\n";
}

bool check(ll mid, ll N, ll K, vector<ll> A, vector<ll> F){
    ll res=0;
    for (ll i = 0; i < N; i++) {
        if(A[i]*F[i]>mid){
            res += ceil(1.0*(A[i]*F[i]-mid)/F[i]);
            // res += (A[i] * F[i] - mid + F[i] - 1) / F[i];
        }
        if(res>K) return false;
    }
    return true;
}

void solve(long long N, long long K, std::vector<long long> A, std::vector<long long> F){
    SORT(A);
    // vout(A);
    RSORT(F);
    // vout(F);

    ll ok=INF, ng=-1;
    while(ok-ng>1){
        ll mid=(ok+ng)/2;
        if(check(mid, N, K, A, F)) ok = mid;
        else ng = mid;
    }
    cout << ok << "\n";
}

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


Measured memory_bytes: 6552
"use strict"
const Main = (input) =>{
	let xs = input.trim().split(' ').map(v=>parseInt(v,10));
    let a = xs[0];
    let b = xs[1];
    let ans = 1;
    let i = 0
    if(b==1){
    ans = 0
    }else{
      while((a-1)*i+a < b){
      i++
      ans += 1;
      }
    }
    console.log(ans);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const ll inf=1e9+7;
const ll INF=1e18;

int main(){
    decp(10);
    const double pi=3.14159265358979;
    double a,b,x;cin>>a>>b>>x;
    if(a*a*b/2<x)cout<<180*atan(2*(a*a*b-x)/(a*a*a))/pi<<endl;
    else cout<<180*atan(a*b*b/(2*x))/pi<<endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = (int)1e9 + 7;
int INF = (int)2e18;

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

signed main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int BnotC = B / C;
    int BnotD = B / D;
    int BnotCD = B / lcm(C, D);
    int ansB = B - (BnotC + BnotD - BnotCD);
    --A;
    if (A < 0) A = 0;
    int AnotC = A / C;
    int AnotD = A / D;
    int AnotCD = A / lcm(C, D);
    int ansA = A - (AnotC + AnotD - AnotCD);
    cout << ansB - ansA << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define DEBUG(x) cerr << #x << " = " << x << endl
#define int long long
int MOD = 2305266692540551LL;
int BASE = 4001;
signed main() {
  ios::sync_with_stdio(false);
  string S, T; cin >> S >> T;
  if(S.size() < T.size()) swap(S, T);
  int alpha[26];
  alpha[0] = 1;
  for(int i = 1; i < 26; ++i) {
    alpha[i] = (alpha[i - 1] * BASE) % MOD;
  }
  for(int l = (int)T.size(); l >= 1; --l) {
    unordered_set<int> u;
    int hash;
    hash = 0;
    REP(i,l) {
      hash += alpha[T[i] - 'a'];
      hash %= MOD;
    }
    u.insert(hash);
    // cerr << T.substr(0, l) << " => " << hash << endl;
    for(int i = 1; i < (int)T.size() - l + 1; ++i) {
      hash -= alpha[T[i - 1] - 'a'];
      if(hash < 0) hash += MOD;
      hash += alpha[T[i - 1 + l] - 'a'];
      hash %= MOD;
      u.insert(hash);
      // cerr << T.substr(i, l) << " => " << hash << endl;
    }

    hash = 0;
    REP(i,l) {
      hash += alpha[S[i] - 'a'];
      hash %= MOD;
    }
    if(u.count(hash)) {
      cout << l << endl;
      return 0;
    }
    // cerr << S.substr(0, l) << " => " << hash << endl;
    for(int i = 1; i < (int)S.size() - l + 1; ++i) {
      hash -= alpha[S[i - 1] - 'a'];
      if(hash < 0) hash += MOD;
      hash += alpha[S[i - 1 + l] - 'a'];
      hash %= MOD;
      // cerr << S.substr(i, l) << " => " << hash << endl;
      if(u.count(hash)) {
        cout << l << endl;
        return 0;
      }
    }
  }
  cout << 0 << endl;
  return 0;
}

Measured memory_bytes: 3376
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

#define DEBUG
#ifdef DEBUG
#define debug_printf printf
#else
#define debug_printf 1 ? 0 : printf
#endif

typedef long long int ll;
typedef vector<ll> Vl;
typedef vector<int> Vi;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pl;

#define FST first
#define SND second

// const int MAX_N = 100000;                  // 10^5
// const int MAX_N = 100000;                  // 10^5
// const int MAX_N = 1000000000;              // 10^9
// const ll  MAX_N = 1000000000000000000;     // 10^18
// const int BASE  = 1000000000 + 7;          // 10^9 + 7
// const int INFI  = 1000000000 + 7;          // 10^9 + 7
// const ll INFL  = 1000000000000000000 + 7; // 10^18 + 7

string S;

int main() {
  cin >> S;

  if (S.substr(0, 4) == "YAKI") {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
S = str(input())

a, b, c, d = int(S[0]), int(S[1]), int(S[2]), int(S[3])

op = [1, -1]

for i in op:
    for j in op:
        for k in op:
            if a + i*b + j*c + k*d == 7:
                op1 = '+' if i == 1 else '-'
                op2 = '+' if j == 1 else '-'
                op3 = '+' if k == 1 else '-'
                print('{}{}{}{}{}{}{}=7'.format(a, op1, b, op2, c, op3, d))
                exit()

Measured memory_bytes: 3064
import sys

sys.setrecursionlimit(10 ** 7)
# import bisect
# import numpy as np
# from collections import deque
from collections import deque
# map(int, sys.stdin.read().split())
import itertools


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    print((-N)%1000)


if __name__ == "__main__":
    main()


Measured memory_bytes: 64732
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
//#include <bits/stdc++.h> 

using namespace std;
typedef  pair<long int,long int> P;

int main(){
    long int H,W,M;
    cin>>H>>W>>M;
    long int h[M],w[M];
    set<P> s;
    vector<long int> x(H),y(W);
    for (long int i=0;i<M;i++){
        cin>>h[i]>>w[i];
        h[i]--;
        w[i]--;
        x[h[i]]++;
        y[w[i]]++;
        s.insert(P(h[i],w[i]));
    }
    long int maxh=0,maxw=0;
    for (long int i=1;i<H;i++){
        if (x[i]>x[maxh]) maxh=i;
    }
    for (long int i=1;i<W;i++){
        if (y[i]>y[maxw]) maxw=i;
    }
    vector<long int> xmax,ymax;
    long int nx=0,ny=0;
    for (long int i=0;i<H;i++){
        if (x[i]==x[maxh]){
            xmax.push_back(i);
            nx++;
        }
    }
    for (long int i=0;i<W;i++){
        if (y[i]==y[maxw]){
            ymax.push_back(i);
            ny++;
        }
    }
    long int n=0;
    for (long int i=0;i<M;i++){
        if (x[h[i]]==x[maxh] && y[w[i]]==y[maxw]) n++;
    }
    if (n==nx*ny) cout<<x[maxh]+y[maxw]-1<<endl;
    else cout<<x[maxh]+y[maxw]<<endl;

    return 0;
}

Measured memory_bytes: 39656