akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for( int i=a; i<b; i++ )
#define REP(i,n) rep(i,0,n)


 
int main(){
	int n, k; cin >> n >> k;
	vector<int> d(k);
	REP(i, k){ cin >> d[i]; }
	long long int out = n;
	while(1){
		long long int tmp = out;
		int jud = 1;
		while(0 < tmp){
			int digit = tmp%10;
			REP(i, k){
				if(digit == d[i]){ 
					jud = 0;
					break;
				}
			}
			tmp /= 10;
			if(jud==0){ break; }
		}
		if(jud==1){ break;}
		out++;
	}
	cout << out << endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
int Q;
LL a,b;
int main(){
  scanf("%d",&Q);
  while(Q--){
    scanf("%lld%lld",&a,&b);
    if(a==b) printf("%lld\n",a*2-2); else{
      if(a>b) swap(a,b);
      LL m=sqrt(a*b),t=(a*b-1)/m-1;
      printf("%lld\n",m-1+t);
    }
  }
  return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <cstdio>

using namespace std ;

const int N=1e5+10 ;

int f[N] , v[N] ;
inline int find ( int x ) { return f[x]==x?x:f[x]=find(f[x]); }

int n , m ;
int main ()
{
	int i , x , y , z , res=0 ;
	scanf("%d%d",&n,&m);
	for ( i=1 ; i<=n ; i++ ) f[i]=i;
	for ( i=1 ; i<=m ; i++ ) scanf("%d%d%d",&x,&y,&z),f[find(x)]=find(y);
	for ( i=1 ; i<=n ; i++ ) 
		if ( !v[find(i)] ) res++,v[find(i)]=1;
	printf("%d\n",res);
	return 0 ;
}

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

using namespace std;

int main(){
    int N;
    cin >> N;
    int N1 = N,N2 = N;
    int i=1;
    int sum = 0;
    while(N!=0){
        N = N / 10;
        i++;
    }
    for(int j=1;j<i;j++){
        sum += N1 % 10;
        N1 = N1 / 10;
    }

    cout << (N2 % sum ==0 ? "Yes" : "No") << endl;
}

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

int main() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    
    int min = a[0];
    int max = a[0];
    long sum = 0;
    
    for(int i = 0; i < n; i++){
        if(a[i] < min){
            min = a[i];
        }
        if(a[i] > max){
            max = a[i];
        }
        sum += a[i];
    }
    
    cout << min << " " << max << " " << sum << endl;
    return 0;
}



Measured memory_bytes: 3128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <cassert>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

int main() {
    string s, t;
    cin >> s >> t;
    
    vector<int> s_sum(SZ(s) + 1, 0), t_sum(SZ(t) + 1, 0);
    REP(i, SZ(s)) {
        if (s[i] == 'A') s_sum[i + 1] = s_sum[i] + 1;
        else s_sum[i + 1] = s_sum[i];
    }
    REP(i, SZ(t)) {
        if (t[i] == 'A') t_sum[i + 1] = t_sum[i] + 1;
        else t_sum[i + 1] = t_sum[i];
    }
    
    int q;
    cin >> q;
    REP(_, q) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        --a; --c;
        int s_a = s_sum[b] - s_sum[a];
        int s_b = b - a - s_a;
        int t_a = t_sum[d] - t_sum[c];
        int t_b = d - c - t_a;
        if (((s_a + s_b * 2) - (t_a + t_b * 2)) % 3) cout << "NO\n";
        else cout << "YES\n";
    }
    
    return 0;
}


Measured memory_bytes: 4308
N=int(input())
inf=float("inf")
data=[[inf,-inf,inf,-inf] for i in range(4)]
dic={ "U" : 0 , "D" : 1 , "R" : 2 , "L" : 3 }

for i in range(N):
    x,y,d=input().split()
    x,y=int(x),int(y)
    u=data[dic[d]]
    u[0]=min(u[0],x)
    u[1]=max(u[1],x)
    u[2]=min(u[2],y)
    u[3]=max(u[3],y)

a,b,c,d=data[0]
e,f,g,h=data[1]
i,j,k,l=data[2]
m,n,o,p=data[3]

a=min(a,e)
b=max(b,f)
k=min(k,o)
l=max(l,p)

if a==inf:
    a=-inf
    b=inf

time=[0]
time.append(a-i)
time.append(m-a)
time.append((m-i)/2)
time.append(b-j)
time.append(n-b)
time.append((n-j)/2)
time.append(k-c)
time.append(g-k)
time.append((g-c)/2)
time.append(l-d)
time.append(h-l)
time.append((h-d)/2)

