akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;





int main(){

	ll N;
	scanf("%lld",&N);


	vector<ll> V;
	V.push_back(N);
	if(N > 2){
		V.push_back(N-1);
	}


	for(ll i = 2; i*i <= N; i++){

		if(N%i == 0){

			ll tmp = N;
			while(tmp%i == 0){

				tmp /= i;
			}

			if(tmp%i == 1){

				V.push_back(i);
			}

			ll a = N/i;

			tmp = N;
			while(tmp%a == 0){

				tmp /= a;
			}
			if(tmp%a == 1){

				V.push_back(a);
			}

		}else if((N-1)%i == 0){

			V.push_back(i);
			V.push_back((N-1)/i);
		}
	}

	sort(V.begin(),V.end());
	V.erase(unique(V.begin(),V.end()),V.end());

	printf("%lld\n",V.size());

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
int main(){
	int h,r;cin>>h>>r;
	if(h<-r){
		cout<<-1<<endl;
	}else if(-r==h){
		cout<<0<<endl;
	}else{
		cout<<1<<endl;
	}
}



Measured memory_bytes: 3108
#include<bits/stdc++.h>
#include<limits>
#define ll long long
#define F first
#define S second
#define pb push_back
#define oo 1e18
#define endl '\n'
#define si size()
#define all(v) v.begin(),v.end()
#define FASTIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define Matrix vector< vector < long long > >
#define vi vector<int>
#define vll vector<ll>
#define vd vector<double>
#define vs vector<string>

using namespace std;

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

const long double Pi=acos(-1),e=2.718,ebs=0.00000000001;
const int N=1e7+10,mod=1e9+7,SEED = 1331,B=40;

int main ()
{
    FASTIO
    string s;
    cin >> s;
    cout << s[0] << s[1] << s[2] << endl;
    return 0;

}
/**

*/


Measured memory_bytes: 3648
N = int(input())
H = list(map(int, input().split(" ")))

ans = "Yes"
for i in range(N - 1):
    if (H[i + 1]) >= (H[i]):
        continue
    elif (H[i + 1]+1) == (H[i]):
        H[i + 1] += 1
    else:
        ans = "No"
        break

print(ans)

Measured memory_bytes: 14252
#include <bits/stdc++.h>
#define ALL(v) (v).begin(), (v).end()
#define INF 1e9
#define pb push_back
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
using pil = pair<ll, ll>;
template<class T>using numr=std::numeric_limits<T>;
#define MOD 1000000007
#define MOD2 998244353
const double PI=3.14159265358979323846;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int r;
    cin >> r;
    cout << 2*r*PI <<endl;
}

Measured memory_bytes: 3804
#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    
    int n,a[111];
    cin>>n;
    double ave=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        ave+=a[i];
    }
    ave/=(double)n;
    
    int ans;
    double min=22222222;
    for(int i=0;i<n;i++){
        double de=abs(ave-a[i]);
        if(min>de){
            min=de;
            ans=i;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
N=int(input())
h=list(map(int,input().split()))
ans=[0]*(N)
ans[0]=0
ans[1]=abs(h[1]-h[0])
if N>2 :
 for i in range(2,N):
  ans[i]=min(ans[i-2]+abs(h[i]-h[i-2]),ans[i-1]+abs(h[i]-h[i-1]))
print(ans[N-1])


Measured memory_bytes: 13928
// https://leetcode.com/problems/count-complete-tree-nodes/

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

#define forn(i, n) for (int i=0; i < (int)n; i++)
#define fora(x, arr) for(auto& x:arr)
using matrix = std::vector<vector<int>>;
using ll = long long;


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

	ll a, b; cin >> a >> b;
	ll m;
	if (a > b) 
		m = a;
	else 
		m = b;

	ll x = abs(a-b);
	ll z = x >> 1;

	for (ll i = z; i <= (x+m); i++) {

		if (abs(a-i) == abs(b-i)) {
			cout << i;
			return 0;
		}

	}

	cout << "IMPOSSIBLE";
    return 0;
}

Measured memory_bytes: 3568
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <set>
#include <queue>
using namespace std;

#define PI 3.14159265358979323846264338327950L

long long int res = 100000000000;

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

    int N;
    cin >> N;
    int X[110];
    if(N==0){
        cout << 0 << endl;
        return 0;
    }
    for (int i = 0; i < N;i++){
        cin >> X[i];
    }
    sort(X, X + N);
    for (int i = X[0]; i <= X[N-1];i++){
        int power = 0;
        for (int j = 0; j < N; j++)
        {
            power += (X[j] - i) * (X[j] - i);
            //cout << power << endl;
        }
        if(power<res){
            res = power;
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){

int a,b,sum,mult,subtr;
cin >> a >>b;
sum = a+b;
mult=a*b;
subtr = a-b;

if (sum >=mult && sum>=subtr)cout <<sum;
else if(mult>=sum && mult>=subtr)cout << mult;
else if(subtr>=sum && subtr>=mult) cout << subtr;
return 0;  
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int X = sc.nextInt();

    sc.close();

    int max = 1;

    for (int i = 1; i < X; i++) {

      for (int j = 2; j < X; j++) {
        double k = Math.pow(i, j);
        if ((int)k <= X) {
          max = Math.max(max, (int)k);
        } else {
          break;
        }
      }

    }
    
    System.out.println(max);
    
  }

}

Measured memory_bytes: 21844
import java.io.*
import java.util.*

fun solve(A: Long, B: Long){
    if (A <= 9L && B <= 9L) println (A*B)
    else println(-1)
    return
}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val A = sc.next().toLong()
    val B = sc.next().toLong()
    solve(A, B)
}



