akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<stack>/*** LIFO *** stack<type> var;
push(), top():to get data, pop():to remove, size(), empty() ***/
using namespace std;

#define Fp(I, STAT, END) for(int I = STAT; I < END; I++)
#define Fm(I, STAT, END) for(int I = STAT; I > END; I--)

#define MINVALUE 100

int main(){
    int X, maxNum, diff;
    cin >> X;
    maxNum = X / MINVALUE;
    diff = X % MINVALUE;
    if(maxNum <= 0) cout << 0 << endl;
    else if(diff <= 5 * maxNum) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 256
import bisect
# N = input()   # 単純な入力
# input = list(input()) # ひとかたまりの文字列をリスト化
# N = int(input())  # 整数一つ
# input = input().split()   # スペース区切りを文字としてリスト化
# X,Y = map(int,input().split())  # ２個や３個の整数をそれぞれ取得
# input = list(map(int,input().split()))
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

sa = [A[i] - B[i] for i in range(len(A))]
sa.sort()
# print(sa)
insert_index = bisect.bisect_left(sa,0)
# print(insert_index)
Sum = sum(sa[0:insert_index])
Sumlist = [0 for i in range(N)]
isum = 0

if Sum == 0:
    print(0)
    exit()

for i in range(len(sa),insert_index-1,-1):
    isum = isum + sa[i-1]
    if abs(Sum) <= isum:
        print(insert_index + N - i + 1)
        exit()
    elif sa[i-2] <= 0:
        print(-1)
        exit()

Measured memory_bytes: 19068
#include <bits/stdc++.h>
#define ll unsigned long long
using namespace std;
const int N = 100001;
vector<int> sol;
int n, k;
void sub1(){
  if(sol.size() == 1){
    sol[0]--;
    for(int i = 1;i < n;i++){
      sol.push_back(k / 2 + 1);
    }
  }else{
    if(sol.back() == 1){
      sol.pop_back();
    }else{
      sol[sol.size() - 1]--;
      while(sol.size() != n){
        sol.push_back(k);
      }
    }
  }
}
int main()
{
//  freopen("in.txt", "r", stdin);
//  freopen("out.txt", "w", stdout);
//  int k, n;
  cin >> k >> n;
  if(k % 2 == 0){
    sol.push_back(k / 2);
    for(int i = 1;i < n;i++)
      sol.push_back(k);
  }else{
    for(int i = 0;i < n;i++)
      sol.push_back(k / 2 + 1);
    int x = (n) / 2;
    for(int i = 0;i < x;i++)
      sub1();
  }
  for(auto el : sol){
    cout << el << ' ';
  }
}



Measured memory_bytes: 3568
N = int(input())
x = input()

cnt_x = x.count("1")
px10 = 0
nx10 = 0
ans = [0] * (N+1)

for i in range(1, N+1): #Nまで先に出しておく
    popcnt = format(i,"b").count("1")
    fx = i % popcnt
    ans[i] = ans[fx] + 1

for i in range(N):
    px10 += (int(x[i]) * pow(2,N-1-i, cnt_x+1)) % (cnt_x+1)#0⇒1となった場合の合計
    if cnt_x != 0 and cnt_x != 1:
        nx10 += int(x[i])*pow(2,N-1-i,cnt_x-1) % (cnt_x-1)#1⇒0となった場合の合計
#print(px10)
#print(nx10)
for i in range(N):
    if x[i] == "0":
        xi10 = (px10+pow(2,N-1-i,cnt_x+1))%(cnt_x+1)
        print(ans[xi10]+1)
    else:
        if cnt_x != 1:
            xi10 = (nx10-pow(2,N-1-i,cnt_x-1))%(cnt_x-1)
            print(ans[xi10]+1)
        else:
            print(0)

Measured memory_bytes: 79408
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll int64_t
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

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; }


int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

ll dp[101][101010];
ll v[101],w[101];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,W;cin>>n>>W;
    REP(i,n) cin>>w[i]>>v[i];
    dp[0][0]=0;
    for(int i=0;i<n;i++){
        for(int sum_w=0;sum_w<=W;sum_w++){
            if(sum_w+w[i]<=W) chmax(dp[i+1][sum_w+w[i]],dp[i][sum_w]+v[i]);
            chmax(dp[i+1][sum_w],dp[i][sum_w]);
        }
    }
    cout<<dp[n][W]<<endl;
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
#define EPS                 0.00000001
#define LL_MAX              1e18
#define LL_MIN              -1e18
#define MAX                 0x3f3f3f3f
#define MIN                 -0x3f3f3f3f
#define MOD                 1000000007
#define DEBUG(x)            cout << '>' << #x << ':' << x << endl;
#define REP(i,n)            for(int i=0;i<(n);i++)
#define FOR(i,a,b)          for(int i=(a);i<=(b);i++)
#define FORD(i,a,b)         for(int i=(a);i>=(b);i--)
#define n1                  '\n'

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> pt;
typedef vector<pt> pol;

ll power(ll b, int e) {
    ll res = 1;
    for ( ; e>0; e/=2) {
        if (e&1) res = res*b % MOD;
        b = b*b % MOD;
    }
    return res;
}