ans=inf
for t in time:
    if 0<=t<=10**10:
        lst=[]
        for u in data:
            lst.append(u[:])
        lst[2][0]+=t
        lst[2][1]+=t
        lst[0][2]+=t
        lst[0][3]+=t
        lst[3][0]-=t
        lst[3][1]-=t
        lst[1][2]-=t
        lst[1][3]-=t
        
        lsls=[]
        for j in range(4):
            if j%2==0:
                m=inf
                for i in range(4):
                    m=min(m,lst[i][j])
                lsls.append(m)
            else:
                M=-inf
                for i in range(4):
                    M=max(M,lst[i][j])
                lsls.append(M)
        ans=min(ans,(lsls[1]-lsls[0])*(lsls[3]-lsls[2]))

print(ans)

Measured memory_bytes: 47448
#include <stdio.h>
#include <vector>

void output(std::vector<int>& arr)
{
  for (int i = 0; i < arr.size(); i++) {
    if (i == arr.size() - 1) {
      printf("%d\n", arr[i]);
    }
    else {
      printf("%d ", arr[i]);
    }
  }
}

void insertion_sort(std::vector<int>& arr)
{
  output(arr);
  for (int i = 1; i < arr.size(); i++) {
    int val = arr[i];
    int j = i - 1;
    while (j >= 0 && arr[j] > val) {
      arr[j + 1] = arr[j];
      j--;
    }
    arr[j + 1] = val;

    output(arr);
  }
}

int main()
{
  int N;
  std::vector<int> arr;

  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int temp;
    scanf("%d", &temp);
    arr.push_back(temp);
  }

  insertion_sort(arr);

  return 0;
}



Measured memory_bytes: 2668
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b;cin>>a>>b;
  cout << ((a*b)&1? "Odd":"Even")<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long H, long long N, vector<long long> A){
	ll c = 0;
	rep(i, N) {
		c += A[i];
	}
	if (c >= H) cout << "Yes" << endl; else cout  << "No" << endl;
}

int main(){	
	long long H;
	long long N;
	scanf("%lld",&H);
	scanf("%lld",&N);
	vector<long long> A(N-1+1);
	for(int i = 0 ; i <= N-1 ; i++){
		scanf("%lld",&A[i]);
	}
	solve(H, N, A);
	return 0;
}