Measured memory_bytes: 31396
#include <bits/stdc++.h>
#include <atcoder/all>
#define repl(i, l, r) for (int i = l; i < r; ++i)
#define rep(i, n) repl(i, 0, n)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using G = vector<vector<int>>;
using mint = modint998244353;
const int MOD = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001001001001001001;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};

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

const int MAX_A = 300005;

int op(int a, int b) { return max(a, b);}

int e() { return 0;}

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	segtree<int, op, e> dp(MAX_A);
	rep(i, n) {
		int x = a[i];
		int l = x - k;
		int r = x + k + 1;
		l = max(l, 0);
		r = min(r, MAX_A);
		int now = dp.prod(l, r) + 1;
		dp.set(x, now);
	}
	int ans = dp.prod(0, MAX_A);
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 9624
#include <iostream>
#include <bits/stdc++.h>
#define int long long
using namespace std;

vector<int> tree[100001];
int dp[100001][2];

int solve(int u, int constraint, int pr)
{
    if(dp[u][constraint] != -1){
        return dp[u][constraint];
    }
    int ans = 0;
    int w1 = 1;
    for(int child:tree[u]){
        if(child != pr){
            w1 = (w1*solve(child,0,u))%1000000007;
        }
    }
    ans = ans+w1;
    if(!constraint){
        int w2 = 1;
        for(int child:tree[u]){
            if(child!=pr){
                w2 = (w2*solve(child,1,u))%1000000007;
            }
        }
        ans = (ans+w2)%1000000007;
    }
    return dp[u][constraint] = ans;

}
int32_t main() {
    int n;cin>>n;
    for(int i = 1;i<n;i++){
        int u,v;cin>>u>>v;
        tree[u].push_back(v);
        tree[v].push_back(u);
    }
    memset(dp,-1,sizeof dp);
    cout<<solve(1,0,-1);


    
}


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

#define REP(i, n) for(int i = 0; i < n; i++)


char s[100000];
int len;

bool check(int i) {
  if(i + 1 < len && s[i] == s[i + 1]) {
    cout << (i + 1) << " " << (i + 2) << endl;
    return true;
  }

  if(i + 2 < len && s[i] == s[i + 2]) {
    cout << (i + 1) << " " << (i + 3) << endl;
    return true;
  }

  return false;
}

int main(void) {
  cin >> s;
  len = strlen(s);

  REP(i, len) {
    if(check(i)) {
      return 0;
    }
  }

  cout << "-1 -1" << endl;

  return 0;
}


Measured memory_bytes: 384
from bisect import bisect_left, bisect_right

n = int(input())
a = sorted(map(int, input().split()))
b = sorted(map(int, input().split()))
c = sorted(map(int, input().split()))
ans = 0
def bin_search(x, n, flag):
    if flag == True:
        return bisect_left(x, n)
    else:
        return bisect_right(x, n)



for i in range(n):
    ans += bin_search(a, b[i], True) * (n - bin_search(c, b[i], False))

print(ans)

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define RREP0(i, n) for (int i = (n)-1; i >= 0; --i)
#define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define RREP1(i, n) for (int i = (n); i >= 1; --i)
#define pow10(n) int(1e##n + n)

typedef long long LL;
typedef pair<int, int> P;

const int INTINF = int(1e9) + 1;
const LL LLINF = LL(1e18) + 1;
long double eps = 1.0E-14;

void solve()
{
    int K, A, B;
    cin >> K >> A >> B;

    for (int i = 0; i <= B; i += K)
    {
        if (i >= A)
        {
            std::cout << "OK" << endl;
            return;
        }
    }
    std::cout << "NG" << endl;
    return;
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(20);
    solve();
    return 0;
}


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


using namespace std;
#define ll  long long
#define ld  long double
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll mod = 1e9 + 7;
const double PI = 3.141592653589793238463;
const int MAXN = 2e5 + 5;
bool isPrime[MAXN];



ll fastPow(ll x, ll b)
{
    if (b == 0)
        return 1;
    else if (!(b & 1))
    {
        return fastPow(x * x, b / 2);
    }
    else
        return x * fastPow(x * x, (b - 1) / 2);
}

//__builtin_popcount ();
bool isPrim(int n)
{
    if (n == 1 || n == 0)
        return false;
    for (int i = 2; i * i <= n; i++)
    {
        if (n % i == 0)
            return false;
    }
    return true;
}



int main()
{
    FAST

    int n;
    cin>>n;
    int arr[n+1];
    for(int i=1;i<=n;i++)
        cin>>arr[i];
    int pt=1;
    int ans=0;
   int c=0;
while(true)
{
    if(pt==2)
        return cout<<c,0;
    if(c>=n)
        return cout<<"-1\n",0;
    c++;
    pt=arr[pt];
}

    return 0;
}


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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
 
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
 
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
 
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};


