akhauriyash/Code-Regression huggingface dataset:
// In the name of God
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <assert.h>
#include <bitset>
#define sqr(a) (a)*(a)
#define all(a) (a).begin(), (a).end()
using namespace std;

template <typename T>
T next_int() {
    T x = 0, p = 1;
    char ch;
    do { ch = getchar(); } while(ch <= ' ');
    if(ch == '-') {
        p = -1;
        ch = getchar();
    }
    while(ch >= '0' && ch <= '9') {
        x = x * 10 + (ch - '0');
        ch = getchar();
    }
    return p * x;
}

string next_token() {
    char ch;
    string ans = "";
    do { ch = getchar(); } while(ch <= ' ');
    while((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {
        ans += ch;
        ch = getchar();
    }
    return ans;
}
    
const long long INF = (long long)1e18;
const int INFINT = (int)1e9 + 227 + 1;
const int MAXN = (int)1e5 + 227 + 1;    
const int MOD = (int)1e9 + 7;
const long double EPS = 1e-9;

long long Pow(long long a, long long b) {
    if(!b) return 1;

    long long ans = Pow(a, b / 2);

    ans = ans * ans % MOD;

    if(b % 2) ans = ans * a % MOD;

    return ans;
}

int main() {
    // freopen(".in", "r", stdin);

    string a; cin >> a;

    string b, c;
    bool ok = 0;
    for(int i = 0; i < 12; i++) {
        if(ok == 0) b += a[i]; else c += a[i];
        if(i == 3) ok = 1;
    }

    cout << b << " " << c << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int n, h, a, b, c, ans;
bool p[3][501][501]; //xy = 0, xz = 1, yz = 2;

void calc(){
  switch(a){
  case 0:
    for(int i=1;i<=n;++i){
      if(p[1][b][i] || p[2][c][i]) ++ans;
    }
    break;
  case 1:
    for(int i=1;i<=n;++i){
      if(p[0][b][i] || p[2][i][c]) ++ans;
    }
    break;
  case 2:
    for(int i=1;i<=n;++i){
      if(p[0][i][b] || p[1][i][c]) ++ans;
    }
    break;
  }
}

main(){
  while(cin >> n >> h && (n || h)){
    fill(p[0][0], p[3][0], false);
    ans = n*n*n - h*n;
    for(int i=0;i<h;++i){
      string input;
      cin >> input;
      cin >> b >> c;
      if(input == "xy"){
	a = 0;
      }else if(input == "xz"){
	a = 1;
      }else{
	a = 2;
      }
      if(p[a][b][c]) continue;
      p[a][b][c] = true;
      calc();
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 0
a, b, c, x = map(int, [input() for i in range(4)])
count = 0
for i in range(a + 1):
    if 500 * i == x:
        count += 1
        break
    elif 500 * i > x:
        break
    else:
        for j in range(b + 1):
            if 500 * i + 100 * j == x:
                count += 1
                break
            elif 500 * i + 100 * j > x:
                break
            else:
                for k in range(c + 1):
                    if 500 * i + 100 * j + 50 * k == x:
                        count += 1
                        break
print(count)

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

int main(){
  int n;
  cin >> n;
  int a[n];
  rep(i,n) cin >> a[i];
  ll ans = 1;
  int r = 0, g = 0, b = 0;
  rep(i,n) {
    if(!(r == a[i] || g == a[i] || b == a[i])) {
      cout << 0 << endl;
      return 0;
    } else {
      if(r == a[i] && g == a[i] && b == a[i]) {
        ans = (ans * 3) % mod;
        r++;
      } else if(r == a[i] && g == a[i] && b != a[i]) {
        ans = (ans * 2) % mod;
        r++;
      } else if (r == a[i]) {
        r++;
      } else if(g == a[i] && b == a[i]) {
        ans = (ans * 2) % mod;
        g++;
      } else if(g == a[i]) {
        g++;
      } else {
        b++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _20170409_AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] iArr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            IEnumerable<int> query = iArr.OrderBy(x => x);
            for(int i=0; i< query.Count() - 1; i++)
            {
                Console.Write(query.ElementAt(i));
                Console.Write(' ');
            }
            Console.WriteLine(query.Last());

            Console.ReadLine();
        }
    }
}

Measured memory_bytes: 10116
//
//  main.cpp
//  atcoder94
//
//  Created by cfhaiteeh on 2018/4/14.
//  Copyright © 2018 cfhaiteeh. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#define LL long long
using namespace std;
const int maxn=2*123456;
struct he{
    int val;
    int id;
}edge[maxn];
int bi[maxn];
int n;
bool cmp(he a,he b){
    return a.val<b.val;
}

void init(){
    for(int i=1;i<=n;i++){
        scanf("%d",&edge[i].val);
        edge[i].id=i;
      
    }
}
int ans;
void play(){
    sort(edge+1,edge+1+n,cmp);
    for(int i=1;i<=n/2;i++){
        bi[edge[i].id]=edge[n/2+1].val;
    }
    for(int i=n/2+1;i<=n;i++){
        bi[edge[i].id]=edge[n/2].val;
    }
}
void pri(){
    for(int i=1;i<=n;i++)printf("%d\n",bi[i]);
}
int main() {
    // insert code here...
    while(scanf("%d",&n)!=EOF){
        init();
        play();
        pri();
    }
    return 0;
}


Measured memory_bytes: 4480
#include<bits/stdc++.h>
using namespace std;
string s,t;
set<int>x[26],y[26];
int main(){
	cin>>s>>t;
	for(int i=0;i<s.size();i++)
		x[s[i]-'a'].insert(t[i]-'a'),
		y[t[i]-'a'].insert(s[i]-'a');
	for(int i=0;i<26;i++)
		if(x[i].size()>1||y[i].size()>1)
		{
			cout<<"No";
			return 0;
		}
	cout<<"Yes";
}

Measured memory_bytes: 776
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
4 150
150 140 100 200
---+/
/+---test
1 500
499
---+/
/+---test
5 1
100 200 300 400 500
---+/

void main(string[] args) {
  int N, K;
  readf(" %d %d ", &N, &K);

  const heights = readln.split.map!(to!int).array;
  heights.count!(x => x >= K).writeln;
}


Measured memory_bytes: 3792
import fractions

n=int(input())
A=list(sorted(map(int,input().split())))
L=[A[0]]
R=[A[n-1]]

for i in range(n-2):
    L.append(fractions.gcd(L[i],A[i+1]))
    R.append(fractions.gcd(R[i],A[n-i-2]))

ans=1
for i in range(n):
    if i==0:
        ans=max(R[n-2],ans)
    elif i==n-1:
        ans=max(L[n-2],ans)
    else:
        l=L[i-1]
        r=R[n-i-2]
        ans=max(fractions.gcd(l,r),ans)
print(ans)

Measured memory_bytes: 95712
#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>
#include <climits>

using namespace std;

int main() {
    string s;
    cin >> s;
    int r=0,b=0;
    for(int i=0; i<s.size(); i++) {
        if(s[i] == '0') r++;
        if(s[i] == '1') b++;
    }
    cout << 2 * min(r, b) << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define sz(x) (int((x).size()))
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
template<typename T> bool domax(T &a, T b) { return (b > a ? (a = b, true) : false); }
template<typename T> bool domin(T &a, T b) { return (b < a ? (a = b, true) : false); }
typedef long long ll;

ll A, B, C;

int main() {
    scanf("%lld%lld%lld", &A, &B, &C);
    if (A%2 == 0 || B%2 == 0 || C%2 == 0) printf("0\n");
    else printf("%lld\n", std::min(std::min(A*B, B*C), A*C));
}


Measured memory_bytes: 256
#include<iostream>
int main(){
	using namespace std;
	int a;
	int height[10];
	int i = 10;
	int tmp;

	while(i){
		cin>>a;
		height[10-(i--)]=a;
	}

	for(int j=0;j<9;j++){
		for(int k=j+1;k<10;k++){
			if(height[j]<height[k]){
				tmp = height[j];
				height[j] = height[k];
				height[k] = tmp;
			}

		}
	}

	cout<<height[0]<<endl;
	cout<<height[1]<<endl;
	cout<<height[2]<<endl;

    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
 typedef long long ll;
 
int main() {
char b;
cin>>b;

if(b=='A')cout<<'T'<<endl;
else if(b=='T')cout<<'A'<<endl;
else if(b=='C')cout<<'G'<<endl;
else cout << 'C'<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

//Revenge of Champernowne Constant
public class Main{

	long DIGIT_LIMIT = 1000000000000000000L;
	long MAX_NUMBER = 59477124183006535L;
	long[] endK;
	long[] ten;
	
	void init(){
		endK = new long[20];
		endK[0] = 0;
		long num = 9;
		for(int k=1;k<=17;k++,num*=10){
			endK[k] = endK[k-1]+k*num;
		}
		endK[18] = DIGIT_LIMIT;
		endK[0] = -1;
		ten = new long[20];
		ten[0] = 0;
		ten[1] = 10;
		for(int k=2;k<=17;k++)ten[k]=ten[k-1]*10;
	}
	
	long findNumber(long x){
		if(x<=0||MAX_NUMBER<x)return DIGIT_LIMIT;
		if(x<10)return x;
		int k = (x+"").length()-1;
		return endK[k]+1+(k+1)*(x-ten[k]);
	}
	
	long findString(String target){
		boolean allzero = true;
		for(char ch:target.toCharArray())allzero&=ch=='0';
		if(allzero)return findNumber(Long.parseLong("1"+target))+1;
		int len = target.length();
		if(len==1){
			return findNumber(Long.parseLong(target));
		}
		long res = DIGIT_LIMIT;
		int lenMax = Math.min(17, len);
		for(int h=0;h<lenMax;h++)for(int k=1;k<=lenMax;k++)res = Math.min(res, findStringSub(target, h, k));
		return res;
	}
	
	long findStringSub(String target, int h, int k){
		if(target.charAt(h)=='0')return DIGIT_LIMIT;
		String sub = target.substring(0, h);
		String s = "";
		for(int i=h;i<h+k;i++){
			if(i<target.length())s+=target.charAt(i);
			else {
				int L = h+k-i;
				String r = (Long.parseLong(sub.substring(sub.length()-L))+1)+"";
				while(r.length()-L<0)r="0"+r;
				s+=r.substring(r.length()-L); break;
			}
		}
		long base = Long.parseLong(s);
		if(MAX_NUMBER<base)return DIGIT_LIMIT;
		String match = base+"";
		int pos = h, addLen = 0;
		long b = base-1;
		while(pos>0){
			if(b<=0)return DIGIT_LIMIT;
			String add = b-- +"";
			pos-=add.length();
			addLen+=add.length();
			match = add+match;
		}
		b = base+1;
		pos = h+k;
		while(pos < target.length()){
			String add = b++ +"";
			pos+=add.length();
			match+=add;
		}
		for(int i=0;i<target.length();i++)if(target.charAt(i)!=match.charAt(addLen-h+i))return DIGIT_LIMIT;
		return findNumber(base)-h;
	}
	
	void run(){
		init();
		Scanner sc = new Scanner(System.in);
		for(;;){
			String s = sc.next();
			if("#".equals(s))break;
			System.out.println(findString(s));
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll read(){
	ll a=0,b=getchar(),c=1;
	while(!isdigit(b))c=b=='-'?-1:1,b=getchar();
	while(isdigit(b))a=a*10+b-'0',b=getchar();
	return a*c;
}
ll n,ans=1e15;
int main(){
	n=read();
	for(ll i=1;i*i<=n;i++)
		if(n%i==0)ans=min(ans,n/i+i-2);
	cout << ans;
    return 0;
}

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

using namespace std;

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

  int n,var=0;cin>>n;
  int a[100001]={0};
  for(int i=0;i<n;i++){
      int num;cin>>num;
      a[num]++;
  }
  for(int i=0;i<100001;i++) if(a[i]) var++;
  if((n-var)%2) cout<<var-1<<endl;
  else cout<<var<<endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

int main() {
    int k;
    int arr[] = {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};
    cin >> k;
    cout << arr[k-1] << '\n';
    return 0;
}

Measured memory_bytes: 256
import sys
import numpy as np

input = sys.stdin.buffer.readline
N = int(input())
A = np.array(list(map(int, input().split())))

MOD = 10**9 + 7

answer = 0
for n in range(63):
    B = (A >> n) & 1
    x = np.count_nonzero(B)
    y = N - x
    x *= y
    for _ in range(n):
        x = x * 2 % MOD
    answer += x
answer %= MOD
print(answer)


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

using namespace std;
typedef long long ll;

ll ans = 0;
string s;

int main()
{
    string s;
    cin >> s;
    string ans = "";
    for (auto& c : s)
    {
        if (c == 'B')
        {
            if (!ans.empty()) ans = string(ans.begin(), ans.end() - 1);
        }
        else ans += c;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>

using namespace std;


int main()
{
	int n;
	while(cin>>n,n){

		vector<long> t(24*3600+1,0);
		long res=0;

		for(int i=0;i<n;i++){
			string s;
			cin>>s;

			long a;
			a=((long)(s[0]-'0')*10+(long)(s[1]-'0'))*3600;
			a+=((long)(s[3]-'0')*10+(long)(s[4]-'0'))*60;
			a+=((long)(s[6]-'0')*10+(long)(s[7]-'0'));
			t[a]++;

			cin>>s;
			long b;
			b=((long)(s[0]-'0')*10+(long)(s[1]-'0'))*3600;
			b+=((long)(s[3]-'0')*10+(long)(s[4]-'0'))*60;
			b+=((long)(s[6]-'0')*10+(long)(s[7]-'0'));
			t[b]--;


		}

		for(long i=1;i<t.size();i++) t[i]+=t[i-1];
		for(long i=0;i<t.size();i++) res=max(res,t[i]);
		cout<<res<<endl;

	}

	return 0;
}

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

typedef long long ll;

static const int MAX = 510000;
static const int NIL = -1;
static const ll INF = 1<<21;
static const ll MOD = 1e9 + 7;

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

bool compPair(const pair<int, int>& arg1, const pair<int, int>& arg2) {
    return arg1.first > arg2.first;
}

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

int main(void) {
    ll N, M, K;
    cin >> N >> M >> K;

    COMinit();

    ll X=0, Y=0, addx, addy, ans;
    for(int d=1;d<N;d++) {
        addx = ((N-d)*M*M)%MOD;
        addx *= d%MOD;
        addx %= MOD;
        X += addx;
        X %= MOD;
    }

    for(int d=1;d<M;d++) {
        addy = ((M-d)*N*N)%MOD;
        addy *= d%MOD;
        addy %= MOD;
        Y += addy;
        Y %= MOD;
    }

    X *= COM(N*M-2, K-2);
    X %= MOD;
    Y *= COM(N*M-2, K-2);
    Y %= MOD;

    ans = X + Y;
    ans %= MOD;

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


Measured memory_bytes: 12160
#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
#include <fenv.h>
#include <algorithm>
#include <cstdio>

using namespace std;

void solve(long x,long y)
{
	int count=0;
	while(x <=y){
		x*=2;
		count++;
	}
	cout << count << endl;
}
int main()
{
	long x,y; cin >> x >> y;
//	long x = 3,y=20;
//	x= 25,y=100;
//	x=314159265,y=358979323846264338;
	solve(x,y);

	 return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

vector<pair<ll, int>> factorize(ll n) {
    vector<pair<ll, int>> res;
    for (ll i = 2; i*i <= n; ++i) {
        if (n%i) continue;
        res.emplace_back(i,0);
        while (n%i == 0) {
            n /= i;
            res.back().second++;
        }
    }
    if (n != 1) res.emplace_back(n,1);
    return res;
}

int main() {
    ll a,b;
    cin >> a >> b;
    ll g = gcd(a,b);
    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <iomanip>


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define rep(i, a, b) for (int i=a; i<(b); i++)
#define rp(i, a) for (int i=0; i<(a); i++)
#define repd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rpd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy

ll c[3][3];
ll a[3];
ll b[3];

bool check(){
  rp(i,3)
    rp(j,3){
      if(c[i][j] != a[i] + b[j])
      return false;
    }
  return true;
}


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << std::setprecision(9);
    cout << std::fixed;

    rp(i,3) rp(j,3) cin >> c[i][j];

    rp(i,101){
      a[0] = i;
      a[1] = a[0] + c[1][0] - c[0][0];
      a[2] = a[0] + c[2][0] - c[0][0];
      b[0] = c[0][0] - a[0];
      b[1] = c[0][1] - a[0];
      b[2] = c[0][2] - a[0];
      if(check()){
        cout << "Yes"<<endl; return 0;
      }
    }

    cout << "No" << endl;

    return 0;
}

// read the question correctly (ll vs int)
// template by super1 derived from bqi343


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

int main(){
    string s,t;
    cin>>s>>t;
    sort(s.begin(), s.end());
    sort(t.rbegin(), t.rend());
    puts(s<t?"Yes":"No");
    return 0;
}


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

using namespace std;

int main(void){
  string input;
  string tmp;
  int a[30] = {0};
  while(true){
    getline(cin, tmp);
    if(tmp == "") break;
    input += tmp;
  }
  for(int i = 0;i < input.size();++i){
    char c = input[i];
    if(c >= 65 && c <= 90){
      a[c - 65]++;
    }else if(c >= 97 && c <= 122){
      a[c - 97]++;
    }
  }

  for(int i = 0;i < 26;++i){
    char k = i + 97;
    cout << k << " : " << a[i] << endl;
  }

  return 0;
}



Measured memory_bytes: 3208
#include <cstdio>

using namespace std;

int main() {
    while (true) {
        size_t H, W;
        scanf("%zu %zu", &H, &W);

        if (!W && !H)
            return 0;

        for (size_t i=0; i<H; ++i) {
            for (size_t j=0; j<W; ++j)
                printf("#");

            printf("\n");
        }

        printf("\n");
    }
}

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

using namespace std;

#define DUMP(x) std::cout << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()

using ll = std::int64_t;
using vint = std::vector<int>;
using vll = std::vector<ll>;
using pint = std::pair<int, int>;

constexpr std::int32_t INF = 1001001001;

void Main() {
    int n;
    cin >> n;
    vint h(n);
    rep(i, n) cin >> h[i];

    int cnt = 0;
    int ans = 0;
    rep(i, n - 1) {
        if (h[i] >= h[i + 1]) ++cnt;
        else cnt = 0;

        if (cnt > ans)ans = cnt;
    }
    cout << ans << endl;
}

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



Measured memory_bytes: 640
#include<cstdio>
using namespace std;
const int maxn=100005;
int n,m,a[maxn],b[maxn],ans;
inline char nc(){
	static char buf[100000],*p1,*p2;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read(){
	int ret=0;bool f=0;char ch=nc();
	while(ch>'9'||ch<'0') f^=ch=='-',ch=nc();
	while(ch<='9'&&ch>='0') ret=ret*10+ch-'0',ch=nc();
	return f?-ret:ret;
}
int main(){
	n=read(),m=read();
	for (int i=1;i<=n;i++) a[i]=1,b[i]=i==1;
	for (int i=1;i<=m;i++){
		int x=read(),y=read();
		a[x]--,a[y]++;
		if(b[x]) b[y]=1;
		if(!a[x]) b[x]=0;
	}
	for (int i=1;i<=n;i++) ans+=!!b[i];
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>

int answer(int W,int H,int x,int y,int r);

int main(void){
	int num=0;
    int a,b,c,d,e;
    
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    scanf("%d",&d);
    scanf("%d",&e);
	num=answer(a,b,c,d,e);
	
	switch(num){
	case 1:
	printf("Yes\n");
	break;
	case 2:
	printf("No\n");
	break;
	case 3:
	printf("-100<=x,y<=100,0<W,H,r<=100の整数を入力して下さい\n");
	break;
	}
    return 0;
}

int answer(int W,int H,int x,int y,int r){
    
	if(-100>x || x>100 || -100>y || y>100 || 0>=W || 0>=H || 0>=r || W>100 || H>100 || r>100){
	return 3;
	}else if(r>x || r>y || x+r>W || y+r>H){
	return 2;
	}else{
	return 1;
	}
}

Measured memory_bytes: 584
s = input()
ans = 0

for i in range(2 ** (len(s)-1)):
  split = [0]
  for j in range(len(s)-1):
    if (i >> j) & 1:
      split.append(j+1)
  split.append(len(s))
  for i in range(len(split)-1):
    ans += int(s[split[i]:split[i+1]])
print(ans)
      


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

int mod(long long x) {
    return x % 1000000007;
}
 
int main() {
  int n;
  cin >> n;
  
  long long p = 1;
  
  for (int i = 1; i <= n; i++) {
    p *= i;
    p = mod(p);
  }
  
  cout << p;
}

Measured memory_bytes: 3492
#include <cstdio>
#include <cstring>
#include <set>
using namespace std;

typedef int INT;
set <INT> S;

inline INT get( char c ) {
    char T[5] = "ACGT";
    for ( INT i = 0; i < 4; ++ i ) {
        if ( c == T[i] ) return i + 1;
    }
    return 0;
}

inline INT get( char *s ) {
    INT n = strlen( s );
    INT sum = 0;
    INT t = 1;
    for ( INT i = 0; i < n; ++ i ) {
        sum += get( s[i] ) * t;
        t *= 4;
    }
    return sum;
}

inline void insert( char *s ) {
    S.insert( get( s ) );
}

inline bool find( char *s ) {
    return S.count( get( s ) ) > 0;
}

int main() {
    INT n, sum, t, c;
    while ( scanf("%d", &n) != EOF ) {
        while ( getchar() != '\n' );
        S.clear();
        for ( register INT i = 0; i < n; ++ i ) {
            sum = 0;
            t = 1;
            bool flag = getchar() == 'i';
            while ( ( c = getchar() ) != ' ' );
            while ( ( c = get( getchar() ) ) != 0 ) {
                sum += c * t;
                t *= 4;
            }
            if ( flag ) {
                S.insert( sum );
            } else {
                puts( S.count( sum ) ? "yes" : "no" );
            }
        }
    }
    return 0;
}

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

// Template Headers {{{
using pii = pair<int, int>; using vpii = vector<pii>;
using vi = vector<int>; using vvi = vector<vi>;
using ll = long long; using vll = vector<long long>;
template <class T> using min_queue = priority_queue<T, vector<T>, greater<T>>;
template <class T> istream &operator>>(istream &, vector<T> &);
template <class T> ostream &operator<<(ostream &, const vector<T> &);
template <class T, class U> istream &operator>>(istream &, pair<T, U> &);
template <class T, class U> ostream &operator<<(ostream &, const pair<T, U> &);
template <class T> struct Inf { static constexpr T inf() { return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : std::numeric_limits<T>::max(); } };
template <> struct Inf<int> { static constexpr int inf() { return 0x3f3f3f3f; } };
template <> struct Inf<long long> { static constexpr long long inf() { return 0x3f3f3f3f3f3f3f3fLL; } };
constexpr int INF = Inf<int>::inf(); constexpr ll BINF = Inf<ll>::inf();
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// }}}

int solve() {
	int n, m; cin >> n >> m;
	for (int d = 0; d < m - m / 2; d++) {
		cout << n / 2 - d << ' ' << n / 2 + 1 + d << endl;
	}
	for (int d = 0; d < m / 2; d++) {
		cout << 1 + d << ' ' << n - 1 - d << endl;
	}
	return 0;
}

// Template Main {{{
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	// precompute();
	// int t; cin >> t; for (int i=1;i<=t;i++)
	solve();
	// cout << "Case #" << i << ": ", solve();
	return 0;
}

template <class T> istream &operator>>(istream &is, vector<T> &v) {
	for (auto it=v.begin();it!=v.end();++it) is >> *it;
	return is;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
	for (auto it=v.begin();it!=v.end();) os << *it, os << " \n"[++it==v.end()];
	return os;
}

template <class T, class U> istream &operator>>(istream &is, pair<T, U> &p) {
	return is >> p.first >> p.second;
}

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

// vim: fdm=marker


Measured memory_bytes: 3632
import math
population = int(input())
a2b = int(input())
b2c = int(input())
c2d = int(input())
d2e = int(input())
e2f = int(input())
city = [population,0,0,0,0,0]
vehicle = [a2b,b2c,c2d,d2e,e2f]
print(math.ceil(population/min(vehicle)) + 4)

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

for i in range(N):
  ans='Yes'
  if N == 1:
    ans='Yes'
    break;
  if i== 0:
    H[i]-=1
    continue
    
  if H[i-1] < H[i]:
    H[i] -= 1
  elif H[i-1]==H[i]:
    continue
  else:
    ans = "No"
    break;
print(ans)

Measured memory_bytes: 14252
a,b,c,d,e,k=int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
l=[a,b,c,d,e]
f=0
for i in range(4):
    for j in range(i+1,5):
        d=abs(l[j]-l[i])
        if(d>k):
            f=1
            break
if(f==0):
    print('Yay!')
else:
    print(':(')

Measured memory_bytes: 61972
N = int(input()) # 数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

List.sort()

n = int(N / 2)

if List[n-1] == List[n]:
    print(0)
else:
    print(List[n] - List[n-1])

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

long long gcd(long long x, long long y)
{
    if (y == 0)
        return x;
    return gcd(y, x % y);
}

long long lcm(long long x, long long y)
{
    if (x == 0 || y == 0)
        return 0;
    return x / gcd(x, y) * y;
}

int main()
{
    int n, m;
    cin >> n >> m;
    cout << (n - 1) * (m - 1) << endl;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::{io, cmp, str};

#[allow(dead_code)]
fn input() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).ok();
    return String::from(s.trim());
}

#[allow(dead_code)]
unsafe fn read<F: str::FromStr>(s: &str) -> F
    where F::Err: std::fmt::Debug
{
    return s.parse().expect(&format!("read \"{}\"", s));
}

fn main() {
    unsafe {
        let xy_s = input();
        let xy: Vec<&str> = xy_s.split(' ').collect();
        let x: i32 = read(xy[0]);
        let y: i32 = read(xy[1]);
        let mut ans = (x.abs() - y.abs()).abs();
        if x + ans == y {
            ans += 0;
        } else if -x + ans == y || x + ans == -y {
            ans += 1;
        } else if -x + ans == -y {
            ans += 2;
        }
        print!("{}", ans);
    }
}


Measured memory_bytes: 380
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

using R = long double;
constexpr R pi = acos((R)-1), eps = 1e-10;

int sgn(R a) { return (a > eps) - (a < -eps); }
int sgn(R a, R b) { return sgn(a - b); }
using P = complex<R>;
istream& operator>>(istream& i, P& p) { R x, y; i >> x >> y; p = P(x, y); return i; }
bool cmp(P p, P q) { return 2 * sgn(real(p), real(q)) + sgn(imag(p), imag(q)) < 0; }
bool eql(P p, P q) { return !cmp(p, q) and !cmp(q, p); }
R dot(P p, P q) { return real(conj(p) * q); }
R crs(P p, P q) { return imag(conj(p) * q); }
int ccw(P p, P q) {
  int s = sgn(crs(p, q));
  if (s) return s;
  if (dot(p, q) < 0) return -2;
  if (dot(p, q - p) > 0) return 2;
  return 0;
}
int ccw(P o, P p, P q) { return ccw(p - o, q - o); }
struct L {
  P s, t;
  P vec() const { return t - s; }
  R abs() const { return std::abs(vec()); }
  R arg() const { return std::arg(vec()); }
};
int ccw(L l, P p) { return ccw(l.s, l.t, p); }

// BEGIN CUT HERE
P proj(P p, L l) {
  P e = l.vec() / l.abs();
  return l.s + dot(p - l.s, e) * e;
}
P refl(P p, L l) { return (R)2 * proj(p, l) - p; }
// END CUT HERE

V<string> split(const string& s, char c) {
  V<string> res;
  stringstream ss(s);
  string t;
  while (getline(ss, t, c)) res.push_back(t);
  return res;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  string s;
  while (getline(cin, s)) {
    auto v = split(s, ',');
    P p = refl({stold(v[4]), stold(v[5])}, {{stold(v[0]), stold(v[1])}, {stold(v[2]), stold(v[3])}});
    cout << fixed << setprecision(15) << real(p) << ' ' << imag(p) << '\n';
  }
}


Measured memory_bytes: 3356
N=int(input())
NN = N
i = 2
ans = 0
while i*i <= NN:
  if N%i==0:
    j = 0
    while N%i==0:
      N /= i
      j+=1
    k = 1
    while j>0:
      if j - k < 0: break
      ans += 1
#      print(i,ans,j,k)
      j -= k
      k += 1
  i += 1
if N != 1:
  ans += 1
print(ans)




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

typedef long long ll;

string A;
map<char, ll> Last;
typedef tuple<ll, char, ll> State;
// length, first letter, next position
vector<State> Dp;

int main() {
  cin >> A;
  Dp.resize(A.size() + 1);
  Dp[A.size()] = State(1, 'a', -1);
  for (ll i = A.size() - 1; i >= 0; --i) {
    Last[A[i]] = i;
    State best;
    for (char c = 'a'; c <= 'z'; ++c) {
      State now = !Last.count(c)
                      ? State(1, c, -1)
                      : State(1 + get<0>(Dp[Last[c] + 1]), c, Last[c] + 1);
      if (c == 'a' || get<0>(now) < get<0>(best)) best = now;
    }
    Dp[i] = best;
  }
  for (ll i = 0; i != -1; i = get<2>(Dp[i])) cout << get<1>(Dp[i]);
  cout << endl;
  return 0;
}


Measured memory_bytes: 5252
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=100009;

inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}
inline int ad(int x,int y){int ret=(x%mod+y%mod)%mod;if(ret<0){ret+=mod,ret=ret%mod;}return ret;}
inline int sub(int x,int y){int ret=((x%mod)-(y%mod)+mod)%mod;if(ret<0){ret+=mod,ret=ret%mod;}return ret;}
inline int gun(int x,int y){int ret=((x%mod)*(y%mod))%mod;if(ret<0){ret+=mod,ret=ret%mod;}return ret;}


 main()

{
    fast
    string s;
    cin>>s;
    int sz=s.size();
    int ses=0;
    int a[sz+2];
    s="#"+s;
    a[0]=0;
    int last=0;
    for(int i=1;i<=sz;i++)
    {
        char ch=s[i];
        int lft=i,rgt=i;
        for(int j=i+1;j<=sz;j++)
        {
            if(s[j]==ch)rgt++;
            else break;
        }
       // cout<<ch<<" "<<lft<<" "<<rgt<<endl;
        if(ch=='<')
        {
             for(int j=lft,k=1;j<=rgt;j++,k++)
             {
                 a[j]=k;
             }
        }
        else
        {
            for(int j=rgt,k=0;j>=lft;j--,k++)
            {
                a[j]=k;
            }
           if(a[lft]>=a[lft-1])
           {
               a[lft-1]=a[lft]+1;
           }
        }
         i=rgt;
    }

    f(i,0,sz)
    {
        ses+=a[i];
        //cout<<a[i]<<" ";
    }
    //cout<<endl;
    cout<<ses<<endl;

    return 0;

}





































Measured memory_bytes: 4784
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace B
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var dn = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var d = dn[0];
            var n = dn[1];
            Console.WriteLine((long)Math.Pow(100, d) * (n < 100 ? n : 101));
        }
    }
}


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

typedef long long int LL;
int main()
{
    int n;
    int cnt = 0;
    cin >> n;
    vector<int> num(n);
    for(int i = 0; i < n; ++i) {
        cin >> num[i];
    } 
    for (int i = 1; i <=n; i= i +2) {
        if (num[i-1] % 2 != 0)
            ++cnt;
    }
    cout << cnt;
    return 0;
}

Measured memory_bytes: 3548
def find(l, e, start, end):
	mid = (start+end)//2
	if (l[mid] == e):
		return (e, e)
	elif (l[mid] > e):
		if (l[mid-1] < e):
			return (l[mid-1], l[mid])
		return find(l, e, start, mid)
	elif (l[mid] < e):
		if (l[mid+1] > e):
			return (l[mid], l[mid+1])
		return find(l, e, mid, end)

def print_sum(input):
	d, n, m = input[0], input[1], input[2]
	S, K = input[3:3+n-1], input[3+n-1:]
	S = sorted(S)
	S = [S[-1]-d, 0] + S + [d]
	sum = 0
	for k in K:
		low, high = find(S, k, 0, len(S))
		sum += min(k-low, high-k)
	print sum

while (True):
	d = int(raw_input())
	if d == 0: break
	n, m = int(raw_input()), int(raw_input())
	input = [d, n, m]
	for i in range(n-1+m):
		next_int = int(raw_input())
		input.append(next_int)
	print_sum(input)

Measured memory_bytes: 15572
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
st = list(set(s+t))
cnt = []

for i in range(len(st)):
  cnt.append(0)

for i in range(len(st)):
  cnt[i] = s.count(st[i]) - t.count(st[i])

if max(cnt)>= 0 :
  print(max(cnt))
else:
  print(0)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
const int N=4e3+5,mod=998244353;
int n,f[N][N],a[N],b[N];
char str[N];
int main()
{
	scanf("%s",str+1);
	n=strlen(str+1);
	for(int i=1;i<=n;i++)a[i]=a[i-1]+str[i]-'0',b[i]=b[i-1]+'2'-str[i];
	f[0][0]=1;
	for(int i=0;i<=a[n];i++)
	for(int j=0,k;j<=b[n];j++)
	if(i||j)
	{
		k=min(n,i+j);
		if(i<=a[k]&&j<=b[k])f[i][j]=((i?f[i-1][j]:0)+(j?f[i][j-1]:0))%mod;
	}
	printf("%d\n",f[a[n]][b[n]]);
}

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

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)
#define maxn 100001

string s;
int N;
int num = 0;

int fw[maxn];

void upd(int p,int v){ //update position p by +=v
	for (int i=p; i<=N; i+= (i&(-i))){
		fw[i] += v;
	}
}


void update_range(int a,int b, int c){ //update position a to b by +=c
	upd(a,c); //upd function from the PURQ fenwick
upd(b+1,-c);
}

int qry(int p){ //query p
	int ans = 0;
	for (int i = p; i>0; i -= (i&(-i))){
		ans += fw[i];
	}
	return ans;
}

bool A[maxn];
	
vpi edges;

int main(){
	fast;
	
	cin>>s;
	N = s.size();
	
	
	FOR(i,0,N-1){
		if (s[i] == '1'){
			A[i+1] = 1;
			num++;
		}else A[i+1] = 0;
	}
	
	if (!A[1]){
		cout<<-1;
		return 0;
	}

	FOR(i,1,N){
		if (A[i] != A[N-i]){
			cout<<-1;
			return 0;
		}
	}
	
	if (A[N]){
		cout<<-1;
		return 0;
	}
	
	if (N%2 == 0 && A[N/2]) num++;
	
	FOR(i,1,num){
		if (i > 1) edges.pb(pi(i-1,i));
		update_range(1,i,1);
	}
	
	int cur = num+1;

	DEC(i,num,1){
		while (!A[qry(i)] && cur <= N){
			edges.pb(pi(i,cur));
			update_range(1,i,1);
			
			cur++;
		}
	}
	
	
	while (cur < N+1){
		edges.pb(pi(1,cur));
		cur++;
	}
	

	aFOR(i,edges) cout<<i.f<<' '<<i.s<<'\n';
			
	
	
	
	
	
}



Measured memory_bytes: 3648
import sys
s = input()
k = int(input())
alphabets = list(sorted(set(s)))
if k == 1:
  print(alphabets[0])
  sys.exit()

def l2s(list, alphabets):
  return ''.join(alphabets[i] for i in list)

j = 1
list = [0, 0]
while True:
  t = l2s(list, alphabets)
  if s.find(t) != -1:
    j += 1
    if k == j:
      print(t)
      sys.exit()
    list.append(0)
  else:
   list[-1] += 1
   while list[-1] == len(alphabets):
     list.pop()
     list[-1] += 1


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

vector<pair<int,int> >v;
int dp[202];
int dfs(int i){
    if(dp[i]!=-1)return dp[i];
    int ret=0;
    for(int j=0;j<v.size();j++){
        if(v[j].first>v[i].first&&v[j].second>v[i].second){
            ret=max(ret,dfs(j)+1);
        }
    }
    return dp[i]=ret;
}
int main(){
    int n;
    while(cin>>n,n){
        v.clear();
        int m,x,y,x1,y1,x2,y2,a=1,c=1;
        for(int i=0;i<202;i++)dp[i]=-1;
        for(int i=0;i<n;i++){
            cin>>x>>y;
            v.push_back(make_pair(x, y));
        }
        cin>>m;
        for(int i=0;i<m;i++){
            cin>>x>>y;
            v.push_back(make_pair(x, y));
        }
        int ans=0;
        for(int i=0;i<m+n;i++){
            ans=max(ans,dfs(i)+1);
        }
        cout<<ans<<endl;
    }
}

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

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
			int[] d = new int[n];
			for (int i = 0; i < n; i++) d[i] = int.Parse(Console.ReadLine());
			int[] buckets = new int[110];
			for (int i = 0; i < n; i++) buckets[d[i]]++;
			int ret = 0;
			for (int i = 0; i <= 100; i++)
			{
				if (buckets[i]>0) ret++;
			}
			Console.WriteLine(ret);
        }
    }
}


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

typedef long long int ll;
#define INF 1999999999
#define MODA 1000000007
#define PI 3.1415926535897932384626433

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    string o, e;
    cin >> o >> e;
    int lenO = o.length();
    int lenE = e.length();
    for(int i = 0; i< lenE; i++)
    {
        cout << o[i];
        cout << e[i];
    }
    if(lenO > lenE)
    {
        cout << o[lenO-1];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
use std::io::stdin;

fn calc_ten_digit_num_sum(mut num: i32) -> i32 {
    let mut res = 0;
    while num > 0 {
        res += num % 10;
        num /= 10;
    }
    res
}

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();

    let nums: Vec<i32> = s
        .trim()
        .split_whitespace()
        .map(|x| x.parse().ok().unwrap())
        .collect();

    let n = nums[0];
    let a = nums[1];
    let b = nums[2];

    let mut total_sum = 0;

    // logic
    for i in 1..n+1 {
        let temp_sum = calc_ten_digit_num_sum(i);
        if a <= temp_sum && temp_sum <= b {
            total_sum += i;
            // total_sum += temp_sum;
        }
    }

    println!("{}", total_sum);
}


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

#define int long long
#define rep(i, n) for (int i = 0; i < (int) (n); i++)
#define reps(i, n) for (int i = 1; i <= (int) (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define cdiv(a, b) (((a) - 1) / (b) + 1)
#define dump(x) cerr << #x " = " << (x) << endl
using vint = vector<int>;
using vvint = vector<vint>;
using pint = pair<int, int>;
using vpint = vector<pint>;
template<typename T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr double PI = 3.1415926535897932384626433832795028;
constexpr int DY[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
constexpr int DX[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int sgn(int x) { return (x > 0) - (x < 0); }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T, typename U> bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

signed main() {
    while (true) {
        int N;
        cin >> N;
        if (N == 0) { break; }
        vector<complex<double>> points;
        rep(i, N) {
            double X, Y;
            cin >> X >> Y;
            points.push_back({X, Y});
        }
        int ans = 1;
        rep(i, N) {
            rep(j, i) {
                if (abs(points[i] - points[j]) > 2) { continue; }
                complex<double> d = (points[i] - points[j]) / 2.0;
                complex<double> v = d * sqrt(1 - norm(d)) / abs(d) * polar(1.0, PI / 2);
                auto count = [&](complex<double> center) {
                    double eps = 1e-8;
                    int ret = 0;
                    rep(k, N) { if (abs(points[k] - center) < 1 + eps) { ret++; }}
                    return ret;
                };
                chmax(ans, count(points[j] + d + v));
                chmax(ans, count(points[j] + d - v));
            }
        }
        cout << ans << endl;

    }
}


Measured memory_bytes: 3052
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using ll=long long;
const ll MOD=1e9+7;
const int INF=1<<30;

int main(){
  int A,B;
  cin >> A >> B;
  int ans=max(A+B,max(A-B,A*B));
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
  unsigned long long n, k;
  cin >> n >> k;

  if (n >= k) {
    n %= k;
  }
  if (k - n < n) {
    n = k - n;
  }
  cout << n << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - 48;}
char myitoc(int N) {return '0' + N;}

signed main()
{
  int n, k;
  cin >> n >> k;

  if (n <= 2)
  {
    cout << 0 << endl;
    return 0;
  }

  vector<vector<int>> c(11, vector<int>(5));
  c.at(0) = {4, 2, 0, 9, 7};
  for (int i = 1; i < 11; i++)
  {
    for (int j = 0; j < 5; j++)
    {
      c.at(i).at(j) = (c.at(i - 1).at(j) + 8) % 11;
    }
  }
  
  int ans = 0;
  for (int i = 0; i < 11; i++)
  {
    for (int j = 0; j < 5; j++)
    {
      if (c.at(i).at(j) == k) ans++;
    }
  }
  ans *= (n - 2) / 11;
  
  for (int i = 0; i < (n - 2) % 11; i++)
  {
    for (int j = 0; j < 5; j++)
    {
      if (c.at(i).at(j) == k) ans++;
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<set>
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    set<int>st;
    for(int i=0; i<n; i++)
    {
        int x;
        cin>>x;
        if(st.count(x))
        {
            st.erase(x);
        }
        else st.insert(x);
    }
    cout<<st.size()<<endl;
    return 0;
}


Measured memory_bytes: 4864
x1, y1, x2, y2 = gets.split.map(&:to_i)
u = (x2 - x1) + (y2 - y1) * 1i
gets.to_i.times do
  x, y = gets.split.map(&:to_i)
  v = x - x1 + (y - y1) * 1i
  d = (u.conj * v).imag
  case
  when d > 0
    puts 'COUNTER_CLOCKWISE'
  when d < 0
    puts 'CLOCKWISE'
  else
    d = (v / u).real
    case
    when d < 0
      puts 'ONLINE_BACK'
    when d <= 1
      puts 'ON_SEGMENT'
    else
      puts 'ONLINE_FRONT'
    end
  end
end

Measured memory_bytes: 8900
from collections import deque
H, W = map(int, input().split())
X = [1] * (W + 2)
for _ in range(H):
    X += [1] + [1 if a == "#" else 0 for a in input()] + [1]
X += [1] * (W + 2)
H, W = H+2, W+2
 
def BFS(i0=0):
    Q = deque([i0])
    D = [-1] * (H * W)
    D[i0] = 0
    while Q:
        x = Q.popleft()
        for y in (x+W, x-W, x+1, x-1):
            if X[y] == 0:
                if D[y] == -1:
                    D[y] = D[x] + 1
                    Q.append(y)
    return D
 
ma = 0
for i in range(H):
    for j in range(W):
        if X[i*W+j] == 0:
            ma = max(ma, max(BFS(i*W+j)))
print(ma)


Measured memory_bytes: 3316
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np

def main():
	n=int(input())
	A=list(map(int,input().split()))
	
	ans="APPROVED"
	
	
	for i in range(n):
		if A[i]%2==0:
			if A[i]%3!=0 and A[i]%5!=0:
				ans="DENIED"
	
	print(ans)
	
	
	
	
	
	
	
	




	
if __name__ == "__main__":
	main()


Measured memory_bytes: 3060
s = int(input())
front = s//100
last = s%100
if (front>12 or front==0) and (last<=12 and last>=1):
  print('YYMM')
elif (front<=12 and front>=1) and (last>12 or last==0):
  print('MMYY')
elif (front<=12 and front>=1) and (last<=12 and last>=1):
  print('AMBIGUOUS')
else:
  print('NA')


Measured memory_bytes: 3060
fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);
    let a:i32 = sc.read();
    let b:i32 = sc.read();
    if a < b {
        println!("a < b");
    }else if a > b {
        println!("a > b");
    }else {
        println!("a == b");
    }
}

use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;
 
struct Scanner<'a> {
    cin: StdinLock<'a>,
}
 
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }
 
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }
 
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}


Measured memory_bytes: 5024