akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=205,INF=1<<30;

typedef vector<vector<ll>> mat;

mat mul(mat &A, mat&B){
    mat C(A.size(),vector<ll>(B[0].size()));
    for(int i=0;i<A.size();i++){
        for(int k=0;k<B.size();k++){
            for(int j=0;j<B[0].size();j++){
                C[i][j]=(C[i][j]+A[i][k]*B[k][j]%mod)%mod;
            }
        }
    }
    return C;
}

mat pow(mat A,ll n){
    mat B(A.size(),vector<ll>(A.size()));
    for(int i=0;i<A.size();i++){
        B[i][i]=1;
    }
    
    while(n>0){
        if(n&1) B=mul(B,A);
        A=mul(A,A);
        n/=2;
    }
    return B;
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int Q;cin>>Q;
    while(Q--){
        ll N;cin>>N;
        
        mat A(21,vector<ll>(21));
        
        for(int t=0;t<5;t++){
            A[t*2][t*2+1]=1;
            A[t*2+1][t*2]=1;
            A[t*2][(t+1)*2]=1;
        }
        for(int t=10;t<21;t++){
            if(t+1<21) A[t][t+1]=1;
            A[t][t]=1;
        }
        
        A=pow(A,N+10);
        
        cout<<A[0][20]<<"\n";
    }
    
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int n;
char s[1010];
vector<PII> ans,c;
vector<PII> build(VI w) {
  if (SZ(w)==1) return vector<PII>{{w[0],0}};
  vector<PII> z{{w[0],0},{w[1],0},{w[0],1},{w[1],1}};
  rep(i,2,SZ(w)) {
    vector<PII> nz=z; 
    z.pb({w[i],0});
    reverse(all(nz));
    for (auto p:nz) z.pb({p.fi,p.se^1});
    z.pb({w[i],1});
  }
  return z;
}
int zz;
int main() {
  scanf("%d",&n);
  scanf("%s",s);
  rep(i,0,(1<<n)) if (s[i]=='0') {
    rep(j,0,(1<<n)) if ((j&i)==i&&s[j]=='1') {
      puts("Impossible");
      return 0;
    }
    bool cc=0;
    rep(j,0,(1<<n)) if ((i&j)==j&&i!=j&&s[j]=='0') cc=1;
    if (cc) continue;
    VI w;
    rep(j,0,n) if (i&(1<<j)) w.pb(j);
    auto x=build(w);
    for (auto p:x) ans.pb(p);
    zz++;
    rep(i,0,n) ans.pb(mp(i,0));
  }
  rep(i,0,zz) per(j,0,n) ans.pb(mp(j,-1));
  puts("Possible");
  int pos=0;
  c.pb(mp(0,0));
  for (auto p:ans) {
    //printf("pp %d %d\n",p.fi,p.se);
    if (p.se==0) {
      while (pos<p.fi) {
        pos+=1;
        c.pb(mp(pos,0));
      }
      while (pos>p.fi) {
        pos-=1;
        c.pb(mp(pos,0));
      }
      c.pb(mp(pos,1));
      c.pb(mp(pos+1,1));
      c.pb(mp(pos+1,0));
      pos+=1;
    } else {
      while (pos<p.fi+1) {
        pos+=1;
        c.pb(mp(pos,0));
      }
      while (pos>p.fi+1) {
        pos-=1;
        c.pb(mp(pos,0));
      }
      c.pb(mp(pos,1));
      c.pb(mp(pos-1,1));
      c.pb(mp(pos-1,0));
      pos-=1;
    }
  }
  while (pos>0) {
    pos--;
    c.pb(mp(pos,0));
  }
  printf("%d\n",SZ(c)-1);
  for (auto x:c) printf("%d %d\n",x.fi,x.se);
}


Measured memory_bytes: 672
/*================================================================
Love China, Love YALI, Love OI!
*   
*   File Name：F.cpp
*   Author：YaliKiWi
*   Date：2019年09月01日
*   Discribe：
*
================================================================*/


#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
const double pi = acos(-1);
struct data
{
    ll x , y;
    double ang;
    bool operator<(const data &a)const {return ang < a.ang;}
}a[400010];
int main()
{
    int n , i , p;
    ll sx = 0 , sy = 0 , ans = 0;
    scanf("%d",&n);
    for(i = 1 ; i <= n ; i ++ ) scanf("%lld%lld" , &a[i].x , &a[i].y) , a[i].ang = atan2(a[i].y , a[i].x);
    sort(a + 1 , a + n + 1);
    for(p = i = 1 ; i <= n ; i ++ )
    {
        while(p < i + n && a[p].ang - a[i].ang < pi) sx += a[p].x , sy += a[p ++ ].y , ans = max(ans , sx * sx + sy * sy);
        sx -= a[i].x , sy -= a[i].y , ans = max(ans , sx * sx + sy * sy);;
        a[i + n].x = a[i].x , a[i + n].y = a[i].y , a[i + n].ang = a[i].ang + 2 * pi;
    }
	double aans=sqrt(ans);
	printf("%.11f",aans);
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 36
#define swap(x, y) {char t = x[0]; x[0] = y[0]; y[0] = t; t = x[1]; x[1] = y[1]; y[1] = t;}

void
bubblesort(char c[MAX_N][2], int n)
{
	int i, j;

	bool b = true;
	for (i = 0; b; ++i)
	{
		b = false;
		for (j = n - 1; j >= i + 1; --j)
		{
			if (c[j - 1][1] > c[j][1])
			{
				swap(c[j - 1], c[j]);
				b = true;
			}
		}
	}
}

void
selectionsort(char c[MAX_N][2], int n)
{
	int i, j;

	for (i = 0; i < n; ++i)
	{
		int minj = i;
		for (j = i; j < n; ++j)
		{
			if (c[j][1] < c[minj][1])
				minj = j;
		}

		if (i != minj)
			swap(c[i], c[minj]);
	}
}

int
main(int argc, char** argv)
{
	char c1[MAX_N][2];
	char c2[MAX_N][2];
	int n;
	int i;

	scanf("%d\n", &n);
	for (i = 0; i < n; ++i)
	{
		scanf("%c%c ", &c1[i][0], &c1[i][1]);
		c2[i][0] = c1[i][0];
		c2[i][1] = c1[i][1];
	}

	bubblesort(c1, n);
	for (i = 0; i < n; ++i)
		printf("%c%c%c", c1[i][0], c1[i][1], (i != n - 1) ? ' ' : '\n');

	printf("Stable\n");

	selectionsort(c2, n);
	for (i = 0; i < n; ++i)
		printf("%c%c%c", c2[i][0], c2[i][1], (i != n - 1) ? ' ' : '\n');

	for (i = 0; i < n; ++i)
	{
		if (c1[i][0] != c2[i][0] || c1[i][1] != c2[i][1])
			break;
	}

	if (i >= n)
		printf("Stable\n");
	else
		printf("Not stable\n");

	return 0;
}

Measured memory_bytes: 612
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

int game(int a, int k) {
    while (a >= k) {
	int r = a % k;
	if (r == 0) return a / k;
	int d = a / k + 1;
	int p = max((r + d - 1) / d, 1);
	a -= p * d;
    }
    return 0;
}

int N;

void MAIN() {
    scanf("%d", &N);
    int ans = 0;
    REP (i, N) {
	int a, k;
	scanf("%d%d", &a, &k);
	ans ^= game(a, k);
    }
    puts(ans? "Takahashi": "Aoki");
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[1003][1003],b[1003][1003];
int s1[1003][1003],s2[1003][1003];
int n,k;
char t;
int dfs(int x,int y)
{
	int i=0,j=0;
	i=s1[k][k]-s1[x][k]-s1[k][y]+s1[x][y]+s1[x][y];
	i+=s2[x][k]+s2[k][y]-s2[x][y]-s2[x][y];
	j+=s2[k][k]-s2[x][k]-s2[k][y]+s2[x][y]+s2[x][y];
	j+=s1[x][k]+s1[k][y]-s1[x][y]-s1[x][y];
	return max(i,j);
}
int main()
{
    int ans,x,y;
	cin>>n>>k;
	for (int i=1;i<=n;i++)
	{
		cin>>x>>y>>t;
		int tx=x,ty=y;
		x%=k;y%=k;
		if (x==0)x=k;
		if (y==0)y=k;
		if (((abs(tx-x)+abs(ty-y))/k)%2==1)
		{
			if (t=='W')t='B';else t='W';
		}
		if (t=='W')b[x][y]++;else a[x][y]++;
	}
	for (int i=1;i<=k;i++)
	{
		for (int j=1;j<=k;j++)
		{
			s1[i][j]=s1[i-1][j]+s1[i][j-1]-s1[i-1][j-1]+a[i][j];
			s2[i][j]=s2[i-1][j]+s2[i][j-1]-s2[i-1][j-1]+b[i][j];
		}
	}
	for (int i=0;i<=k+1;i++)
	{
		for (int j=0;j<=k+1;j++)
		{
			ans=max(ans,dfs(i,j));
		}
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 16000
#include <bits/stdc++.h>
 
#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;

using namespace std;
typedef long long ll;
struct Elem {
    int to;
    double cost;
};

bool operator >(const Elem& x, const Elem& y) {
    return tie(x.cost, x.to) > tie(y.cost, y.to);
}

int main()
{
    while (1) {
        int n; cin >> n;
        if (!n) break;
        vector<double> x(n), y(n), z(n), r(n);
        loop (n, i) cin >> x[i] >> y[i] >> z[i] >> r[i];
        vector<vector<double>> dist(n, vector<double>(n));
        loop (n, i) loop (n, j) {
            double d = pow(
                    pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2) + pow(z[i] - z[j], 2),
                    0.5
                    );
            dist[i][j] = max(0.0, d - r[i] - r[j]);
        }

        priority_queue<Elem, vector<Elem>, greater<Elem>> Q;
        vector<int> vis(n);
        Q.push({ 0, 0 });
        double ans = 0;
        while (Q.size()) {
            Elem e = Q.top(); Q.pop();
            if (vis[e.to]) continue;
            vis[e.to] = 1;
            ans += e.cost;
            loop (n, i) if (i != e.to && !vis[i]) {
                Q.push({ i, dist[e.to][i] });
            }
        }
        cout << setprecision(3) << fixed << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3768
#include<bits/stdc++.h>
#include<cassert>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds; 
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define inf INT_MAX
#define llinf LONG_LONG_MAX
const int N=2e5+5;
const int M=1e9+7;



void solve(){
	map<ll,ll> mp;

	int n;
	sfi(n)

	ll ans=0;

	f(i,0,n){
		ll x;
		sfl(x)

		if(mp.find(x-i)!=mp.end()){
			ans+=mp[x-i];
		}

		mp[-1ll*(i+x)]++;
	}

	pfln(ans)
}



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

Measured memory_bytes: 16224
import java.util.*;
 
public class Main {
 
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
 
        int[] tree = new int[n];
 
        for(int i=0; i<n-1; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt() - 1;
            tree[b] = a;
        }
 
        long[] p = new long[n];
        for(int i=0; i<q; i++) {
            int a = sc.nextInt() - 1;
            int b = sc.nextInt();
            p[a] += b;
        }
 
        for(int i=1; i<n; i++) {
            p[i] += p[tree[i]];
        }
 
        System.out.print(p[0]);
        for(int i=1; i<n ;i++) {
            System.out.print(' ');
            System.out.print(p[i]);
        }
        System.out.println();
    }
 
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}

int main() {
  int N, M; cin >> N >> M;
  vector<int> K(N);
  vector<vector<int>> A(N);
  REP(i, N) {
    cin >> K[i];
    REP(k, K[i]) {
      int a;
      cin >> a;
      A[i].push_back(a);
    }
  }

  map<int, int> m;
  int cnt = 0;
  REP(i, N) {
    REP(k, K[i]) {
      m[A[i][k]]++;
    }
  }

  for(auto x : m) {
    if(x.second == N) cnt++;
  }

  cout << cnt << endl;
}

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

int main () {
    int n, i, j;
    string ans = "No";
    cin >> n;
    //4x+7y=n
    for(i=0;i<n;++i){
        for(j=0;j<n;++j){
            if(n - 4 * i - 7 * j == 0){
                ans = "Yes" ;
                break;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1e17 - 10;
const double PI = acos(-1);
typedef pair<LL, LL> Pll;
LL h, w, n, m, s, ans = 0, num = 1, sum = 0, a[100000], flag;
string str,stt;
int main() {
	cin >> n >> m;
	h = (m) / n;
	while (h != 0) {
		h /= 2;
		ans++;
	}
	cout << ans<< endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define Mod(n) n % 1000000007
const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};

int main()
{
    int N;
    cin >> N;
    double sum = 0;
    double x;
    string u;
    for(int i = 0;i < N;i++)
    {
        cin >> x >> u;
        if(u == "JPY")
            sum += x;
        else
            sum += (x * 380000);
    }
    cout << sum << '\n';
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static long LINF = 1L << 55;
	static int MOD = 1000000007;
	static int[] mh4 = { 0, -1, 1, 0 };
	static int[] mw4 = { -1, 0, 0, 1 };
	static int[] mh8 = { -1, -1, -1, 0, 0, 1, 1, 1 };
	static int[] mw8 = { -1, 0, 1, -1, 1, -1, 0, 1 };

	static class TaskX {

		public void solve(int testNumber, InputReader in, PrintWriter out) {

			char a = in.nextString().charAt(0);
			char b = in.nextString().charAt(0);

			if (a == 'H') {
				out.println(b);
			} else {
				out.println(b == 'D' ? 'H' : 'D');
			}
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public int[] nextIntArrayDec(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt() - 1;
			}
			return res;
		}

		public int[] nextIntArray1Index(int n) {
			int[] res = new int[n + 1];
			for (int i = 0; i < n; i++) {
				res[i + 1] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public long[] nextLongArrayDec(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong() - 1;
			}
			return res;
		}

		public long[] nextLongArray1Index(int n) {
			long[] res = new long[n + 1];
			for (int i = 0; i < n; i++) {
				res[i + 1] = nextLong();
			}
			return res;
		}

		public double[] nextDoubleArray(int n) {
			double[] res = new double[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextDouble();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}
	}

}


Measured memory_bytes: 20180
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k;
    char s[200];
    cin>>k;
    cin>>s;
    int n=strlen(s);
    if(n<=k) cout<<s;
    else
    {
        for(int i=0;i<k;i++) cout<<s[i];
        cout<<"..."<<endl;
    }


    return 0;
}


Measured memory_bytes: 3636
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static final Scanner     sc = new Scanner(System.in);
    static final PrintStream so = System.out;

    public static void main(String[] args) {
        int n = nint();
        int m = nint();
        int[] c = nints(m);
        Arrays.sort(c);
        
        int[] T = new int[n+1];
        Arrays.fill(T, Integer.MAX_VALUE);
        T[0] = 0;
        
        for (int ic = 0; ic < m; ic++)
            for (int it = c[ic]; it <= n; it++)
                T[it] = Math.min(T[it-c[ic]] + 1, T[it]);
        
        so.println(T[n]);
    }

    private static long nlong() {
        return sc.nextLong();
    }

    private static int nint() {
        return sc.nextInt();
    }

    private static String nstr() {
        return sc.next();
    }

    private static char[] nsToChars() {
        return sc.next().toCharArray();
    }

    private static long[] nlongs(int n) {
        return nlongs(n, 0, 0);
    }

    private static int[] nints(int n) {
        return nints(n, 0, 0);
    }

    private static int[] nints(int n, int padL, int padR) {
        int[] a = new int[padL + n + padR];
        for (int i = 0; i < n; i++)
            a[padL + i] = nint();
        return a;
    }

    private static long[] nlongs(int n, int padL, int padR) {
        long[] a = new long[padL + n + padR];
        for (int i = 0; i < n; i++)
            a[padL + i] = nlong();
        return a;
    }

    private static String[] nstrs(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = nstr();
        return a;
    }

    private static char[][] nsToChars2D(int h, int w) {
        return nsToChars2D(h, w, 0);
    }

    private static char[][] nsToChars2D(int h, int w, int pad) {
        char[][] a2 = new char[h + pad * 2][w + pad * 2];
        for (int i = 0; i < h; i++)
            System.arraycopy(nsToChars(), 0, a2[pad + i], pad, w);
        return a2;
    }
}



Measured memory_bytes: 26900
n=int(input())
A=list(map(int,input().split()))
B=[0 for i in range(n+1)]
C=[]
cnt=0
for i in range(1,n+1)[::-1]:
    sum_B=sum(B[j] for j in range(i,n+1,i))
    if sum_B%2!=A[i-1]:
        B[i]=1
        C.append(i)
        cnt +=1
print(cnt)
print(*[i for i in C[::-1]])

Measured memory_bytes: 14720
/**
*    author:  souzai32
*    created: 01.08.2020 17:08:08
**/

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {

    long long int a,b,c;
    cin >> a >> b >> c;

    string ans="Yes";
    if(c-a-b<0) ans="No";
    else{
        if(a*a+b*b+c*c-2*a*b-2*b*c-2*c*a<=0) ans="No"; 
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

const int N=510;
int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
int n,wt[N][N],dis[N][N];
int ans;
int main() {
	scanf("%d",&n);
	rep(i,0,n) rep(j,0,n) wt[i][j]=1;
	rep(i,0,n) rep(j,0,n) dis[i][j]=min({i,n-1-i,j,n-1-j});
	rep(i,0,n*n) {
		int x;
		scanf("%d",&x); x-=1;
		int u=x/n,v=x%n;
		ans+=dis[u][v];
		wt[u][v]=0;
		queue<PII> q;
		q.push(mp(u,v));
		while (!q.empty()) {
			int u=q.front().fi,v=q.front().se; q.pop();
			rep(k,0,4) {
				int px=u+dx[k],py=v+dy[k];
				if (px>=0&&px<n&&py>=0&&py<n&&dis[px][py]>dis[u][v]+wt[u][v]) {
					dis[px][py]=dis[u][v]+wt[u][v];
					q.push(mp(px,py));
				}
			}
		}
	}
	printf("%d\n",ans);
}


Measured memory_bytes: 5748
#include<bits/stdc++.h>
typedef long long int ll;
#define rep(i,n) for(int i = 0;i < n; i++)
#define c(ans) cout << (ans) << '\n'
using namespace std;
int n, m, a = 0;string s, t;
int main(void) {
	cin >> n;
	for (int i = 1;i <= n;i++) {
		int b = floor(log10(i)) + 1;
		if (b % 2 == 1)
			a++;
	}
	cout << a << endl;
}

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

typedef pair<int,int> PII;

int main(void){
  long long n,m,i,ans=0;
  vector<PII> v;
  
  cin >> n >> m;
  for (int i=0; i<n; i++){
    int a,b;
    cin >> a >> b;
    v.push_back(make_pair(a,b));
  }
  sort(v.begin(), v.end());
  i=0;
  while (m){
    if (v[i].second>=m){
      ans += (long long)v[i].first*m;
      m=0;
    } else {
      ans += (long long)v[i].first*v[i].second;
      m -= v[i].second;
    }
    i++;
//    if (m<80000) cout << ans << " " << m << endl;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1400
#include<iostream>
using namespace std;
int main(void){
	int w,n;
	char comma;
	cin>>w;
	cin>>n;
	int ans[30];
	for(int i=1;i<=w;i++){
		ans[i]=i;
	}
	for(int i=0;i<n;i++){
		int a,b;
		cin>>a>>comma>>b;
		int tmp=ans[a];
		ans[a]=ans[b];
		ans[b]=tmp;
	}
	for(int i=1;i<=w;i++){
		cout<<ans[i]<<endl;
	}
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

int n;

void dfs(string s) {
  int l = s.length();
  if (l == n) {
    cout << s << endl;
    return;
  }
  set<char> se;
  rep(i, l) se.insert(s[i]);
  char next = (*se.rbegin()) + 1;
  se.insert(next);
  for (auto c : se) {
    dfs(s + c);
  }
}

int main() {
  cin >> n;
  string ans = "";
  dfs("a");
}


Measured memory_bytes: 3564
/*  -*- coding: utf-8 -*-
 *
 * 2922.cc: Mercy
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

typedef long long ll;

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, m;
  scanf("%d%d", &n, &m);

  int asum = 0, bsum = 0;
  for (int i = 0; i < n; i++) {
    int ai;
    scanf("%d", &ai);
    asum += ai;
  }
  for (int i = 0; i < m; i++) {
    int bi;
    scanf("%d", &bi);
    bsum += bi;
  }

  printf("%lld\n", (ll)asum * bsum);
  return 0;
}



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

const int N = 2e5+7;
int a[N];
int n;

bool solve(int x) {
    for (int i=n, j=n; i>1; i--, j++) {
        if ((a[i]>x) == (a[i-1]>x)) return a[i] > x;
        if ((a[j]>x) == (a[j+1]>x)) return a[j] > x;
    }
    return a[1] > x;
}

int main() {
    cin>>n;
    for (int i=1; i<2*n; i++)   cin>>a[i];

    int lo = 1, hi = 2*n-1;
    while (lo < hi) {
        int m = (lo+hi)/2;
//        cout<<lo<<" "<<hi<<" "<<m<<" "<<solve(m)<<endl;
        if (solve(m))   lo = m+1;
        else            hi = m;
    }
    cout<<lo<<endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) > (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0ll;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n;
    scanf("%d", &n);
    vector<int> v(n),w(n);
    REP(i,n){
        scanf("%d", &v[i]);
        w[i] = v[i];
    }
    sort(w.begin(), w.end());
    int disorder=0;
    REP(i,n){
        if(v[i]!=w[i]){
            disorder++;
        }
    }
    int q;
    
    scanf("%d", &q);
    int tmp1, tmp2;
    REP(i,q){
        if(disorder==0){
            printf("%d\n", i);
            return 0;
        }
        scanf("%d%d", &tmp1, &tmp2);
        tmp1--;
        tmp2--;
        
        if(v[tmp1]!=w[tmp1]&&v[tmp2]==w[tmp1]){
            disorder--;
        }
        if(v[tmp2]!=w[tmp2]&&v[tmp1]==w[tmp2]){
            disorder--;
        }
        if(v[tmp1]==w[tmp1]&&v[tmp2]!=w[tmp1]){
            disorder++;
        }
        if(v[tmp2]==w[tmp2]&&v[tmp1]!=w[tmp2]){
            disorder++;
        }
        swap(v[tmp1], v[tmp2]);
    }   
    if(disorder==0){
            printf("%d\n", q);        
    }else{
        printf("-1\n");
    }

    return 0;
}



Measured memory_bytes: 5196
using System;
using System.Collections.Generic;
using System.Linq;

public static class Program
{
    public static void Main(string[] args)
    {
        var inputs = Console.ReadLine().Trim().Split(' ');
        var a = long.Parse(inputs[0]);
        var b = long.Parse(inputs[1]);

        var af = Enumerate(a).ToArray();
        var bf = Enumerate(b).ToArray();

        var intersect = Enumerable.Intersect(af, bf).ToArray();
        Console.WriteLine((intersect.Length + 1).ToString());
    }

    public static IEnumerable<long> Enumerate(long n)
    {
        while (n > 1)
        {
            long factor = GetFactor(n);
            yield return factor;
            n = n / factor;
        }
    }

    private static long GetFactor(long n, int seed = 1)
    {
        if (n % 2 == 0)
            return 2;
        if (IsPrime(n))
            return n;
        long x = 2;
        long y = 2;
        long d = 1;
        long count = 0;
        while (d == 1)
        {
            count++;
            x = f(x, n, seed);
            y = f(f(y, n, seed), n, seed);
            d = Gcd(Math.Abs(x - y), n);
        }
        if (d == n)
            // 見つからなかった、乱数発生のシードを変えて再挑戦。
            return GetFactor(n, seed + 1);
        // 素数でない可能性もあるので、再度呼び出す
        return GetFactor(d);
    }

    private static int[] seeds = new int[] { 3, 5, 7, 11, 13, 17 };
    private static long f(long x, long n, int seed)
    {
        return (seeds[seed % 6] * x + seed) % n;
    }

    private static long Gcd(long a, long b)
    {
        if (a < b)
            return Gcd(b, a);  // 引数を入替えて自分を呼び出す
        if (b == 0)
            return a;
        long d = 0;
        do
        {
            d = a % b;
            a = b;
            b = d;
        } while (d != 0);
        return a;
    }

    // 効率は良くないが、これでも十分な速度がでたので、良しとする。
    private static bool IsPrime(long number)
    {
        long boundary = (long)Math.Floor(Math.Sqrt(number));

        if (number == 1)
            return false;
        if (number == 2)
            return true;

        for (long i = 2; i <= boundary; ++i)
        {
            if (number % i == 0)
                return false;
        }

        return true;
    }
}

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

#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz=" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

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


constexpr ll MOD = 1e9 + 7;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

ll N;
vector<ll> a;

int main()
{
    cin >> N;
    a.resize(N);
    for (ll i = 0; i < N; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end(), greater<ll>());
    ll total = 0;
    while (true) {
        ll sum = 0;
        for (ll i = 0; i < N; i++) {
            sum += a[i] / N;
            for (ll j = 0; j < N; j++) {
                if (i == j) {
                    continue;
                }
                a[j] += a[i] / N;
            }
            a[i] = a[i] % N;
        }
        total += sum;
        if (sum == 0) {
            break;
        }
    }
    cout << total << endl;

    return 0;
}


Measured memory_bytes: 256
function main(input) {
    a = input.charAt(0);
    b = input.charAt(1);
    c = input.charAt(2);
    n = 0;
    a==1 ? n++ : n=n;
    b==1 ? n++ : n=n;
    c==1 ? n++ : n=n;
    console.log(n)
}
main(require("fs").readFileSync("/dev/stdin","utf8"));


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

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    
    int m = (n-2)*(n-1)/2;
    if(m < k) {
        cout << -1 << endl;
        return 0;
    }

    cout << (n-1) + (m-k) << endl;
    for(int i=0; i<n-1; i++)
        cout << 1 << ' '<< i+2 << endl;

    int r = m-k;
    for(int i=1; i<n; i++)
        for(int j=i+1; r && j<n; j++) {
            cout << i+1 << ' ' << j+1 << endl;
            r--;
        }
}


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

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

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

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

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

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

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

void solv() {
	int n, k;
	cin >> n >> k;
	map<ll, int> mp;
	int kind = 0;
	for (size_t i = 0; i < n; i++)
	{
		ll a;
		cin >> a;
		mp[a]++;
		if (mp[a] == 1)kind++;
	}

	pair<ll, int> pr[5010];
	int p = 0;
	for (auto mv : mp)
	{
		pr[p++] = mv;
	}

	sort(pr, pr + kind, greater<pair<ll, int>>());
	ll dp[5010][6000];
	memset(dp, 0, sizeof(dp));
	dp[0][0] = 1;
	ll find = 0;
	int pi = 1;
	for (size_t i = 1; i <= kind; i++)
	{
		for (size_t j = 0; j < 6000; j++)
			dp[pi][j] = dp[pi - 1][j];

		if (pr[i - 1].first >= k) { 
			find = i;
			pi++;
			continue; 
		}

		ll v = pr[i - 1].first;
		for (size_t inn = 0; inn < pr[i - 1].second; inn++)
		{
			for (size_t j = 0; j < 6000; j++)
				dp[pi][j] = dp[pi - 1][j];

			for (size_t j = 1; j < 6000; j++)
			{
				if (j - v < 0) continue;
				if (dp[pi - 1][j - v] == 0) continue;
				dp[pi][j] += dp[pi - 1][j - v];
				if (j - v < k && j >= k) find = i;
			}
			pi++;
		}

	}
	int res = 0;
	for (size_t i = find; i < kind; i++)
	{
		res += pr[i].second;
	}

	cout << res << endl;
}

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

	return 0;
}


Measured memory_bytes: 235520
#include<cstdio>
#include<cstring>
 
int main(){
int m,f,r;

while(true){
	scanf("%d%d%d",&m,&f,&r);
	if((m==-1)&&(f==-1)&&(r==-1)) break;
	if((m==-1)||(f==-1)) puts("F");
	else if(m+f>=80) puts("A");
	else if(m+f>=65) puts("B");
	else if(m+f<30) puts("F");
	else if((m+f<50)&&(r<50)) puts("D");
	else puts("C");
	}


//scanf("%d",&n);

return 0;
 
}

Measured memory_bytes: 1012
from operator import itemgetter

N = int(input())
SPi = [input().split()+[i] for i in range(N)]
for v in SPi:
    v[1] = int(v[1])
SPi.sort(reverse=True, key=itemgetter(1))
SPi.sort(key=itemgetter(0))
for v in SPi:
    print(v[2]+1)

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

    cin >> x;
	if(x == 2){
  		cout << "2";
 		 return 0;
	}
 	 for(int i = x;;i++){
       for(int j = 2;;j++){
           if(i % j == 0){
               break;
           }
           if(j == x-1){
               cout <<  i ;
             return 0;
           }
       }
   }

}
   

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)

using namespace std;

typedef long long ll;
typedef pair<ll, ll> p;

const ll MOD = 10e9+7;

int main() {
    int n,m;cin >> n >> m;
    vector<int> a(n);
    vector<int> b(n);
    REP(i,m) {
        int A,B; cin >> A >> B;
        if(A==1) b[B-1]++;
        if(B==n) a[A-1]++;
    }
    bool ans = 0;
    REP(i, n) {
        if(a[i]>0 && b[i]>0) {
            ans = 1;
            break;
        }
    }
    cout << (ans ? "POSSIBLE" : "IMPOSSIBLE")  << endl;
    return 0;
}

Measured memory_bytes: 1792
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Eric
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CColon solver = new CColon();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColon {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            double a = in.nextInt();
            double b = in.nextInt();
            double h = in.nextInt();
            double m = in.nextInt();
            double res = solveMe1(a, b, h, m);
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

        private double solveMe1(double a, double b, double h, double m) {
            double angleHour = h / 12.0 + (m / 60.0 / 12.0);
            double angle = 2 * Math.PI * (m / 60.0 - angleHour);
            return Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(angle));
        }

    }

    static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 33464
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define iter vector<int>::iterator
#define mod 998244353



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

    int n;
    cin>>n;

    int a[n+1][4];

    for(int i=1;i<=n;i++)
    {
    	for(int j=1;j<=3;j++)
    	{
    		cin>>a[i][j];
    	}
    }

    int dp[n+1][4];
    dp[1][1]=a[1][1];
    dp[1][2]=max(dp[1][1],a[1][2]);
    dp[1][3]=max(dp[1][2],a[1][3]);

    int x, m=-1e9;

    for(int i=2;i<=n;i++)
    {
    	for(int j=1;j<=3;j++)
    	{
    		for(int k=1;k<=3;k++)
    		{
    			if(k==j)
    				continue;
    			x=dp[i-1][k]+a[i][j];
    			if(m<x)
    				m=x;
    		}
    		dp[i][j]=m;
    		m=-1e9;
    	}
    }
    

    int ans=max(dp[n][1],max(dp[n][2],dp[n][3]));
    cout<<ans<<"\n";
    
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
#include <chrono>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9

typedef long long ll;

using namespace std;

const int mod = 1e9+7;
const int N = 1e5+5;
//int a[N];

int main()

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

    string s;

    cin >> s;

    for (int i = 0; i < s.size(); i++) {

        if (s[i] == ',') cout << " ";
        else cout << s[i];
    }

    return 0;
}


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

using ll = int64_t;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)

#define rng(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using ld = long double;

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

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
	os << "{";
	rep(i, (int)v.size()) {
		if (i)
			os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
	for (auto val : array)
		std::cout << val << ", ";
	std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

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

	string s;
	std::cin >> s;
	string ans;
	for (auto &c : s) {
		if (c == 'B' && ans.size() != 0)
			ans.pop_back();
		else if (c != 'B')
			ans += c;
	}
	std::cout << ans << "\n";
}


Measured memory_bytes: 256
import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int numberCount = sc.nextInt();
        int more = sc.nextInt();
        int less = sc.nextInt();
        
        for (int i = 1; i <= numberCount; i++) {
            int num = getKetaNoWa(i);
            
            if (more <= num && num <= less) {
                sum += i;
            }
        }

        System.out.println(sum);
    }
    
    public static int getKetaNoWa(int number) {
        int sum = 0;
        
        for (int i = 5; i >= 0; i--) {
            int tmp = number / (int)Math.pow(10, i);
            sum += tmp;
            number -= tmp * (int)Math.pow(10, i);
        }
        
        return sum;
    }
}

Measured memory_bytes: 21460
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
#define sz(x) (int)(x).size()

const int N = 10001000;
int numDiv[N], n;
ll f[N];

void sieve() {
  for (int i = 1; i < N; i++)  {
    numDiv[i] = 1;
  }
  for (int i = 2; i < N; i++) if (numDiv[i] == 1) {
    for (int j = i * 2; j < N; j += i) {
      int t = j, pw = 0;
      while (t % i == 0) { t /= i; pw++; }
      numDiv[j] *= (1 + pw);
    }
    numDiv[i]++;
  }
}

int main() {
  sieve();
  for (ll i = 1; i < N; i++) f[i] = i * numDiv[i];
  for (int i = 1; i < N; i++) f[i] += f[i - 1];

  int n;
  scanf("%d", &n);
  printf("%lld\n", f[n]);
}



Measured memory_bytes: 120840
#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;

Int solve(Int n, Int m){
	vector<Int> a(m), b(n);
	for(auto &i:a) cin >> i;
	for(auto &i:b) cin >> i;
	vector<vector<Int>> dp(n+1, vector<Int>(256, 1e10));
	dp[0][128] = 0;
	for(Int i=0; i<n; ++i){
		for(Int j=0; j<256; ++j){
			for(Int k=0; k<m; ++k){
				Int l = j + a[k];
				if(l < 0) l = 0;
				if(l > 255) l = 255;
				dp[i+1][l] = min(dp[i+1][l], dp[i][j] + (l-b[i])*(l-b[i]));
			}
		}
	}
	Int ans = 1e10;
	for(Int i=0; i<256; ++i) ans = min(ans, dp[n][i]);
	return ans;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	while(1){
		Int n, m; cin >> n >> m;
		if(n == 0) break;
		cout << solve(n, m) << "\n";
	}
}


Measured memory_bytes: 43948
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int ll
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
#define IN(a) cin >> a
#define INT(a) int a; cin >> a
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    INT(n); INT(a);
    if(n % 500 <= a) Yes;
    else No;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
  int a, b;
  char op;

  while(1){
    scanf("%d %c %d", &a, &op, &b);

    if(op == '+') printf("%d\n", a+b);
    else if(op == '-') printf("%d\n", a-b);
    else if(op == '*') printf("%d\n", a*b);
    else if(op == '/') printf("%d\n", a/b);
    else break;
  }

  return 0;
}


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

int main(){
  int n,k;
  cin>>n>>k;
  vector<int> a(n);
  rep(i,k){
    int d;
    cin>>d;
    
    rep(i,d) {
      int b;
      cin>>b;
      a[b-1]++;
    }
  }
  ll cnt=0;
  rep(i,n){
    if (a[i]==0) cnt++;
  }
  cout << cnt;
}

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

using namespace std;

#define int long long

const int maxn = 2e5+100;

int boxes[maxn], ans[maxn];

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

    int n;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> boxes[i];
    }

    int ansn = n;

    for(int i=n; i>=1; i--){
        int atual=0;
        for(int j=i; j<=n; j+=i){
            atual+=ans[j];
        }
        if(atual%2!=boxes[i]%2){
            ans[i]++;
        }
        if(ans[i]==0)ansn--;
    }

    cout << ansn << endl;

    for(int i=1; i<=n; i++){
        if(ans[i]!=0)cout << i << " ";
    }

    return 0;
}



Measured memory_bytes: 3968
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
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;};



signed main() {
	cin.tie(nullptr);
	cout.tie(nullptr);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	int n, x, t;
	cin >> n >> x >> t;
	cout << t * mod(n, x) << endl;
	return 0;
}

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

int main(){
    set<int> times;
    int n, h, m;
    cin >> n;
    while(n-- > 0){
        cin >> h >> m;
        times.insert(60*h + m);
    }
    cin >> n;
    while(n-- > 0){
        cin >> h >> m;
        times.insert(60*h + m);
    }
    
    bool first = true;
    for(set<int>::iterator it = times.begin(); it != times.end(); it++){
        if(first)   first = false;
        else        printf(" ");
        
        int x = *it;
        int a = x / 60;
        int b = x - 60*a;
        
        printf("%d:%02d", a, b);
    }
    printf("\n");
    
    return 0;
}


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

using namespace std;

int main(){

  string s,k;

  while(1){

	cin>>s>>k;

	if(s == "0" && k == "0")
	  break;

	int hit=0;
	int blow=0;
	
	for(int i=0;i<4;++i){

	  if(s[i] == k[i])
		hit++;

	  else{
		for(int j=0;j<4;++j){

		  if(s[i]==k[j]){
			blow++;
			break;
		  }
		}
		
	  }
	
	}

	cout<<hit<<" "<<blow<<endl;
	
  }
}



Measured memory_bytes: 3156
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

int main() {
    int n;
    cin >> n;
    vector<int> c(n);
    for (auto &e: c) cin >> e;
    for (auto &e: c) {
        int t;
        cin >> t;
        e -= t;
    }

    sort(c.begin(), c.end());

    int ans = accumulate(lower_bound(c.begin(), c.end(), 0), c.end(), 0);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256