void solve(long long N, long long K){
    if(K == 0) {
        cout << N * N << endl;
        return;
    }

    LL ans = 0;
    REP1(i, N+1) {
        if(K <= i-1) {
            ans += N / i * (i - K);
            ans += ((N % i) - K + 1 >= 0 ? (N % i) - K + 1 : 0);
        }
    }

    cout << ans << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    solve(N, K);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double PI = 3.141592653589;
double ans;

int main(){
  double a, b, x;
  cin >> a >> b >> x;
  if(x > a*a*b/2){
    ans = atanl((2/a)*(b - x/(a*a)));
  }else{
    ans = atanl(a*b*b/(2*x));
  }
  ans = ans * 180 / PI;
  printf("%2.10lf\n", ans);
}

Measured memory_bytes: 512
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.IntStream;
import java.io.*;
//import java.util.stream.IntStream;



public class Main {


    public static void main(String args[]) {
        //Scanner sc = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            int[] arr = Arrays.stream(br.readLine().split(" "))
                                .mapToInt(Integer::parseInt)
                                .toArray();
            int n = arr[0];
            int m = arr[1];

            Map<Integer, List<Integer>> link = new HashMap<>();
            for(int i=0;i<n;i++){
                link.put(i, new ArrayList<>());
            }
            int[] colors = new int[n];

            for(int i=0;i<m;i++){
                int[] tmp = Arrays.stream(br.readLine().split(" "))
                                    .mapToInt(Integer::parseInt)
                                    .toArray();
                link.get(tmp[0]).add(tmp[1]);
                link.get(tmp[1]).add(tmp[0]);
            }

            int color = 1;
            for(int i=0;i<n;i++){
                if(colors[i] == 0){
                    dfs(i, colors, link, color++);
                }
            }
        
            int q = Integer.parseInt(br.readLine());
            for(int i=0;i<q;i++){
                int[] tmp = Arrays.stream(br.readLine().split(" "))
                                    .mapToInt(Integer::parseInt)
                                    .toArray();
                
                    System.out.println(colors[tmp[0]] == colors[tmp[1]] ? "yes" : "no");
                
            }


        } catch (IOException e){e.printStackTrace();}

    }


    public static void dfs(int start, int[] colors, Map<Integer, List<Integer>> link, int color){
        Stack<Integer> stack = new Stack<>();
        stack.push(start);
        
        while(!stack.empty()){
            int cur = stack.pop();
            if(colors[cur] != 0){
                continue;
            } else {
                colors[cur] = color;
            }
            List<Integer> curLink = link.get(cur);
            
            for(int i=0;i<curLink.size();i++){
                stack.push(curLink.get(i));
            }
        }

    }
}



Measured memory_bytes: 93640
#include<bits/stdc++.h>
#define ll long long 
#define vl vector
#define pb push_back
#define ff first
#define ss second
using namespace std;

int main()
{
    ll n,m,i,a,b,k;
    cin>>n;
    a=26;
    vl<char> v;
    while(n>0)
    {
        if(n%26==0) 
        {
            b=26;
            n--;
        }
        else b=n%26;
        v.pb('a'+(b-1));
        n/=26;
    }
    reverse(v.begin(),v.end());
    for(i=0;i<v.size();i++) cout<<v[i];
    
}

Measured memory_bytes: 3628
// problem: "https://atcoder.jp/contests/abc143/tasks/abc143_e"

#include<bits/stdc++.h>
#define ll long long
#define Pair pair<ll,ll>

using namespace std;

struct Node
{
    ll n,l,f;

    Node(ll n,ll l,ll f) : n(n),l(l),f(f) { }
};

struct func
{
    bool operator () (Node &p1, Node &p2)
    {
        if(p1.f == p2.f)
            return p1.l < p2.l;

        return p1.f > p2.f;
    }
};


vector<vector<ll>> least_fill(vector<Pair>G[],ll n,ll l)
{
    vector<vector<ll>>V(n+1,vector<ll>(n+1,-1));

    ll i;
    for(i=1;i!=n+1;i++)
    {
        priority_queue<Node,vector<Node>,func>Q;

        Q.push(Node(i,l,0));
        ll c = 0;

        while(!Q.empty())
        {
            if(c == n)
                break;

            Node p = Q.top();
            Q.pop();

            if(V[i][p.n] != -1)
                continue;

            V[i][p.n] = p.f;
            c++;


            ll j;
            for(j=0;j!=G[p.n].size();j++)
            {
                if(V[i][G[p.n][j].first] != -1)
                    continue;

                if(G[p.n][j].second > l)
                    continue;

                if(p.l >= G[p.n][j].second)
                    Q.push(Node(G[p.n][j].first,p.l-G[p.n][j].second,p.f));

                else
                    Q.push(Node(G[p.n][j].first,l-G[p.n][j].second,p.f+1));
            }
        }
    }

    return V;
}

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

    ll n,m,l;

    cin>>n>>m>>l;

    ll i,x,c,y;
    vector<Pair>G[n+1];

    for(i=0;i!=m;i++)
    {
        cin>>x>>y>>c;

        G[x].push_back(Pair(y,c));
        G[y].push_back(Pair(x,c));
    }

    vector<vector<ll>>V = least_fill(G,n,l);        // define


    // for(x=1;x!=n+1;x++)
    // {
    //     for(y=1;y!=n+1;y++)
    //         cout<<V[x][y]<<' ';
    //
    //     cout<<'\n';
    // }

    // priority_queue<Node,vector<Node>,func>Q;
    //
    // Q.push(Node(1,2,9));
    // Q.push(Node(3,5,2));
    // Q.push(Node(2,3,5));
    // Q.push(Node(2,2,4));
    // Q.push(Node(3,0,5));
    //
    // while(!Q.empty())
    // {
    //
    //     cout<<Q.top().f<<' '<<Q.top().l<<'\n';
    //     Q.pop();
    // }

    ll q;
    cin>>q;

    for(i=0;i!=q;i++)
    {
        cin>>x>>y;
        cout<<V[x][y]<<'\n';
    }

    return 0;
}