Measured memory_bytes: 1792
#include<stdio.h>
int main(){
int W,H,x,y,r;
scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
if(r+x<=W&&r+y<=H&&x-r>=0&&y-r>=0){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}

Measured memory_bytes: 584
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map> 
#include <map> 
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
#include <random>
#include <bitset>
using namespace std;
typedef long long LL;

int main(void) {
	LL n, num, i, ans = 0, sum = 0;
	bool f = false;
	string aa;
	char a, q = '9';
	cin >> aa;
	if (aa.size() == 1) {
		cout << aa << endl;
	} else {
		ans = (aa.size() - 1) * 9;
		a = aa[0];
		num = a;
		ans += num;
		for (i = 1; i < aa.size(); i++) {
			if (aa[i] != q)f = true;
		}
		if (!f) {
			ans += 1;
		}
		cout << ans - 49 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
  a[i] -= (i+1)
a.sort()
m1 = a[n//2]
m2 = a[n//2-1]
ans1 = sum([abs(ele-m1) for ele in a])
ans2 = sum([abs(ele-m2) for ele in a])
print(min(ans1, ans2))

Measured memory_bytes: 26180
#include <stdio.h>
#include <math.h>
#include <iostream>
 
using namespace std;
 
int main() {
 
    int counter[101] = {0};
    int a;
    int MAX = 0;
    int i = 0;
     
    while (cin >> a) {
        counter[a]++;
    }
 
    for (int j = 1; j < 101; j++) {
        MAX = max(MAX, counter[j]);
    }
 
    for (int k = 1; k < 101; k++) {
        if (MAX == counter[k]) {
            cout << k << endl;
        }
    }
 
    return 0;
}

Measured memory_bytes: 1156
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int n;
typedef long long LL;
int main() {
	while(~scanf("%d", &n)) {
		int a = n % 10;//个位
		int b = (n % 100) / 10;//十位
		int c = (n % 1000) / 100;//百位
		int d = n / 1000;//千位
		if((a == b && b == c) || (b == c && c == d) || (a == b && b == c && c == d)) puts("Yes");
		else puts("No");
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define vvvel vector<vvel>
void mmin(int &a, int b) {
	a = min(a, b);
}
void mmax(int &a, int b) {
	a = max(a, b);
}
void sor(vel &v) {
	sort(v.begin(), v.end());
}
int ser(vel &v, int tan) {
	int si = v.size() - 1;
	if (tan == v[si]) {
		return si;
	}
	int lo = 0;
	int up = si;
	while (up - lo > 1) {
		int mi = (lo + up) / 2;
		if (v[mi] <= tan) {
			lo = mi;
		}
		else {
			up = mi;
		}
	}
	return lo;
}
signed main() {
	vel n(4);
	for (int i = 0; i < 4; i++) {
		cin >> n[i];
	}
	sort(n.begin(), n.end());
	vel x = { 1,4,7,9 };
	if (n == x) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, a, b) for(int i = (a), i_len = (b); i < i_len; ++i)

int main()
{
    double a, b, x;
    cin >> a >> b >> x;
    double s = x / a;
    //横a, 縦bの長方形の中で、面積がsになるようにする。
    double res = 0.0;
    double bar = a*b/2.0;
    if(s < bar) {
        double p = 2.0*s/b;
        //res = atan(b/p);
        //res = atan(a*b*b/x/2.0);
        res = M_PI/2 - atan(2*x/(a*b*b));
        //cout << "p :" << p << endl;
        //cout << "b :" << p*tan(res) << endl;
    }
    else {
        s -= bar;
        double h = s*2.0/a;
        // h = (s - bar)*2.0/a = (x/a - a*b/2.0)*2.0/a
        //res = atan((b - h)/a);
        res = atan(2.0*b/a - 2*x/(a*a*a));
    }
    cout << fixed << setprecision(10) << res * 180.0/M_PI << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e9;
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
template<typename T> void cmin(T &a, T b) { a = min(a, b); }
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

signed main() {
  int k, a, b;
  cin >> k >> a >> b;
  if (b - a <= 2) {
    cout << k + 1 << endl;
  } else {
    int ans = 1;
    rep(i, k) {
      if (ans < a) {
        ans++;
      } else if (i < k - 1) {
        ans += (b - a);
        i++;
      } else {
        ans++;
      }
    }
    cout << ans << endl;
  }

  return 0;
}


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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(long long i=(l);i<(r);i++)
#define dec(i, l, r)   for(long long i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int cum[1005][1005][2];
int sum[1005][1005][2];

inline int f(int i, int j, int fi, int fj, int k) {
    return sum[i+1][j+1][k]-sum[i+1][fj][k]-sum[fi][j+1][k]+sum[fi][fj][k];
}

int main() {
    std::ios::sync_with_stdio(false);
    int n, k;cin >> n >> k;
    map<pair<pair<int, int>, int>, int> st;

    inc(i, 0, n){
        int x, y;char c;cin >> x >> y >> c;
        int m = x/k + y/k;
        int cc = (c == 'W');
        if(m%2 != 0) cc = 1-cc;
        st[{{x%k, y%k}, cc}]++;
    }

    for(auto kv : st){
        cum[kv.fi.fi.fi][kv.fi.fi.se][kv.fi.se] += kv.se;
    }

    inc(i, 1, k+1){
        inc(j, 1, k+1){
            inc(l, 0, 2){
                sum[i][j][l] = sum[i][j-1][l] + sum[i-1][j][l] - sum[i-1][j-1][l] + cum[i-1][j-1][l];
            }
        }
    }

    int ans = 0;
    inc(i, 0, k+1){
        inc(j, 0, k+1){
            inc(l, 0, 2){
                int m = f(k-1, k-1, i, j, l) + f(i-1, j-1, 0, 0, l)
                       +f(k-1, j-1, i, 0, 1-l)+f(i-1, k-1, 0, j, 1-l);
                ans = max(ans, m);
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 22144
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<iostream>

using namespace std;



void Solution()
{
    int n = 0;
    double a[100];  // notice the definition.
    
    while (cin>>a[n])
    {
        n++;
    }
    
//    for (int i = 0; i < n - 1; i++)
//    {
//        for (int j = i + 1; j < n; j++)
//        {
//            if (a[i] < a[j])
//            {
//                double temp = a[i];          //swap
//                a[i] = a[j];
//                a[j] = temp;
//            }
//        }
//    }
    
    sort(a, a + n); //sorting as ascedning sequence
    
    //cout.setf(ios::fixed); //"setf" is used for “half-adjusting”
    //cout.precision(2);
    
//    cout<<a[0] - a[n - 1]<<endl;
    cout<<a[n - 1] - a[0]<<endl;
    
}

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

Measured memory_bytes: 1284
#include <iostream>
#include <cstdio>
#include <cctype>
#include <string>
#include <cstring>
using namespace std;

int main(int argc, char const *argv[])
{
    int n, x, count;
    while(true){
        cin >> n >> x;
        count = 0;
        if(n == 0 && x == 0) break;
        for(int i = 1; i <= n - 2; i ++){
            for(int j = i + 1; j <= n - 1; j ++){
                int k = x - i - j;
                if (j < k && k <= n){
                    count ++;
                }
            }
        }
        cout << count << endl;
    }
    return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const int INF=1e9;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  ll n,t;
  cin >> n >> t;
  ll ans=0;
  ll forw=0;
  rep(i,n){
    ll ti;
    cin >> ti;
    if(i==0)continue;
    ans+=min(t,ti-forw);
    forw=ti;
  }
  cout <<ans+t<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;

const int N=100005;

int n,a[N],c[N];

int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

int find(int x)
{
	int ans=0;
	while (x) ans^=c[x],x-=x&(-x);
	return ans;
}

void ins(int x)
{
	while (x<=n) c[x]^=1,x+=x&(-x);
}

int main()
{
	n=read();
	for (int i=1;i<=n;i++)
	{
		int x=read();
		if (x%3==2) {puts("No");return 0;}
		if (x%3==1) a[i]=x/3+1;
		else a[i]=-x/3;
	}
	for (int i=1;i<=n;i++)
	{
		int x=read();
		if ((x+2)/3!=abs(a[i])||x%3!=2) {puts("No");return 0;}
	}
	for (int i=1;i<=n;i++)
	{
		int x=read();
		if ((x+2)/3!=abs(a[i])||x%3==2) {puts("No");return 0;}
	}
	for (int i=1;i<=n;i++) if ((i&1)!=(abs(a[i]&1))) {puts("No");return 0;}
	int f1=0,f2=0;
	for (int i=1;i<=n;i+=2)
	{
		if (a[i]<0) f1^=1;
		f2^=find(n)^find(abs(a[i]));
		ins(abs(a[i]));
	}
	memset(c,0,sizeof(c));
	int f3=0,f4=0;
	for (int i=2;i<=n;i+=2)
	{
		if (a[i]<0) f3^=1;
		f4^=find(n)^find(abs(a[i]));
		ins(abs(a[i]));
	}
	if (f1!=f4||f2!=f3) {puts("No");return 0;}
	puts("Yes");
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include<math.h>
#include<numeric>
#include<iomanip>
#define rep(i, n) rep2(i,0,n)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define PI acos(-1);
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
//scanf("%d", &a); '\n'; cout << fixed << setprecision(10);

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	char c;
	cin >> c;
	string s = "abcdefghijklmnopqrstuvwxyz";
	rep(i,s.size()) {
		if (c == s[i]) {
			cout << s[i + 1]; return 0;
		}
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
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 inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a,b,c,d,e,f;
    cin >> a >> b >> c >> d >> e >> f;
    int wa = 1,su = 0;
    for(int i = 1; i*100 <= f; i++) {
        bool ok = false;
        for(int j = 0; a*j <= i; j++) {
            if((i-a*j)%b == 0) ok = true;
        }
        if(!ok) continue;
        int nsu = 0;
        for(int j = 1; 100*i+j <= f && j <= e*i; j++) {
            bool nok = false;
            for(int k = 0; c*k <= j; k++) {
                if((j-c*k)%d == 0) nok = true;
            }
            if(nok) nsu = j;
        }
        if((i*100+nsu)*su < (wa+su)*nsu) {
            wa = i*100;
            su = nsu;
        }
    }
    if(wa == 1) {
        cout << 100*a << " 0" << endl;
        return 0;
    }
    cout << wa+su << " " << su << endl;
}


Measured memory_bytes: 256
s = input()
ans,mod = [0]*13,10**9+7
if s[0]=="?": ans = [1]*10+[0]*3
else: ans[int(s[0])] = 1
for i in s[1:]:
    dp = [0]*13
    for j in range(13): dp[j*10%13] = ans[j]%mod
    dp+=dp
    if i=="?":
        for j in range(13): ans[j] = sum(dp[j+4:j+14])
    else:
        for j in range(13): ans[j] = dp[j+13-int(i)]
print(ans[5]%mod)

Measured memory_bytes: 3188
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author emli
 */


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

typedef unsigned long long ll;
class CMarks {
public:
    void solve(std::istream& cin, std::ostream& cout) {
		ios::sync_with_stdio(false);
        cin.tie(nullptr);
        ll n,k;

        cin >> n >> k;

        vector<ll> a(n);

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



        for(int i = k; i < n; i++){
            if (a[i] > a[i -k ]){
                cout << "Yes" << endl;
            }else {
                cout << "No" << endl;
            }
        }




	}
};


int main() {
	CMarks solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N;
  cin >> N;
  VI xs(N);
  REP(i,N) cin >> xs[i];
  SORT(xs);
  int M;
  cin >> M;
  VI ys(M);
  REP(i,M) cin >> ys[i];
  SORT(ys);

  int i = 0, j = 0;
  for(;j<M&&i<N;){
	if(xs[i] == ys[j]){
	  ++i;
	  ++j;
	}
	else{
	  ++i;
	}
  }
  cout << (j == M? "YES": "NO") << endl;

  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ld = long double;

int main()
{
	int N;
	cin >> N;
	vector<int> X(N), Y(N);
	for (int i = 0; i < N; i++) {
		cin >> X[i] >> Y[i];
	}
	if (N & 1) {
		puts("NA");
		return 0;
	}
	int posX = X[0] + X[N / 2], posY = Y[0] + Y[N / 2];
	bool ng = false;
	for (int i = 0; i < N / 2; i++) {
		int px = X[i] + X[i + N / 2], py = Y[i] + Y[i + N / 2];
		if (px != posX || py != posY) {
			ng = true;
			break;
		}
	}
	if (ng) {
		puts("NA");
		return 0;
	}
	cout << fixed << setprecision(8) << posX / 2.0 << ' ' << posY / 2.0 << endl;
	return 0;
}



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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
  
    int a, b;
    cin >> a >> b;
    
    if (max(a,b) > 8)
        cout << ":(\n";
    else
        cout << "Yay!\n";
    
    return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    for(int n; cin >> n, n;){
        vi w(n); for(auto& e : w) cin >> e;
        vector<vi> dp1(n + 1, vi(n + 1, false));
        rep(i, n + 1) dp1[i][0] = true;

        for(int j = 2; j <= n; j += 2){
            rep(i, n - j + 1){
                int& cur = dp1[i][j];
                for(int k = 2; k <= j; k += 2){
                    cur |= (dp1[i][k] & dp1[i + k][j - k]);
                }
                if(abs(w[i] - w[i + j - 1]) <= 1){
                    cur |= dp1[i + 1][j - 2];
                }
            }
        }

        vi dp2(n + 1, 0);
        int res = 0;
        rep(i, n){
            rep(j, 1, n - i + 1){
                if(not dp1[i][j]) continue;
                int& next = dp2[i + j];
                chmax(next, dp2[i] + j);
                chmax(res, next);
            }
            chmax(dp2[i + 1], dp2[i]);
        }

        cout << res << endl;
    }

    return 0;
}

Measured memory_bytes: 3288
def ask(ns):
#ジャッジ用コード
    N = 481939123 #ここの数字を変更

    NS = str(N)

    
    ns = str(ns)
    n = int(ns)

    if (n <= N and ns <= NS) or (n > N and ns > NS):
        print ("Y")
        return "Y"
    else:
        print ("N")
        return "N"


import sys

mode = 0 #mode = 1にすると自動ジャッジモードになります

for i in range(1,11):

    print ("?"+ " " + str(10**i), flush=True)

    if mode == 0:
        ret = input()
    else:
        ret = ask(10**i)

    if ret == "N":

        l = 10**(i-1)
        r = 10**i - 1

        while r - l != 1:

            m = (r+l) // 2

            print ("?"+ " " + str(m) + "0" , flush=True )

            if mode == 0:
                ret = input()
            else:
                ret = ask(str(m) + "0")

            if ret == "N":
                l = m
            else:
                r = m

        print ("! " + str(r), flush=True )
        sys.exit()

for i in range(1,11):

    print ("? "+ str(10**i - 1), flush=True)

    if mode == 0:
        ret = input()
    else:
        ret = ask(10**i-1)

    if ret == "Y":

        print ("! " + str(10 ** (i-1)) , flush=True )

        sys.exit()


Measured memory_bytes: 3528
#include<bits/stdc++.h>
using namespace std;
#define dint __int128
#define ll long long
#define fup(i,a,b) for(int i=a;i<b;++i)
#define upf(i,a,b) for(int i=a;i<=b;++i)
#define fdn(i,a,b) for(int i=a;i>b;++i)
#define dnf(i,a,b) for(int i=a;i>=b;++i)
#define hh putchar(10)
#define kg putchar(32)
inline ll read(){ll x,f=1;char a;while((a=getchar())<48||a>57)if(a=='-')f=-1;
for(x=a^48;(a=getchar())>47&&a<58;x=(x<<3)+(x<<1)+(a^48));return f*x;}

int a[100005];
void Main()
{
    int n,k;
    cin>>n>>k;
    fup(i,0,n)cin>>a[i];
    sort(a,a+n);
    int ans,sum;
    ans=sum=a[k-1]-a[0];
    fup(i,k,n)
    {
        sum=a[i]-a[i-k+1];
        ans=min(ans,sum);
    }
    cout<<ans;
}
int main()
{
    Main();
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()

typedef long long ll;
typedef long double ld;

int main(){
    ll N;
    cin >> N;
    ll A, B;
    vector<ll> a(N, 0);
    rep(i,N) cin >> a[i];
    sort(all(a),greater<ll>());
    A = a[0];
    ll tmp = a[1];
    rep(i,N){
        if(abs(a[0] /2 - tmp) > abs(a[0] /2 - a[i]) ){
            tmp = a[i];
        }
    }
    cout << a[0] << " " << tmp << endl;
}

Measured memory_bytes: 4036
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int a[200020];
int sum[200020] = { 0 };
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum[a[i]]++;
		sum[a[i]] += sum[a[i] - 1];
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (ans < sum[i]) {
			ans = sum[i];
		}
	}
	cout << n - ans << endl;
	return 0;
}


Measured memory_bytes: 1792
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define int long long
#ifndef FAST_IO
  #define IOS ios_base::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
#endif
#define ff first
#define ss second
#define endl "\n"
#define all(c) c.begin(),c.end()
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" "; cout<<endl;}
void solve(){
  int n;
  cin>>n;
  vector<int> v(n);
  for(auto &it:v)cin>>it;
  sort(all(v));
  cout<<abs(v[0]-v[n-1])<<endl;
}
int32_t main(){
   IOS;
   solve();
   //debug();
  #ifdef LOCAL_DEFINE
   cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
  #endif	
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const int INF = 10000;



int main(){
	int N,M,K;
	while(cin>>N){
		if(N==0)break;
		set<int>mem[101];
		REP(i,N){
			cin>>M;
			REP(j,M){
				int p;
				cin>>p;
				mem[i].insert(p);
			}
		}
		cin>>K;
		vector<int>L(K),res;
		REP(i,K)cin>>L[i];
		REP(i,N){
			bool flag=true;
			REP(j,K)if(mem[i].find(L[j])==mem[i].end())flag=false;
			if(flag)res.PB(i+1);
		}
		if(SZ(res)==1)cout<<res[0]<<endl;
		else cout<<-1<<endl;
	}
	return 0;
}

Measured memory_bytes: 1648
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <set>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

int main(void){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int ans;
    for (int i = n; i <= 999;i++){
        if(i%111==0){
            cout << i << endl;
            break;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <queue>
typedef long long ll;
using namespace std;

int main(void) {
  ll i, j, k, n, m, cnt = 0, ans = 0;
  scanf("%lld", &n);
  ll a[n], b[n];
  priority_queue<ll> q;
  for(i = 0; i < n; ++i) scanf("%lld", &a[i]), cnt += a[i];
  for(i = 0; i < n; ++i) scanf("%lld", &b[i]);
  for(i = 0; i < n; ++i) {
    if(a[i] >= b[i]) {
      cnt -= a[i], q.push(a[i] - b[i]);
    }
  }
  while(q.size() && cnt < 0) {
    cnt += q.top();
    q.pop();
    ans++;
  }
  for(i = 0; i < n; ++i) {
    if(a[i] < b[i]) {
      ans++;
      if(cnt < b[i]) {
        while(q.size() && cnt < b[i]) cnt += q.top(), q.pop(), ans++;
        cnt -= b[i];
      } else {
        cnt -= b[i];
      }
    }
  }
  if(!q.size() && cnt < 0) printf("-1");
  else printf("%lld", ans);
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < N; i++) {
    cin >> s[i];  
  }

  int M;
  cin >> M;
  vector<string> t(M);
  for (int i = 0; i < M; i++) {
    cin >> t[i];  
  }
  
  int m = 0;
  for (auto i = s.begin(); i != s.end(); i++) {
  	int profit = 0;
  	for (auto j = s.begin(); j != s.end(); j++) {
      if (*i == *j)
        profit++;
  	}
  	for (auto j = t.begin(); j != t.end(); j++) {
      if (*i == *j)
        profit--;
  	}
    if (profit > m)
      m = profit;
  }
  cout << m << endl;
}


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

int main() {
  // 左に傾くならLeft、釣り合うならBalanced、右に傾くならRightを出力
  int L, R, A, B, C, D;
  cin >> A >> B >> C >> D;
  //A = 1, B = 7, C = 6, D = 4;
  
  L = A + B;
  R = C + D;

  	if  (L > R) {
      cout << "Left" << endl;
  	}
  	else  if (L == R){
      cout << "Balanced" << endl;
	}
	else{
      cout << "Right" <<endl;
    }
} 

Measured memory_bytes: 3576
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
   int n; cin>>n;
   long long ans=0;
   for(int i=1;i<=n;i++){
      if(i%3!=0 && i%5!=0) ans+=i;
   }
   cout<<ans<<endl;
   return 0;
}



Measured memory_bytes: 3600
import java.util.Scanner;
public class Main{
	int furo,puru;
	int fken,pken;
	int niti;
	int ryo;
	int gokei;
	int wgokei;
	
	public void solve(){
		Scanner sc = new Scanner(System.in);
		niti = sc.nextInt();
		for(int i=0;i<niti;i++){
			furo = sc.nextInt();
			puru = sc.nextInt();
			fken = sc.nextInt();
			pken = sc.nextInt();
			gokei = furo*fken+puru*pken;
			if(fken<5){
				fken = 5;
			}
			if(pken<2){
				pken = 2;
			}
			wgokei=(furo*fken+puru*pken)/10*8;
			if(gokei>wgokei){
				System.out.println(wgokei);
			}else{
				System.out.println(gokei);
			}
		}
	}
	public static void main(String[] args){
		Main obj = new Main();
		obj.solve();
	}
}

Measured memory_bytes: 23284
#include <stdio.h>

int main() {
    int x,y;
    int t;
    for (;;){
        scanf("%d %d",&x,&y);
        if(x == 0 && y==0) break;
        
        if(x>y) t = x, x=y, y = t;
        printf("%d %d\n",x,y);
    }
    
    
    return 0;
}




Measured memory_bytes: 2580
/* vo00_07.cpp */
#include <iostream>
using namespace std;

int main()
{
	double debt = 100000;

	int n;
	cin >> n;
	
	while (n--) {
		debt *= 1.05;
		debt /= 1000;

		debt += 0.999;

		int t1 = debt;
		double t2 = debt - t1;
		debt -= t2;

		debt *= 1000;
	}

	cout << (int)debt << '\n';

	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <string>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
using namespace std;

int main(void){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int x;
  cin >> x;
  if(x>=30){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

  return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> llVEC;
typedef vector<P> PVEC;
typedef priority_queue<P,PVEC,greater<P> > PPQ;
typedef priority_queue<ll, llVEC, greater<ll> > llPQ;

#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n-1; i >= a;i--)
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

template<typename T>
ll sz(vector<T> &vec){ return (ll)vec.size(); }
ll sz(string &s){ return (ll)s.size(); }
ll gcd(ll a,ll b){ return ((!b) ?a :gcd(b, a%b)); }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b; }
bool checkindex(ll i,ll n){ return (i < n && i >= 0); }


struct unionfind {
    vector<int> par;
    vector<int> sizes;

    unionfind(int n) : par(n),sizes(n,1){
        rep(i,0,n) par[i] = i;
    }

    int root(int x){
        if(par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x,int y){
        x = root(x);
        y = root(y);

        if(x == y) return;

        if(sizes[x] < sizes[y] ) swap(x,y);

        par[y] = x;
        sizes[x] += sizes[y];
        sizes[y] = 0;

        return;
    }

    bool same(int x,int y){
        return root(x) == root(y);
    }

    int size(int x){
        return sizes[root(x)];
    }
};


int main(){
    ll n,m;
    cin >> n >> m;
    unionfind uf(n);

    ll a,b,ans = 0;
    rep(i,0,m){
        cin >> a >> b;
        a--;b--;
        uf.unite(a,b);
    }

    rep(i,0,n){
        ans = max(ans,(ll)uf.size(i));
    }

    cout << ans << endl;

}


Measured memory_bytes: 4832
using System;
using System.Linq;
using static System.Console;

namespace A
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var input = ReadLine().Split(' ').Select(int.Parse).ToList();
            for (var i = 0; i < input.Count; i++)
            {
                if (input[i] != 0) continue;
                WriteLine(i + 1);
                break;
            }
        }
    }
}

Measured memory_bytes: 28256
import numpy as np

n = int(input())
h = list(map(int, input().split(" ")))

h = np.array(h)

count = 0
while(sum(h) != 0):
    s = 200
    e = n
    for i in range(n):
        if(s == 200):
            if(h[i] != 0): s = i
        elif(h[i] == 0):
            e = i
            break

    count += min(h[s:e])
    h[s:e] -= min(h[s:e])

print(count)

Measured memory_bytes: 18856
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}

int main() {
	char x, y;
	cin >> x >> y;
	if ((x - 'A') < (y - 'A')) {
		cout << "<";
	}
	if ((x - 'A') > (y - 'A')) {
		cout << ">";
	}
	if ((x - 'A') == (y - 'A')) {
		cout << "=";
	}
}

Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())

list1 = []
list1.append(A)
list1.append(B)
list1.append(C)
list1.append(D)

list2 = []
list2.append(E)
list2.append(F)

for i in range(4):
    for j in range(3,0,-1):
        if list1[j-1]<list1[j]:
            list1[j-1],list1[j] = list1[j],list1[j-1]

if list2[0]<list2[1]:
    list2[0],list2[1] = list2[1],list2[0]

sumlist = []
sumlist.append(list1[0])
sumlist.append(list1[1])
sumlist.append(list1[2])
sumlist.append(list2[0])

print(sum(sumlist))


Measured memory_bytes: 5612
import math
n=int(input())
ans=0
for i in range(1,int(math.sqrt(n))+1):
    for j in range(i,(n-1)//i+1):
        k=n-i*j
        if k>0:
          if i==j:
            ans+=1
          else:
            ans+=2
print(ans)

Measured memory_bytes: 9176
#set
n = gets.chomp.to_i
pair_arr = Array.new
arr_count = 0
limit = 0
min_sum = n + 1
temp_sum = 0
arr_address = 0
answer = 0

#main
limit = Math.sqrt(n).to_s.split(".").map(&:to_i)
1.upto(limit[0]) do |i|
  if n % i == 0 then
    pair_arr[arr_count] = i
    arr_count += 1
  end
end

0.upto(arr_count - 1) do |x|
  temp_sum = pair_arr[x] + (n / pair_arr[x])
  if temp_sum <= min_sum then
    min_sum = temp_sum
  end
end
answer = min_sum - 2
print ("#{answer}\n")

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

int mod = 1e9 + 7;

long long modpow(long long x, long long y){
    if (y == 0) return 1;
    if (y % 2) return x * modpow(x, y - 1) % mod;
    long long res = modpow(x, y / 2);
    return res * res % mod;
}

int main()
{
    int n, k;
    cin >> n >> k;
    vector<long long> tmp(k + 1, 0);
    for (int i = k; i > 0; i--)
    {
        tmp[i] = modpow(k / i, n);
        for (int j = 2; j < 1e9; j++)
        {
            if (i * j > k) break;
            tmp[i] += mod - tmp[i * j];
            tmp[i] %= mod;
        }
    }
    long long ans = 0;
    for (int i = 1; i <= k; i++) {
        ans += i * tmp[i] % mod;
        ans %= mod;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3996
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;
//const ll MOD=998244353;

int main(){
  int A[32]={1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51};
  int K; cin>>K; K--;
  cout<<A[K]<<endl;
  return 0;
}

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

const long double INF = 1e9;

int n;
long double x[1005], y[1005], dp[1005][1005];

long double dist(int i, int j) {
    return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}

int main() {

    cin >> n;
    for (int i = 0;  i < n; i++) {
        cin >> x[i] >> y[i];
    }

    dp[1][0] = dist(0, 1);
    for (int i = 2; i < n; i++) {
        dp[i][i-1] = INF;
        for (int j = 0; j + 1 < i; j++) {
            dp[i][j] = dp[i-1][j] + dist(i - 1, i);
            dp[i][i-1] = min(dp[i][i-1], dp[i-1][j] + dist(j, i));
        }
    }

    long double ans = INF;
    for (int j = 0; j + 1 < n; j++) {
        ans = min(ans, dp[n-1][j] + dist(n-1, j));
    }

    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}

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

int main(){
    int n,l;
    cin>>n>>l;
    int L=l;
    int R=l+n-1;

    int eat;
    if(R<=0) eat=R;
    else if(L>=0) eat=L;
    else eat=0;

    cout<<(R+L)*(R-L+1)/2-eat<<endl;
}

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

using namespace std;

void solve();

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

void solve() {
    int Q;
    cin >> Q;
    int l[Q],r[Q];
    for(int i = 0; i < Q; i++) {
        cin >> l[i] >> r[i];
    }
    bool isPrime[100001];
    for(int i = 0; i < 100001; i++) {
        isPrime[i] = true;
    }
    isPrime[0] = false;
    isPrime[1] = false;
    isPrime[2] = true;
    for(int i = 0; i < 100001; i++) {
        if(isPrime[i]) {
            for(int j = i + i; j < 100001; j += i) {
                isPrime[j] = false;
            }
        }
    }
    bool isNum[100001];
    for(int i = 0; i < 100001; i++) {
        isNum[i] = false;
    }

    for(int i = 3; i < 100001; i += 2) {
        if(isPrime[i] && isPrime[(i+1) / 2]) {
            isNum[i] = true;
        }
    }

    int sAr[100001];
    for(int i = 0; i < 100001; i++) {
        sAr[i] = 0;
        if(isNum[i]) sAr[i] = 1;
    }

    for(int i = 0; i < 100000; i++) {
        sAr[i+1] += sAr[i]; 
    }

    for(int i = 0; i < Q; i++) {
        cout << sAr[r[i]] - sAr[l[i]-1] << endl;
    }




}

Measured memory_bytes: 2048
import java.io.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str=br.readLine();
String[] arr=str.split(" ");
int a=Integer.parseInt(arr[0]);
int b=Integer.parseInt(arr[1]);
int d=a/b;
int r=a%b;
double f=(double)a/b;
System.out.printf(d+" "+r+" "+"%f",(double)f);
br.close();
}
}

Measured memory_bytes: 24800
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

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

    int n, m;
    cin >> n >> m;

    int sum = 0;
    vector <int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }

    sort(a.begin(), a.end(), greater<int>());

    if (a[m - 1] * 4 * m < sum) {
        cout << "No\n";
    } else {
        cout << "Yes\n";
    }

    return 0;
}

Measured memory_bytes: 888
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using PP = pair<P, int>;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> s(n + 1), t(n + 1), p(n + 1);
    for(int i = 1; i <= n; i++) cin >> s[i] >> t[i] >> p[i];
    vector<vector<int>> dp(400, vector<int>(400, 0));
    for(int i = 1; i <= n; i++)
    {
        for(int j = 0; j < 400; j++)
        {
            for(int k = 0; k * s[i] <= j; k++)
            {
                dp[i][j] = max(dp[i][j], dp[i - 1][j - k * s[i]] + k * p[i]);
            }
            for(int k = 0; k * t[i] <= j; k++)
            {
                dp[i][j] = max(dp[i][j], dp[i - 1][j - k * t[i]] + k * p[i]);
            }
        }
    }
    int m; cin >> m;
    vector<int> ans;
    bool flag = false;
    for(int i = 0; i < m; i++)
    {
        int w; cin >> w;
        ans.push_back(dp[n][w]);
        if(dp[n][w] == 0) flag = true;
    }
    if(flag) cout << -1 << endl;
    else for(int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
    return 0;
}




Measured memory_bytes: 3676