inline void IOS() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

int n;

int main()
{
    IOS();
    cin >> n;
    vector<int> a(n), b(n), c(n);
    REP(i, n) {
        cin >> a[i] >> b[i] >> c[i];
    }
    int ret[n][3];
    ret[0][0] = a[0];
    ret[0][1] = b[0];
    ret[0][2] = c[0];
    FOR(i, 1, n-1) {
        ret[i][0] = max(ret[i-1][1] + a[i], ret[i-1][2] + a[i]);
        ret[i][1] = max(ret[i-1][0] + b[i], ret[i-1][2] + b[i]);
        ret[i][2] = max(ret[i-1][0] + c[i], ret[i-1][1] + c[i]);
    }
    cout << max(ret[n-1][0], max(ret[n-1][1], ret[n-1][2])) << n1;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
#define mod 1000000007
bool isPrime[1000001];
ll power(ll a,ll b)
{
    ll result = 1;
    while(b>0)
    {
        if(b%2)
        {
            result = (a*result)%mod;
        }
        a = (a*a)%mod;
        b = b/2;
    }
    return result;
}
int gcd(int a,int b)
{
    if(b==0)
    {
        return a;
    }
    return gcd(b,a%b);
}
void sieve()
{
    memset(isPrime,1,sizeof(isPrime));
    isPrime[0] = isPrime[1] = 0;
    for(int i=2;i*i<=1000000;i++)
    {
        if(isPrime[i])
        {
            for(int j=i*i;j<=1000000;j+=i)
            {
                isPrime[j] = 0;
            }
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);
    int t;
    t =1;
    for(int i=0;i<t;i++)
    {
        bool n;
        cin>>n;
        cout<<!n;
    }
    return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define each(it,v) for(auto &it : v)
#define all(v) (v).begin(),(v).end()
#define mod 1e9+7

using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using P = pair<int,int>;

main()
{
        int A,B,M; cin>>A>>B>>M;
        vi a(A),b(B);
        int am=100100,bm=100100;
        rep(i,A)
        {
                cin>>a[i];
                am=min(am,a[i]);
        }
        rep(i,B)
        {
                cin>>b[i];
                bm=min(bm,b[i]);
        }

        int ans=am+bm;

        rep(i,M)
        {
                int x,y,c;
                cin>>x>>y>>c;
                int d=a[x-1]+b[y-1]-c;
                ans=min(ans,d);
        }

        cout<<ans<<endl;

}


Measured memory_bytes: 1024
import java.util.Scanner;

/**
 * Created by kazuki on 2014/06/26.
 */
public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int m, yen10, yen50, yen100, yen500, sum, calc;
        int num10, num50, num100, num500;

        m = s.nextInt();
        while (true) {
            yen10 = s.nextInt();
            yen50 = s.nextInt();
            yen100 = s.nextInt();
            yen500 = s.nextInt();
            sum = yen10 * 10 + yen50 * 50 + yen100 * 100 + yen500 * 500;

            calc = sum - m;

            num500 = yen500 - calc / 500;
            calc = calc % 500;
            num100 = yen100 - calc / 100;
            calc = calc % 100;
            num50 = yen50 - calc / 50;
            calc = calc % 50;
            num10 = yen10 - calc / 10;


            if (num10 > 0) System.out.println("10 " + num10);
            if (num50 > 0) System.out.println("50 " + num50);
            if (num100 > 0) System.out.println("100 " + num100);
            if (num500 > 0) System.out.println("500 " + num500);

            m = s.nextInt();
            if(m==0) break;
            System.out.println();
        }
    }
}

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

int main() {
  int n, m, a, b;
  cin >> n >> m;
  int c[n];
  for (int i = 0; i < n; i++) {
    c[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    c[a - 1] += 1;
    c[b - 1] += 1;
  }

  for (int i = 0; i < n; i++) {
    cout << c[i] << endl;
  }
}


Measured memory_bytes: 256
import math
import sys
import bisect
readline = sys.stdin.readline


def main():
    s = readline().rstrip()
    print('Yes' if s == 'hi' or s == 'hihi' or s == 'hihihi'or s ==
          'hihihihi' or s == 'hihihihihi' else 'No')


if __name__ == '__main__':
    main()


Measured memory_bytes: 8948
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)

int main() {
	ll N;
	std::cin >> N;
	queue<string> q;
	q.push("");
	rep(i, 0, N) {
		queue<string> t;
		while (!q.empty()) {
			int c = -1;
			rep(j, 0, q.front().size()) {
				c = max(c, q.front()[j]-'a');
			}
			c++;
			repeq(j, 0, c) {
				t.push(q.front() + (char)('a' + j));
			}
			q.pop();
		}
		q = t;
	}
	while (!q.empty()) {
		std::cout << q.front() << endl;
		q.pop();
	}

	return 0;

}


Measured memory_bytes: 9892
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,lenmax=0,K,Ans=0;
#define V 2300010
int *tree[V];int ans[V];
int to[V][2];
char str[1<<20];
void Add(int &a,int b){a+=b;}
int main(){
	scanf("%d%d",&n,&K);
	for(int i=2;i<(1<<(n+1));++i){
		if(to[i>>1][0])to[i][0]=to[i>>1][0]*2+(i&1);
		else if(!(i&1))to[i][0]=1;
		if(to[i>>1][1])to[i][1]=to[i>>1][1]*2+(i&1);
		else if(i&1)to[i][1]=1;
	}
	tree[1]=new int[(1<<(n+1))];
	tree[1][0]=1;
	for(int i=0;i<=n;++i){
		scanf("%s",str);
		for(int j=0;j<(1<<i);++j)
			if(str[j]=='1')tree[1][j|(1<<i)]=1;
			else tree[1][j|(1<<i)]=0;
	}
	for(int i=0;i<=n;++i){
		if(i<n)
			for(int j=0;j<(1<<(i+1));++j){
				tree[j|(1<<(i+1))]=new int[1<<(n-i)];
			    memset(tree[j|(1<<(i+1))],0,sizeof(int)*(1<<(n-i)));
			}
		for(int j=(1<<i);j<(1<<(i+1));++j){
			for(int k=1;k<(1<<(n-i+1));++k){
				if(i<n&&to[k][0])Add(tree[j*2][to[k][0]],tree[j][k]);
				if(i<n&&to[k][1])Add(tree[j*2+1][to[k][1]],tree[j][k]);
				Add(ans[j],tree[j][k]);
			}
			if(ans[j]>=K&&lenmax<i)lenmax=i,Ans=j;
		}
	}
	for(int i=lenmax-1;i>=0;--i)
		if(Ans&(1<<i))printf("1");
		else printf("0");
	return 0;
}

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

#ifdef LOCAL_DEBUG
#include "bits/mytest.h"
#endif

using namespace std;


#pragma region user_defined
#define CLR(arr,val) fill(arr.begin(),arr.end(),val);
#define CLR0(arr)  CLR(arr,0)

#define d2clear(arr,data) for(int i =0;i<arr.size();i++){for(int j =0;j<arr[i].size();j++){arr[i][j]=data;}}
#define d2print(arr) for(int i =0;i<arr.size();i++){for(int j =0;j<arr[i].size();j++){cout<<arr[i][j];} cout<<endl;}
#define d2array(name,type,rows,cols,data) vector< vector<type>  > name(rows,vector<type>(cols,data))

#define forit(arr,it) for(auto it=arr.begin();it!=arr.end();it++)
#define rforit(arr,it) for(auto it=arr.rbegin();it!=arr.rend();it++)

#define LL long long
#define A(n) n.begin(),n.end()
#define maxn(a,b) ((a)=((a)>(b)?(a):(b)))
#define minn(a,b) ((a)=((a)<(b)?(a):(b)))

#define min(a,b)  ( (a)<(b)?(a):(b)   )
#define max(a,b)  ( (a)>(b)?(a):(b)  )
#define last(a)   a[a.size()-1]
#define first(a)  a[0]
#define println(a) cout<<a<<endl;
#define mp(a,b)  make_pair(a,b)
#pragma endregion

//#define MULTI_CASE
struct Solution{
	
	
	void solve(istream & cin = std::cin, ostream & cout = std::cout){
		int n, k; cin >> n >> k;
		LL ret = k;
		for (int i = 0; i < n-1; i++)
		{
			ret *= (k - 1);
		}
		cout << ret << endl;

	}

};


int main() {
#ifdef LOCAL_DEBUG 
 
	MyTest::Judge::JudgeNormal judge;
	MyTest::Config config;
	config.judge = &judge;
	MyTest::Test test(config);

	const string ITEM_NAME("B.cpp");
	const string FILE_NAME(__FILE__);
	auto it=FILE_NAME.find_last_of('\\');
	auto inputfile = FILE_NAME.substr(0, it + 1) + ITEM_NAME.substr(0, ITEM_NAME.find_last_of('.')) + "_input.txt";
	auto outputfile = FILE_NAME.substr(0, it + 1) + ITEM_NAME.substr(0, ITEM_NAME.find_last_of('.')) + "_output.txt";
	freopen(inputfile.c_str(), "r", stdin);
	//freopen(outputfile.c_str(), "w", stdout);
	
	while (test.ReadCaseInOneFile()) {
		test.Begin();
		Solution s;
		s.solve(test.Input(),test.Output());
		test.End();
	}
	test.DisplayInfo();
#else   //online judge
#ifdef MULTI_CASE 
	int t;cin>>t;
	while(t--){
		Solution s; 
		s.solve();
	}
#else
	Solution s;
	s.solve();
#endif
#endif
	

 
	return 0;
}

Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]
UD = []
last_idx = 0
for n in range(N-1):
    if A[n] < A[n+1]:
        UD.append('Up')
        last_idx = n
    else:
        UD.append('Down')