Measured memory_bytes: 6056
#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	int H, W;
	
	cin >> H >> W;
	ll s[4];
	ll min = 1ll << 50;
	for (ll i = 1; i < H; i++)
	{

		ll w = W / 2;
		ll s1 = W * i;
		ll s2 = w * (H - i);
		ll s3 = (W-w)*(H-i);
		/*
		if (i == 30000)
		{
			cout << "30000:" << i << " " << w << s1 << " " << s2 << " " << s3 << endl;
		}
		*/
		s[0] = max(abs(s1-s2), abs(s1-s3));
		
		if (min > s[0])
		{
			min = s[0];
			//cout << "s0=" << s[0] << endl;
		}

		ll h = (H - i) / 2;
		s2 = h * W;
		s3 = (H-h-i) * W;
		s[1] = max(abs(s1-s2), abs(s1-s3));

		
		if (min > s[1])
		{
			min = s[1];
			//cout << "s1=" << s[1] << endl;
		}
	}

	for (ll i = 1; i < W; i++)
	{
		ll h = H / 2;
		ll s1 = H * i;
		ll s2 = h * (W - i);
		ll s3 = (H-h)*(W-i);

		s[2] = max(abs(s1-s2), abs(s1-s3));

		
		if (min > s[2])
		{
			min = s[2];
			//cout << "s2=" << s[2] << endl;
		}

		ll w = (W - i) / 2;
		s2 = H * w;
		s3 = (W-w-i) * H;
		s[3] = max(abs(s1-s2), abs(s1-s3));

		
		if (min > s[3])
		{
			min = s[3];
			//cout << "s3=" << s[3] << endl;
		}
	}

	//sort(begin(s), end(s));
	//cout << s[0] << endl;
	cout << min << endl;

	return 0;
}


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

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

    int count = 0;
    for (int i=0; i < N; i++) {
        int l, r;
        cin >> l >> r;
        count += r - l + 1;
    }

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
	int _x, _y;
	cin >> _x >> _y;
	float x = _x;
	float y = _y;

	if (_y % 2 == 1) {
		cout << "No" << endl;
		return 0;
	}

	const int a = -x + y / 2.0;
	const int b = 2.0 * x - y / 2.0;

	if ( 0 <= a && a <= x) {
		if ( 0 <= b && b <= x) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 3132
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    	if(c == '-') f = -1;
    	c = getchar();
    }
    while(c >= '0' && c <= '9') {
    	res = res * 10 +c - '0';
    	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
    	out(x / 10);
    }
    putchar('0' + x % 10);
}