M = 1000
S = 0
for n in range(N-1):
    if UD[n] == 'Up':
        num = M//A[n]
        S += num
        M -= num*A[n]
    else:
        num = S*A[n]
        S = 0
        M += num
num = S*A[N-1]
S = 0
M += num
print(M)

Measured memory_bytes: 9216
#include<stdio.h>

int main(void){
  char enki;

  scanf("%s",&enki);

  switch(enki){
    case 84:printf("A\n");break;
    case 65:printf("T\n");break;
    case 67:printf("G\n");break;
    case 71:printf("C\n");break;
  }

  return 0;
}


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

int n, divided, minimum;

int main() {
  cin >> n;
  vector<int> a(n);
  rep (i, n) {
    cin >> a.at(i);
  }
  minimum = 31;
  rep (i, n) {
    divided = 0;
    while (a.at(i) % 2 == 0 && minimum > divided) {
      a.at(i) /= 2;
      divided++;
    }
    minimum = min(minimum, divided);
  }
  cout << minimum << endl;
  return 0;
}


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

use proconio::input;

fn main() {
    input! {
        N: usize,
        A: [u64; N],
    }

    let sum = A.iter().fold(0, |sum, i| sum ^ i);

    for a in A.iter() {
        print!("{} ", a ^ sum);
    }
}


Measured memory_bytes: 6276
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
#define ull unsigned long long
#define ld long double
#define uint unsigned int
struct debug {
~debug() {cerr << "\n";}template<class C> debug& operator<<(C c) {cerr << c;return *this;}
};
#define var(x) " [" << #x << ": " << x << "]"

string s;

void solve() {
    cin >> s;
    if(s[s.length()-1]!='s') {
        cout << s << "s\n";
        return;
    }
    cout << s << "es\n";
}

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

    solve();
    return 0;
}

Measured memory_bytes: 3660
import math

P = [2]
for k in range(3,1400):
    f = 1
    for l in range(2,int(math.sqrt(k))+1):
        if k % l == 0:
            f = 0
            break
    if f==1:
        P.append(k)

Q = []
for p in P:
    if p%5 == 1:
        Q.append(p)

print(" ".join(map(str,Q[:int(input())])))

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

int main() {
  int N, A;
  cin >> N >> A;
  if (N%1000 >= 500) {
    if (N%1000 - 500 <= A)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  else if (N%1000 < 500) {
    if (N%1000 <= A)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
      

Measured memory_bytes: 256
import sys

words = input().split()
word_cnts = list(map(int, input().split()))

word_map = dict()
for word, word_cnt in zip(words, word_cnts):
    word_map[word] = word_cnt

bad_word = input()
word_map[bad_word] -= 1

for idx, word in enumerate(words):
    sys.stdout.write(str(word_map[word]))
    if idx == len(words)-1:
        sys.stdout.write('\n')
    else:
        sys.stdout.write(' ')


Measured memory_bytes: 3060
s=input()
if s[0]==s[1]==s[2]==s[3]:
        print('No')
elif s[0]==s[1] and s[2]==s[3]:
        print('Yes')
elif s[0]==s[2] and s[1]==s[3]:
        print('Yes')
elif s[0]==s[3] and s[1]==s[2]:
        print('Yes')
else:
        print('No')

Measured memory_bytes: 3060
/*

	@Raghul
*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ll a,b,k;
	cin>>a>>b>>k;
	for(int i=0;i<k;i++){
		if(i%2==0){
			b+=a/2;
			a=a/2;
		}
		else{
			a+=b/2;
			b=b/2;
		}
	}
	cout<<a<<" "<<b;
	return 0;
}



Measured memory_bytes: 256
k = int(input())

row = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(row[k-1])

Measured memory_bytes: 38384
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	string str;
	int gozen,gogo;
	while(cin>>str>>gozen>>gogo){
		cout<<str<<" "<<gozen+gogo<<" "<<gozen*200+gogo*300<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
/* Author: Jason L.(int3xccATgmailDOTcom), Fri May  4 23:07:03 CST 2018 */
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using pll = pair<ll, ll>; using dd = long double;
//=========================================================================
namespace {
static bool constexpr dbg =
#ifdef INT3XCC_DEBUG
        1;
#else
        0;
#endif
#define Dprintf(fmt, ...) do{if(dbg) printf(fmt, ##__VA_ARGS__);}while(0)
#define Ddump(expr) do{if(dbg) cout<<#expr<<" = "<<expr<<'\n';}while(0)
#define REP0(i, n) for (ll i = 0, ii_ = (n); i <  ii_; ++i)
#define REP1(i, n) for (ll i = 1, ii_ = (n); i <= ii_; ++i)
//=========================================================================
ll constexpr N = -999;
ll n, a, b, c, x, y;
//=========================================================================
void init() {
    cin>>a>>b>>c>>x>>y;
}
void solve() {
    n = LONG_LONG_MAX;
    for (ll i = 0; i <= max(x, y); ++i) {
        ll rx = max(0ll, x-i), ry = max(0ll, y-i);
        n = min(n, a*rx+b*ry+2*c*i);
    }
    cout<<n<<'\n';
}}
//=========================================================================
int main() {
    if (!dbg) { std::ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
    cout<<fixed<<setprecision(20); init(); solve(); return 0;
}


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

int main() {
  string S;
  cin >> S;
  bool A = true;
  for(int i = 0;i < 26;i++) {
    int count = 0;
    for(int j = 0;j < S.size();j++) {
      if(S.at(j) == 'a' + i) {
        count++;
      }
    }
    if(count > 1) {
      A = false;
      break;
    }
  }
  if(A == true) {
    cout << "yes" << endl;
  }
  else {
    cout << "no" << endl;
  }
}


Measured memory_bytes: 256
S = []
ID = 0
K = 10
res = 0
5.times do |n|
    N = gets.chomp.to_i
    S.push(N)
    if N % 10 != 0 && K > N % 10 then
        K = N % 10
        ID = n
    end
end
5.times do |n|
    if ID == n || S[n]%10==0
        res += S[n] 
    else
        res += (S[n] / 10 + 1)*10
    end
    
end
puts res

Measured memory_bytes: 1788
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 2147483600

int h,w,k;
vector<string> vec;
vector<string> crnt;

int search(int itr){
  int ret=0;
  // 消せるとこを0で埋めながら加点
  bool changed=false;
  rep(i,h){
    rep(j,w-1){
      if(crnt[i][j]==0) continue;
      int d=0;
      while(j+d<w && crnt[i][j] == crnt[i][j+d]) d++;
      if(d>=k){
        ret += (1<<itr)*(crnt[i][j]-'0')*d;
        rep(dd,d) crnt[i][j+dd]=0;
        changed=true;
      }
      j += d-1;
    }
  }

  if(!changed) return ret;

  // -1をつめる
  rep(j,w){
    int s=h-1;
    for(int hh=h-1; hh>=0; hh--){
      while( s>=0 && crnt[s][j]==0) s--;
      if(s<0) crnt[hh][j]=0;
      else crnt[hh][j] = crnt[s][j];
      s--;
    }
  }
  return ret + search(itr+1);
}

int main(){
  cin>>h>>w>>k;
  vec.resize(h);
  rep(i,h) cin>>vec[i];

  int res=0;
  rep(i,h) rep(j,w){
    crnt = vector<string>(vec);
    for(int ii=i; ii>0; ii--) crnt[ii][j] = crnt[ii-1][j];
    crnt[0][j] = 0;
    res = max(res, search(0)); //dbg(res);
  }

  cout<<res<<endl;

  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

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

int main(int argc, char* argv[]) {
	string s;
	cin >> s;
	for (int i = 0; i < 3; i++) {
		if (s[i] == '7') {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;
	
}

Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>

using namespace std;
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const long long INF = 1LL << 60;

int MOD = 1000000007;

int main(){
    std::ios_base::sync_with_stdio(false);

    ll n; ll x; cin >> n >> x;
    std::vector<ll> a(n); rep(i,n) cin >> a[i];

    ll ans=0LL;

    for(int i=1; i<n; ++i){
        if(a[i]+a[i-1] > x){
            if((a[i]+a[i-1])-x<=a[i]){
                ans+=a[i-1]+a[i]-x; a[i] = a[i]-(a[i-1]+a[i]-x);
            } else {
                ans+=a[i]+a[i-1]-x;
                a[i-1]=x;
                a[i] = 0LL;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <string>
#include <climits>
#include <set>
#include <algorithm>
using namespace std;

int main()
{
	string s, t;
	cin >> s >> t;
	int cnt = 0;

	for (int i = 0; i < s.length(); i++)
		if (s[i] != t[i])
			cnt++;

	cout << cnt;
}

Measured memory_bytes: 3920
#include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int n,m,p;
	while(1){
		cin>>n>>m>>p;
		if(!n && !m && !p)break;
		int dt[n];
		int sum=0;
		rep(i,n){
			cin>>dt[i];
			sum+=dt[i];
		}
		sum*=(100-p);
		if(dt[m-1]!=0)cout<<sum/dt[m-1]<<endl;
		else cout<<0<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
int main(){
	int w,a,b;
	scanf("%d %d %d",&w,&a,&b);
	if((a+w)<b)
		printf("%d\n",b-a-w);
	else if((b+w)<a)
		printf("%d\n",a-b-w);
	else
		printf("0\n");
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
double x,y,t;
main()
{
    int n;
    while(cin>>n,n>0)
    {
        x=y=1;
        t=0;
        for(int i=1;i<n;i++)t+=atan2(1,sqrt(i));
        cout<<fixed<<setprecision(9)<<sqrt(n)*cos(t)<<endl<<sqrt(n)*sin(t)<<endl;
    }
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

string s;
ll simulate(ll pos,  vector<pair<char,char>> vp){
    rep(i,vp.size()){
        if(s[pos]!=vp[i].fi)continue;
        if(vp[i].se=='L'){
            pos--;
        }else{
            pos++;
        }
        if(pos<0)return -1;
        if(pos>=s.size())return 1;
    }
    return 0;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n,q;
    cin>>n>>q;
    cin>>s;
    vector<pair<char,char>> vp(q);
    rep(i,q){
        cin>>vp[i].fi>>vp[i].se;
    }
    ll ans=0;

    ll lfall = 0;
    ll rfall = 0;

    ll L=-1,R=n;
    while(L+1<R){
        ll c = (L+R)/2;
        bool ok = [&]{
            return simulate(c,vp)==-1;
        }();
        if(ok){
            L = c;
        }else{
            R = c;
        }
    }
    lfall = L;

    L=-1,R=n;
    while(L+1<R){
        ll c = (L+R)/2;
        bool ok = [&]{
            return simulate(c,vp)==1;
        }();
        if(ok){
            R = c;
        }else{
            L = c;
        }
    }
    rfall = R;

    lfall =(lfall+1);
    rfall = (n-rfall);
    cout<<n-lfall-rfall<<endl;
    return  0;
}


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

using namespace std;

void solve()
{
	long H, W, N;
	cin >> H >> W >> N;
	map<long, int> cnt;
	while(N--)
	{
		long h, w;
		cin >> h >> w;
		for (int i = 0; i < 3; i++)
			for (int j = 0; j < 3; j++)
		{
			long y = h - i - 1, x = w - j - 1;
			if (0 <= x && x + 2 < W && 0 <= y && y + 2 < H)
			{
				cnt[y*W+x]++;
			}
		}
	}
	vector<long> ans(10);
	for (auto p : cnt)
	{
		ans[p.second]++;
	}
	ans[0] = (H-2)*(W-2);
	for (int i = 1; i < 10; i++) ans[0] -= ans[i];
	for (long a : ans)
	{
		cout << a << endl;
	}
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 56448
#include <stdio.h>


int main(void)
{
	int n;
	int a, b;

	scanf("%d", &n);

	if (n == 1){
		printf("Hello World\n");
	}
	else if(n==2){
		scanf("%d", &a);
		scanf("%d", &b);
		printf("%d\n", a + b);
	}


	return 0;
}



Measured memory_bytes: 128
// Created by  Ambesh kumar
#include "bits/stdc++.h"

//I already compile this file in my computer system to save the time
//if get the compiler error then you should change this header to
// #include "bits/stdc++.h"  ---> #include <bits/stdc++.h>

using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0, lim - 1);
	return uid(rang);
}
int mpow(int base, int exp);
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1000000007;
const int N = 3e5, M = N;
//=================================================================================================================================//

vi g[N];
int a[N];

void solve() {
	ll i, j, l, r, d;
	cin >> l >> r >> d;
	ll count = 0;

	for (i = l; i <= r; i++)
	{

		//deb(i);
		if (i % d == 0)
			count++;

	}

	cout << count << '\n' ;
}







int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());

	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}

	return 0;
}







Measured memory_bytes: 10648
import sys

def main():
    input = sys.stdin.readline
    N, K = map(int, input().split())

    ans = 0
    for i in range(1, N+1):
        if i >= K:
            ans += 1 / N
        else:
            cnt = 1
            while i * 2**cnt < K:
                cnt += 1

            ans += 1 / N * (0.5)**cnt

    return ans


if __name__ == '__main__':
    print(main())


Measured memory_bytes: 39356
import java.util.*;


public class Main {
	
	Scanner cin = new Scanner(System.in);

	public static void main(String[] args) {
		new Main().run(); 
	}
	
	public void run() {
		
		
		
		long A = cin.nextLong();
	
		long end = cin.nextLong();
		
		long X = cin.nextLong();
		
		long r = A % X;
		long start = A + (r == 0? 0: X - r);
		
		
		long res = 0;
		long sum = X;
		long mult = 1;
		
		if (start <= end) {
			res = 1;
		}
		
		
		while (start <= end) {
			
			if (start + sum <= end) {
				start += sum;				
				res   += mult;
				
				sum  += sum;
				mult += mult;
			} else {
				sum = X;
				mult = 1;
				
				if (start + sum > end) {
					break;
				}
				
				start += sum;
				res   += mult;
				
			}
			
		}
		
		
		
		System.out.println(res);
	}
	
	 
}



Measured memory_bytes: 23764
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v, yes="Yes", no="No", upper=False):
    if upper:
        print([yes.upper(), no.upper()][not v])
    else:
        print([yes, no][not v])


def main():
    """エントリーポイント"""
    N, S = input(int, str)
    ans = 0
    for x in range(N - 2):
        if S[x:x + 3] == "ABC":
            ans += 1
    print(ans)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()


Measured memory_bytes: 3316
N = int(input())
L = []
H = []
for _ in range(N):
    a, b = map(int, input().split())
    L.append(a)
    H.append(b)
L.sort()
H.sort()

if N % 2 == 0:
    h = H[N // 2 - 1] + H[N // 2]
    l = L[N // 2 - 1] + L[N // 2]
    ans = h - l + 1
else:
    h = H[N//2]
    l = L[N//2]
    ans = h - l + 1

print(ans)

Measured memory_bytes: 98960
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define MOD (1000000007)
#define DEBUG false
using namespace std;

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef pair< ll, int > pli;
typedef pair< int, ll > pil;
typedef pair< int, bool > pib;

int ceil(int x, int y){
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y){
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y){
  return x / gcd(x, y) * y;
}

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

  int n;
  cin >> n;
  int a[n], b[n];
  for(int i = 0; i < n; i++) cin >> a[i];
  for(int i = 0; i < n; i++) cin >> b[i];

  vector< pib > c(2 * n);
  for(int i = 0; i < n; i++){
    c[i] = make_pair(a[i], true);
  }
  for(int i = 0; i < n; i++){
    c[i + n] = make_pair(b[i], false);
  }
  sort(c.begin(), c.end());

  ll sum = 1;
  int j = 0, k = 0;
  for(int i = 0; i < 2 * n; i++){
    if(c[i].second){
      ++j;
      if(k > 0){
        sum = (sum * k) % MOD;
        --k; --j;
      }
    }
    else{
      ++k;
      if(j > 0){
        sum = (sum * j) % MOD;
        --j; --k;
      }
    }
  }

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cstring>
#include <string>
#include <stack>

using namespace std;
typedef long long ll;

int main()
{
    vector<string> havingSetOfCards(3);
    cin >> havingSetOfCards[0] >> havingSetOfCards[1] >> havingSetOfCards[2];
    vector<int> cur(3, 0);
    int cur_player = 0;
    while (true)
    {
        if (cur[cur_player] == havingSetOfCards[cur_player].size()) break;
        int next_player = havingSetOfCards[cur_player][cur[cur_player]] - 'a';
        cur[cur_player]++;
        cur_player = next_player;
    }
    cout << char('A' + cur_player) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int n;
    scanf("%d", &n);

    int max = 0;
    for (int i = 0; i <= n; ++i) {
        if (i*i > n) {
            break;
        }
        max = i*i;
    }
    printf("%d\n", max);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef set<int> si;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
#define per(i,a,b) for(int i=(b)-1; i>=(a); --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int INF = 987654321;
const ll MOD = 1000000007LL;

ll ipow(ll base, ll exp)
{
    ll result = 1LL;
    for (;;)
    {
        if (exp & 1)
            result *= base;
        exp >>= 1;
        if (!exp)
            break;
        base *= base;
    }

    return result;
}

struct DisjointSet {
    vector<int> parent, rank, size;
    DisjointSet(int n) : parent(n), rank(n, 1), size(n, 1) {
        for(int i = 0; i < n; ++i) 
            parent[i] = i;
    }

    int find(int u) {
        if(u == parent[u]) return u;
        return parent[u] = find(parent[u]);
    }

    void merge(int u, int v) {
        u = find(u); v = find(v);
        if(u == v) return;
        if(rank[u] > rank[v]) swap(u, v);
        parent[u] = v;
        if(rank[u] == rank[v]) ++rank[v];
        size[v] += size[u];
    }
};

int gcd(int a, int b) {
    if(b == 0) return a;
    return gcd(b, a%b);
}
//const long double PI = (acos(-1));
//const long double EPS = 0.0000000001;

int n;
vi cnt;

void cntAdd(int k) {
    if(k%2 == 0) {
        while(k%2 == 0) {
            cnt[2]++;
            k /= 2;
        }
    }
    for(int p = 3; p * p <= k; p += 2) {
        if(k % p == 0) {
            while(k % p == 0) {
                cnt[p]++;
                k /= p;
            }
        }
    }
    if(k > 1) {
        cnt[k]++;
    }
}

int cntGet(int k) {
    int ret = 0;
    rep(i,2,n+1) {
        if(cnt[i] + 1 >= k) {
            ret++;
        }
    }
    return ret;
}

int main(void) {
    ios_base::sync_with_stdio(false); 
    cin.tie(0); 
    cout.tie(0);
    //freopen("in.txt", "r", stdin);
    cin >> n;
    cnt.resize(n+1);
    rep(i,2,n+1) {
        cntAdd(i);
    }
    int ret = 0;
    ret += cntGet(75);
    ret += cntGet(25) * (cntGet(3)-1);
    ret += cntGet(15) * (cntGet(5)-1);
    ret += (cntGet(5) * (cntGet(5)-1) / 2) * (cntGet(3)-2);
    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 256
#D問題
import math
S = list(str(input()))
N = len(S)

count = 0
n = math.ceil(N/2)
for i in range(N):
    if i < n:
        if S[i] == "p":
            count-=1
    else:
        if S[i] == "g":
            count+=1
            
print(count)

Measured memory_bytes: 3956
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

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

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};


void solve(){
    ll a,b,c;
    cin>>a>>b>>c;
    if(a<=c&&c<=a+b) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    

}



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    solve();

    return 0;
}


Measured memory_bytes: 256
/*

    creator : s@if

*/

#include<bits/stdc++.h>
using namespace std;
#define INF 99999999
#define ll long long
#define PII pair<int,int>

int main()
{
    int n,i,j,k,l;

    cin>>n;

    int ara[n+9];

    for(i=0;i<n;i++)
        cin>>ara[i];

    sort(ara,ara+n);

    k=0;
    for(i=0;i<n-1;i++)
        k+=ara[i];

    l=ara[n-1];

    if(l<k)
        cout<<"Yes\n";
    else
        cout<<"No\n";

  //  main();
    return 0;
}


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

#define ll long long
#define d long double

#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define dscf(n) scanf("%Lf",&n)
#define pri(n) printf("%d ",(int)n)
#define lpri(n) printf("%lld ",n)
#define dpri(n) printf("%Lf ",n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define dprin(n) printf("%Lf\n",n)

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i,ini,n) for(ll i=ini;i<(int)n;i++)
#define all(x) x.begin(),x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define bitcount(n) __builtin_popcount(n)
#define tc   int tt; scf(tt); while(tt--)
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define PI 3.14159265358979323846264

const ll M =1e9+7;
const int N = 1e6+7;

int n,m;
vector<int>adj[N];
int ans=ninf;
bool visited[N];
int coun;

void dfs(int x)
{
    coun++;
    visited[x]=true;
    for(auto it: adj[x])
    if(!visited[it])
    dfs(it);
}
int main()
{
    scf(n);scf(m);
    while(m--)
    {
        int a,b;
        scf(a);scf(b);
        adj[a].pb(b);
        adj[b].pb(a);
    }

    rep(i,1,n+1)
    {
        if(!visited[i])
        {   
            coun=0;
            dfs(i);
            ans=max(ans,coun);
        }
    }
    pri(ans);
return 0;
}

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

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

char ver[10][10], hol[10][10];
const int dx[] = {-1,0,1,0};
const int dy[] = {0,1,0,-1};
const char dir[] = {'U','R','D','L'};

void input() {
  scanf("%s", hol[1]+1);
  rep(i,4) {
    scanf("%s", ver[i+1]+1);
    scanf("%s", hol[i+2]+1);
  }
  rep(i,8) rep(j,8) {
    if (hol[i][j] == '1') hol[i][j] = 1;
    else hol[i][j] = 0;
    if (ver[i][j] == '1') ver[i][j] = 1;
    else ver[i][j] = 0;
  }
  // rep(i,8) {
  //   putchar(' ');
  //   rep(j,8) printf("%2d", hol[i][j]); puts("");
  //   rep(j,8) printf("%2d", ver[i][j]); puts("");
  // }
}

bool is_end(int x, int y, int d) {
  return (x == 0 && y == 1 && d == 0) ||
      (x == 1 && y == 1 && d == 3);
}

void update(int &x, int &y, int &d) {
  const int bx = x, by = y, bd = d;
  switch (d) {
    case 0: {
      if (hol[y][x]) d = 3;
      else if (ver[y-1][x+1]) --y;
      else if (hol[y][x+1]) { ++x; --y; d = 1; }
      else { d = 2; ++x; }
      break;
    }
    case 1: {
      if (ver[y][x+1]) d = 0;
      else if (hol[y+1][x+1]) ++x;
      else if (ver[y+1][x+1]) { ++x; ++y; d = 2; }
      else { d = 3; ++y; }
      break;
    }
    case 2: {
      if (hol[y+1][x]) d = 1;
      else if (ver[y+1][x]) ++y;
      else if (hol[y+1][x-1]) { --x; ++y; d = 3; }
      else { d = 0; --x; }
      break;
    }
    case 3: {
      if (ver[y][x]) d = 2;
      else if (hol[y][x-1]) --x;
      else if (ver[y-1][x]) { --x; --y; d = 0; }
      else { d = 1; --y; }
      break;
    }
  }
  if (bx == x && by == y && bd == d) {
    printf("%d %d %d\n", x, y, d);
    assert(false);
  }
}

void solve() {
  int x = 1, y = 0, d = 1;
  string ans = "R";
  do {
    // printf("%d,%d - %d : %s\n", x, y, d, ans.c_str());
    update(x, y, d);
    ans += dir[d];
  } while (!is_end(x,y,d));
  printf("%s\n", ans.c_str());
}

int main() {
  input();
  solve();
  return 0;
}

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

bool chmin(long long &a, long long b){
  if(a > b){
    a = b;
    return true;
  }
  return false;
}

const long long INF = 1LL << 60;

int main() {
  int n, k;
  cin >> n >> k;
  
  vector<int> h(1000000);
  for(int i = 0; i < n; i++) cin >> h.at(i);
  
  vector<long long> dp(1000000, INF);
  dp.at(0) = 0;
  for(int i = 0; i < n; i++){
    for(int j = 1; j <= k; j++){
      chmin(dp.at(i + j), dp.at(i) + abs(h.at(i) - h.at(i + j)));
    }
  }
  
  cout << dp.at(n - 1) << endl;
    
}

Measured memory_bytes: 12032
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var N = Sarray()[0];
            var ans = 1L;
            for (var i = 0; i < N; ++i)
                ans = Lcm(ans, Sarray()[0]);
            WriteLine(ans);
        }
        static long Gcd(long x, long y) => y == 0 ? x : Gcd(y, x % y);
        static long Lcm(long x, long y) => x / Gcd(x, y) * y;
        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 28228
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] str = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);
		String[] datas = br.readLine().split(" ");

		int[] arr = new int[datas.length];
		for (int i = 0; i < datas.length; i++) {
			arr[i] = Integer.parseInt(datas[i]);
		}
		int min = Integer.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			int l = i;
			int r = i + k - 1;
			if (r == n) {
				break;
			}
			min = Math.min(min, Math.abs(arr[r] - arr[l]) + Math.min(Math.abs(arr[r]), Math.abs(arr[l])));
		}
		System.out.println(min);
	}
}

Measured memory_bytes: 38424