int N,C,K;
int T[MAXN];
void Solve() {
    read(N);read(C);read(K);
    for(int i = 1 ; i <= N ; ++i) {
        read(T[i]);
    }
    sort(T + 1,T + N + 1);
    int pos = 0,rem = 0;
    int ans = 0;
    for(int i = 1 ; i <= N ; ++i) {
        if(pos < T[i] || !rem)  {
            pos = T[i] + K;
            rem = C;
            ++ans;
        }
        --rem;
    }
    out(ans);enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>
#define Min(x,y) ((x<y)?(x):(y))
int d[110][110];
void dijkstra(int v[],int s,int g,int n){
	int i,j,x,u[110];
	for(i=1;i<=n;i++){
		v[i]=1000000;
		u[i]=-1;
	}
	v[s]=0;
	while(1){
		x=-1;
		for(i=1;i<=n;i++){
			if(u[i]==-1 && (x==-1 || v[x]>v[i]))x=i;
		}
		if(x==-1)break;
		u[x]=0;
		for(i=1;i<=n;i++){
			v[i]=Min(v[i],v[x]+d[x][i]);
		}
	}
	return;
}
int v1[110],v2[110];
int main(){
	int i,j,k,n,m,ans,a,b,c;
	
	while(1){
		scanf("%d%d",&n,&m);
		if(n+m==0)break;
		memset(d,0,sizeof(d));
		for(i=1;i<=n;i++)for(j=1;j<=n;j++)d[i][j]=1000000;
		for(i=0;i<m;i++){
			scanf("%d%d%d",&a,&b,&c);
			d[a][b]=d[b][a]=c;
		}
		dijkstra(v1,1,n,n);
		dijkstra(v2,n,1,n);
		ans=v1[n];
		//for(i=1;i<=n;i++)printf("%2d:%d - %d\n",i,v1[i],v2[i]);
		//printf("\n");
		for(i=1;i<=n;i++){
			for(j=1;j<=n;j++){
				if(i!=j){
					for(k=1;k<=n;k++){
						if(i!=k && j!=k && d[i][k]<=1000 && d[k][j]<=1000)break;
					}
					if(k==n+1)continue;
					ans=Min(v1[i]+v2[j],ans);
				}
			}
		}
		printf("%d\n",ans);
	}
	
	return 0;
}

Measured memory_bytes: 456
/* 	* In the name of GOD 
	* Thanks God */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
#define F first
#define S second

void solve() {
	int n, x, t;
	cin >> n >> x >> t;
	cout << ((n + x - 1) / x) * t;
}

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


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vpi = vector<pii>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpl = vector<pll>;
using vs = vector<string>;

int main()
{
    int k, x;
    cin >> k >> x;
    if(500*k>=x) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  a=LI()
  b=LI()

  c=[]
  for i in range(n):
    c.append(a[i]-b[i])

  c.sort()
  cnt=0
  sm=0

  for x in c:
    if x<0:
      cnt+=1
      sm+=x

  for x in c[::-1]:
    if sm>=0:
      return cnt
    if x>0:
      cnt+=1
      sm+=x

  return -1

# main()
print(main())


Measured memory_bytes: 21608
#include <stdio.h>
#include <string.h>
#include <algorithm>

int main () {
  char in[30];
  scanf("%s", in);
  std::sort(in, in + strlen(in));
  for (int i = 1; i < strlen(in); i++) {
    if (in[i] == in[i - 1]) {
      printf("no\n");
      return 0;
    }
  }
  printf("yes\n");

  return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;

public static class P
{
    public static void Main()
    {
        var s = Console.ReadLine();
        var t = Console.ReadLine();
        var srh = new RollingHash(s);
        var thash = new RollingHash(t).Slice(0, t.Length);
        for (int i = 0; i <= s.Length - t.Length; i++)
        {
            var shash = srh.Slice(i, t.Length);
            if (shash == thash) Console.WriteLine(i);
        }
    }
}


class RollingHash
{
    const ulong MASK30 = (1UL << 30) - 1;
    const ulong MASK31 = (1UL << 31) - 1;
    const ulong MOD = (1UL << 61) - 1;
    const ulong POSITIVIZER = MOD * ((1UL << 3) - 1);
    static uint Base;
    static ulong[] powMemo = new ulong[500000 + 1];
    static RollingHash()
    {
        Base = (uint)new Random().Next(129, int.MaxValue);
        powMemo[0] = 1;
        for (int i = 1; i < powMemo.Length; i++)
            powMemo[i] = CalcMod(Mul(powMemo[i - 1], Base));
    }

    ulong[] hash;

    public RollingHash(string s)
    {
        hash = new ulong[s.Length + 1];
        for (int i = 0; i < s.Length; i++)
            hash[i + 1] = CalcMod(Mul(hash[i], Base) + s[i]);
    }

    public ulong Slice(int begin, int length)
    {
        return CalcMod(hash[begin + length] + POSITIVIZER - Mul(hash[begin], powMemo[length]));
    }

    private static ulong Mul(ulong l, ulong r)
    {
        var lu = l >> 31;
        var ld = l & MASK31;
        var ru = r >> 31;
        var rd = r & MASK31;
        var middleBit = ld * ru + lu * rd;
        return ((lu * ru) << 1) + ld * rd + ((middleBit & MASK30) << 31) + (middleBit >> 30);
    }

    private static ulong Mul(ulong l, uint r)
    {
        var lu = l >> 31;
        var rd = r & MASK31;
        var middleBit = lu * rd;
        return (l & MASK31) * rd + ((middleBit & MASK30) << 31) + (middleBit >> 30);
    }

    private static ulong CalcMod(ulong val)
    {
        val = (val & MOD) + (val >> 61);
        if (val >= MOD) val -= MOD;
        return val;
    }
}




Measured memory_bytes: 21860
#include <bits/stdc++.h>
#define LL long long
#define maxn 100005
using namespace std;
bool slove(char *s)
{
	int len;
	len = strlen(s);
	for (int i = 0; i < len; i++)
	{
		if (*(s + i) != *(s+len - i - 1)) return false;
	}
	return true;
}

int main()
{
    char ch[105];
    char ch2[105];
    cin>>ch;
    int len=strlen(ch);
    int len2=len/2;
    for(int i=0;i<len2;i++)
        {
            ch2[i]=ch[i];
        }
    ch2[len2]=0;
    //printf("%s",ch2);
    if(slove(ch2))
    {
        int flag=1;
        for(int i=0,j=len-1;i<j;i++,j--)
        {
            if(ch[i]!=ch[j])
            {
                flag=0;
                break;
            }
        }
        if(flag)
            cout<<"Yes";
        else
            cout<<"No";
    }
    else
        cout<<"No";
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <utility>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <map>
#include <climits>
#include <bitset>

#define ll long long
const ll MOD = 1e9 + 7;
const ll INF = 1 << 29;

int rec(int v, std::vector<int>& dp, const std::vector<std::vector<int>>& connection)
{
    if (dp[v] != -1)
        return dp[v];

    int maxLength = 0;
    for (auto nv : connection[v])
        maxLength = std::max(maxLength, rec(nv, dp, connection) + 1);

    // 訪問した頂点までのパスの長さを記録
    dp[v] = maxLength;
    return maxLength;
}

int main()
{
    int N, M;
    std::cin >> N >> M;
    std::vector<std::vector<int>> connection(N);
    for (auto i=0; i<M; ++i)
    {
        int from, to;
        std::cin >> from >> to;
        from--;
        to--;
        connection[from].emplace_back(to);
    }

    //どの頂点を始点にしたか
    std::vector<int> dp(N, -1);

    int result = 0;
    for (auto i=0; i<N; ++i)
        result = std::max(result, rec(i, dp, connection));

    std::cout << result << std::endl;
}


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

//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end



int main(){
   ll n,x; cin>>n>>x;
   vector<ll> a(n); vector<__int128_t>sum(n+1,0);
   rep(i,0,n){
      cin>>a[i];
      sum[i+1]=sum[i]+a[i];
   }
   __int128_t res=INF;
   rep(k,1,n+1){
      __int128_t sub=k*x;
      int lb=n; int idx=1;
      while(lb>0){
         sub+=(sum[lb]-sum[max(lb-k,0)])*(idx==1?5:2*idx+1);
         lb-=k; idx++;
      } chmin(res,sub);
   }
   cout<<(ll)res+n*x<<endl;
   return 0;
}

Measured memory_bytes: 4992
#include <stdio.h>
#include <stdbool.h>

int main(void)
{
  char s[300000];
  int strat_a=0;
  int strat_z=0;
  bool flag = true;

  fgets(s, sizeof(s), stdin);
  for (int i=0; s[i] != '\n'; i++) {
    if (s[i] == 'A' && flag == true) {
      strat_a = i;
      flag = false;
    }
    if (s[i] == 'Z' && flag == false) {
      strat_z = i;
    }
  }
      printf("%d\n", strat_z - strat_a + 1);
  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const ll MOD = 1e9+7;
const double EPS = 1e-9;


int main(int argc, const char * argv[]) {
  int N; cin >> N;
  vector<string> s(N);
  vector<int> p(N), id(N);
  for(int i=0; i<N; i++)
    cin >> s[i] >> p[i];
  
  iota(id.begin(), id.end(), 0);
  sort(id.begin(), id.end(), [&](int i, int j){
    if(s[i] == s[j]) return p[i] > p[j];
    return s[i] < s[j];
  });

  for(auto i: id)
    cout << i+1 << endl;

  return 0;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define RANGE(i,a,b) for(int i=(a);i<=(b);i++)
#define RANGER(i,a,b) for(int i=(b);i>=(a);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)
using ll=long long int;
using vi=vector<int>;
using vii=vector<vi>;
using pi=pair<int,int>;
constexpr int INF=1<<30;
constexpr ll INTL=1ll<<60;
int main(){
  int n;
  vi ws;
  cin>>n;
  REP(i,n){
    int w;
    cin>>w;
    ws.push_back(w);
  }
  int sum=accumulate(ws.begin(),ws.end(),0);
  int crnt=sum;
  int result=sum;
  REP(i,n){
    crnt-=ws[i];
    result=min(result,abs(sum-2*crnt));
  }
  cout<<result<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#define max_m 100000
#define max_min_n_m max_m
using namespace std;
long long sum[max_min_n_m+1];
int vis[max_m+1];
int main(){
	long long n,x;
	int m;
	scanf("%lld%lld%d",&n,&x,&m);
	sum[1]=x,memset(vis,0,sizeof(vis));
	for(int i=1; ++i<=n; sum[i]=sum[i-1]+x,vis[x]=i){
		x=x*x%m;
		if(!x){
			printf("%lld\n",sum[i-1]);
			return 0;
		}
		if(vis[x]){
			printf("%lld\n",(sum[i-1]-sum[vis[x]-1])*((n-vis[x]+1)/(i-vis[x]))+sum[vis[x]+(n-vis[x]+1)%(i-vis[x])-1]);
			return 0;
		}
	}
	printf("%lld\n",sum[n]);
	return 0;
}

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

int main() {
  int a,b,c,d;
  cin >> a >>b >> c >> d;
  int ans = min(a,b) + min(c,d);
  cout << ans << endl;
}

Measured memory_bytes: 3592
N = int(input())
Nlist = list(map(int,input().split()))
ans = 0
tmp = 0

for i in range(N-1,0,-1):
  if Nlist[i] <= Nlist[i-1]:
    tmp += 1
  else:
    if tmp > ans:
      ans = tmp
    tmp = 0

if tmp > ans:
  ans = tmp
  print(ans)
else:
  print(ans)

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

int main() {
    string S; cin >> S;
    bool ok = true;
 
    if (S[0] != 'A')
        ok = false;
 
    int cnt = 0, length = S.size();
    for (int i = 1; i < length; i++) {
        if (isupper(S[i])) {
            if (i == 1 || i == length - 1 || S[i] != 'C')
                ok = false;
            cnt++;
        }
    }
 
    if (cnt != 1)
        ok = false;
 
    if (ok)
        cout << "AC" << endl;
    else
        cout << "WA" << endl;
 
}

Measured memory_bytes: 256
N = int(input())
lineup = sorted([int(x) for x in input().split()])
duplicate={}
for i in lineup:
    if i in duplicate:
        duplicate[i]+=1
    else:
        duplicate[i]=1
b=max(lineup)+1
sieve=[1]*(b)
counter=0
for i in range(N):
    if sieve[lineup[i]]:
        if duplicate[lineup[i]]==1:
            counter+=1
        for j in range(lineup[i],b,lineup[i]):
            sieve[j]=0
        
print(counter)

Measured memory_bytes: 130344
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
const int N = 1e5+10;
int mode[N]; 

int main() {
	int n;
	cin >> n;
	int a;
	rep(i,n) {
		cin >> a;
		mode[a]++;
	} 
	sort(mode,mode+N,greater<int>());

	for (int i = 0; i <= 100000; i++)
	{
		if (mode[i] == 0 || mode[i] == 1) continue;
		if (mode[i]%2==1 && mode[i] >= 3) mode[i] = 1;
		if (mode[i]%2==0) {
			mode[i] = 1;
			if (mode[i+1] == 0) {
				if (i > 0 && mode[i-1] > 0) mode[i-1]--; 
			} else mode[i+1]--;  
		}
 	}
	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		ans += mode[i];
	}

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

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int n, m;
  cin >> n >> m;
  if (m & 1) {
    for (int l = 1, r = m; l < r; l++, r--) {
      cout << l << " " << r << endl;
    }
    for (int l = m + 1, r = m * 2 + 1; l < r; l++, r--) {
      cout << l << " " << r << endl;
    }
  } else {
    for (int l = 1, r = m; l < r; l++, r--) {
      cout << l << " " << r << endl;
    }
    for (int l = m + 1, r = m * 2 + 1; l < r; l++, r--) {
      cout << l << " " << r << endl;
    }
  }
}

Measured memory_bytes: 3624
let n = int (stdin.ReadLine())
let s = stdin.ReadLine().ToCharArray()

// ri*gi*bi-(j-i=k-jなるもの)

let countby = 
    s |> Seq.countBy id

let waste =
    let mutable cnt = 0
    for i in 0..n-1 do
        for j in i+1..n-1 do
            let k = j * 2 - i 
            if
                k <= n - 1
                && s.[i] <> s.[j] 
                && s.[i] <> s.[k]
                && s.[j] <> s.[k]
                then
                    cnt <- cnt + 1
    cnt

countby
|> dict
|> fun dic -> (dic.TryGetValue('R') |> snd |> int64) * (dic.TryGetValue('G') |> snd |> int64) * (dic.TryGetValue('B') |> snd |> int64)
|> fun x -> x - int64 waste
|> string
|> stdout.WriteLine

Measured memory_bytes: 28868
def dfs(i, f):
    if i == n - 1:
        return sum(list(map(int, f.split('+'))))

    return dfs(i + 1, f + a[i + 1]) + dfs(i + 1, f + '+' + a[i + 1])


a = input()
n = len(a)

print(dfs(0, a[0]))


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

int N;
const int MAX_N = 200010;
int a[MAX_N];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) cin >> a[i];

    int K = 1;
    for (int i = 0; i < N; i++) {
        if (a[i] == K) {
            K++;
        }
    }

    if (K == 1) cout << -1 << endl;
    else cout << N - K + 1<< endl;

    return 0;
}


Measured memory_bytes: 1024
N = int(input())
train = [[] for _ in range(N)]
L = []
for cnt in range(N - 1):
    l = list(map(int,input().split()))
    L.append(l)

from math import ceil

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        k = max(0,ceil((now - L[i][1]) / L[i][2]))
        now = L[i][1] + L[i][2] * k
        now += L[i][0]
    print(now)



Measured memory_bytes: 3444
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0):
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    x = [y for y in map(int,input().split())]
    x.sort()
    ans = x[2] * 10 + x[1] + x[0]
    print(ans)
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 38508
#include<iostream>
#include<cstdio>
#define maxn 100010
using namespace std;

class P {
public:
    char name[100];
    int time;
};

P Q[maxn];
int head, tail, n;

void push(P x) {
    Q[tail]=x;
    tail = (tail+1) % maxn;
}

P pop() {
    P x = Q[head];
    head = (head+1) % maxn;
    return x;
}

int main() {
    int q, elaps = 0, c;
    P u;

    cin>>n>>q;
    for(int i=1; i<=n; i++)scanf("%s %d", Q[i].name, &Q[i].time);

    head = 1;
    tail = n+1;
    while(head != tail) {
        u = pop();
        c = min(q,u.time);
        u.time -= c;
        elaps += c;
        if(u.time > 0)push(u);
        else {
            printf("%s %d\n", u.name, elaps);
        }
    }
    return 0;
}



Measured memory_bytes: 13268
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 1012345678;
int dp[200009][5];
int main() {
	string s;
	cin >> s;
	int n = s.size();
	for (int i = 0; i <= n; ++i) {
		for (int j = 1; j <= 4;  ++j) {
			dp[i][j] = -inf;
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= 4 && j <= i; ++j) {
			if (i == j) dp[i][j] = 1;
			for (int k = 1; k <= 4; ++k) {
				if (dp[i - j][k] != -inf && s.substr(i - j - k, k) != s.substr(i - j, j)) {
					dp[i][j] = max(dp[i][j], dp[i - j][k] + 1);
				}
			}
		}
	}
	int ans = -inf;
	for (int i = 1; i <= 4; ++i) {
		ans = max(ans, dp[n][i]);
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<pair<int, int>> VPII;
typedef long long LL;

#define SORT_ASC(c) sort((c).begin(), (c).end())
#define SORT_DESC(c) sort((c).begin(), (c).end(), greater<typeof((c).begin())>())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SIZE(a) int((a).size())

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_LARGE = 1000000100;

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

void Main()
{
	int n;
	cin>>n;
	n++;

	VI a(n,0);
	VI r(n,0);
	FOR(i,1,n){
		cin>>a[i];
	}

	for(int i=n-1;i>0;i--){
		int sum=0;
		for(int j=i*2;j<n;j+=i){
			sum += a[j];
		}
		if(sum%2 == a[i]){
			a[i] = 0;
		}
		else{
			a[i] = 1;
		}
	}

	int sum = 0;
	FOR(i,1,n){
		sum += a[i];
	}
	cout << sum << endl;

	bool flag = false;
	FOR(i,1,n){
		if(flag){
			cout << " ";
		}
		if(a[i] != 0){
			cout << i;
			flag = true;

		}
	}
	cout << endl;
	


	

	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll nums[7];
ll ans = 0;
ll shapes[3];

int main(void) {
    // insert code here...
    for(int i = 0; i < 7; i++){
        cin >> nums[i];
    }
    
    ans += nums[1];
    shapes[0] = nums[0];
    shapes[1] = nums[3];
    shapes[2] = nums[4];
    
    sort(shapes, shapes+3);
    
    ans += shapes[0] * 3;
    ll a,b;
    
    a = shapes[1] - shapes[0];
    b = shapes[2] - shapes[0];
    
    if(shapes[0]!= 0){
        if(a%2==0 && b%2==0){
            ans += a + b;
        }else{
            ans += a + b - 1;
        }
    }else{
        ans += (a/2)*2 + (b/2)*2;
    }
    
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
/*
  Submitter: Nick Hudson
  Anumber: A01634984
  */

#include <iostream>

int main(){

  int a1, a2, a3;

  std::cin>>a1>>a2>>a3;

  if(a1+a2+a3 >= 22)
    std::cout<<"bust";
  else
    std::cout<<"win";


  return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define MT make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
#define RT return
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;

template<int MOD>
class ModInt {
public:
    ModInt() :value(0) {}
    ModInt(long long val) :value((int)(val<0 ? MOD + val % MOD : val % MOD)) { }

    ModInt& operator+=(ModInt that) {
        value = value + that.value;
        if (value >= MOD)value -= MOD;
        return *this;
    }
    ModInt& operator-=(ModInt that) {
        value -= that.value;
        if (value<0)value += MOD;
        return *this;
    }
    ModInt& operator*=(ModInt that) {
        value = (int)((long long)value * that.value % MOD);
        return *this;
    }
    ModInt &operator/=(ModInt that) {
        return *this *= that.inverse();
    }
    ModInt operator+(ModInt that) const {
        return ModInt(*this) += that;
    }
    ModInt operator-(ModInt that) const {
        return ModInt(*this) -= that;
    }
    ModInt operator*(ModInt that) const {
        return ModInt(*this) *= that;
    }
    ModInt operator/(ModInt that) const {
        return ModInt(*this) /= that;
    }
    ModInt pow(long long k) const {
        ModInt n = *this, res = 1;
        while (k) {
            if (k & 1)res *= n;
            n *= n;
            k >>= 1;
        }
        return res;
    }
    ModInt inverse() const {
        long long a = value, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        return ModInt(u);
    }
    int toi() const { return value; }

private:
    int value;
};
typedef ModInt<1000000007> mint;
ostream& operator<<(ostream& os, const mint& x) {
    os << x.toi();
    return os;
}

mint dp[61][2][2][2];

void solve() {
    ll L, R;
    cin >> L >> R;
    dp[0][0][0][0] = 1;

    rep(i, 60) {
        int low = L >> (60 - 1 - i) & 1;
        int high = R >> (60 - 1 - i) & 1;
        rep(greL, 2)rep(lesR, 2)rep(first, 2) {
            mint val = dp[i][greL][lesR][first];
            rep(x, 2)FOR(y, x, 2) {
                if (!greL && x < low)continue;
                if (!lesR && y > high)continue;
                if (!first && y != x)continue;
                dp[i + 1][greL || x > low][lesR || y < high][first || x] += val;
            }
        }
    }

    mint ans;
    rep(i, 2)rep(j, 2)ans += dp[60][i][j][1];
    cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main()
{
	int x, a, b, diffA, diffB;
	scanf("%d %d %d", &x, &a, &b);
	diffA = abs(x - a);
	diffB = abs(x - b);
	
	if (diffB > diffA)
		printf("A");
	else
		printf("B");
		
	return 0;
}


Measured memory_bytes: 128