akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
#include <string>
#include <set>
#include <map>
using namespace std;
using ll = long long;



int main() {
	int n,ans=0;
	cin >> n;
	vector<int> p(n);
	for (int i = 0; i < n; i++) cin >> p[i];
	for (int i = 1; i < n - 1; i++) {
		if ((p[i - 1] < p[i] && p[i] < p[i + 1]) || (p[i - 1] > p[i] && p[i] > p[i + 1])) {
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
#define NMAX 100005

vector<ll>  tab[NMAX];
int main(){
    ll nbr_nodes,roots;
    cin>>nbr_nodes>>roots;
    ll high[nbr_nodes+1];
    for (ll i = 1; i <= nbr_nodes; ++i)
    {
        cin>>high[i];
    }
    for (ll i = 0; i < roots; ++i)
    {
        ll a,b;
        cin>>a>>b;
        tab[a].push_back(b);
        tab[b].push_back(a);
    }
    ll count = 0;
    for (ll i = 1; i <= nbr_nodes; ++i)
    {

        bool higher = true;
        for(auto it : tab[i]){
            if(high[it] >= high[i]){
                higher = false;
                break;
            }
        }
        if(higher){
            count++;
        }
    }
    cout<<count;


    return 0;
}


Measured memory_bytes: 10172
def main():
  N = int(input())
  num = 0
  answer = 0
  for i in range(1, N + 1):
    count = calc(i)
    if num <= count:
      num = count
      answer = i
  
  print(answer)

def calc(i):
  answer = 0
  j = i
  while j % 2 == 0:
    j //=  2
    answer += 1
  return answer

main()


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

int main(){
  int k, n;
  cin >> k >> n;
  vector<int> a(n);
  vector<int> b(0);
  
  for (int i = 0; i < n; i++){
    cin >> a.at(i);
  }
  
  for (int j = 0; j < n; j++){
    
    if (j < n - 1){
      b.push_back(a.at(j + 1) - a.at(j));
    }
    else{
      b.push_back(k - a.at(n - 1) + a.at(0));
    }
  }
  
  sort(b.begin(), b.end());
  reverse(b.begin(), b.end());
  
  cout << k - b.at(0) << endl;
}

Measured memory_bytes: 2168
#include <iostream>
#include<string>
#include<algorithm>
#include<cctype>
using namespace std;


int main(){
    string s;
    cin>>s;
    if(s=="RRR")cout<<3<<endl;
    else if(s=="RRS"||s=="SRR")cout<<2<<endl;
    else if(s=="SSS")cout<<0<<endl;
    else cout<<1<<endl;
}

Measured memory_bytes: 3584
N = int(input())
A = list(map(int, input().split()))
B = [0]*N

B[0] = A[0]*2
for i in range(N-1):
	l = A[i]-B[i]/2
	B[i+1] = l*2

d = B[0]/2 + B[N-1]/2 - A[N-1]
if d==0:
	print(*list(map(int, B)))
else:
	B[0] -= d
	for i in range(N-1):
		l = A[i]-B[i]/2
		B[i+1] = l*2
	print(*list(map(int, B)))

Measured memory_bytes: 16304
import sys


class City:
    def __init__(self, ind, pref, time):
        self.ind = ind
        self.pref = pref
        self.time = time
        self.sort_res = None

    def get_id(self):
        str1 = "0" * (6 - len(str(self.pref))) + str(self.pref)
        str2 = "0" * (6 - len(str(self.sort_res))) + str(self.sort_res)
        return str1 + str2
    def __str__(self):
    	return str(self.ind)
if __name__ == '__main__':
    nm = list(sys.stdin.readline().split(" "))
    N = int(nm[0])
    M = int(nm[1])
    prefs = [[] for x in range(N)]
    cities = []
    for i in range(M):
        info = sys.stdin.readline().rstrip().split(" ")
        newcity = City(i, int(info[0]), int(info[1]))
        prefs[int(info[0])-1].append(newcity)
    for i in range(N):
        prefs[i].sort(key=lambda x: x.time)
        for j in range(len(prefs[i])):
            prefs[i][j].sort_res = j + 1
    for i in prefs:
        for j in i:
            cities.append(j)
    cities.sort(key=lambda y: y.ind)
    for i in cities:
        print(i.get_id())




Measured memory_bytes: 52592
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
using namespace std;

long long power(long long a, long long b) {
    //a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
    }
  ll int binomial(ll int n, ll int k) 
{ 
    ll int C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll int i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (int j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 
  vector<int> pr;
void Sieve(ll int n) 
{ 
    bool prime[10000000];
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            pr.push_back(p);
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
}
 

int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
  
// Function to find gcd of array of 
// numbers 
int find(int arr[], int n) 
{ 
    int result = arr[0]; 
    for (int i = 1; i < n; i++) 
    { 
        result = gcd(arr[i], result); 
  
        if(result == 1) 
        { 
           return 1; 
        } 
    } 
    return result; 
} 


//It reurns Fn,Fn+1
pair<int, int> fib (int n) {
    if (n == 0)
        return {0, 1};

    auto p = fib(n >> 1);
    int c = p.first * (2 * p.second - p.first);
    int d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}


  
int main() {
        ll int n;
        cin>>n;
        ll int l=(n)+(n*n)+(n*n*n);
        cout<<l<<endl;
}


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

int main(){
  int num,i,ans[4]={0};
  string blood;
  while(cin >> num){
    cin >> blood;
    if(blood == ",A"){
      ++ans[0];
    }
    else if(blood == ",B"){
      ++ans[1];
    }
    else if(blood == ",AB"){
      ++ans[2];
    }
    else{
      ++ans[3];
    }
  }
  for(i=0;i<4;i++){
    cout << ans[i] << endl;
  }
}

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

struct UnionFind{
    vector<int> par;
    
    UnionFind(int n): par(n,-1){}
    
    int root(int x){
        if(par[x] < 0)return x;
        else return par[x] = root(par[x]);
    }
    
    int parent(int x){
        return par[x];
    }
    
    bool issame(int x,int y){
        return root(x) == root(y);
    }
    
    bool merge(int x,int y){
        x = root(x);
        y = root(y);
        if(x == y)return false;
        if(par[x] > par[y])swap(x,y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x){
        return -par[root(x)];
    }
    
};

int main(void){
    
    int N,M;
    cin >> N >> M;
    
    int A,B;
    UnionFind uf(N);

    map<int,vector<int>> mp;
    for(int i = 0; i < M ;i++){
        cin >> A >> B;
        A--;
        B--;
        mp[A].push_back(B);
        mp[B].push_back(A);
        uf.merge(A,B);
    }
    
    if(uf.size(1)!=N){
        cout << "No" << endl;
    }
    
    cout <<"Yes"<<endl;
    queue<int> que;
    que.push(0);
    int cont = 0;
    int temp;
    map<int,int> ans;
    for(int i = 1; i < N;i++){
        ans[i] = -10;
    }    
    
    
    ans[0] =-1;
    
    
    while(que.size()){
        
        temp = que.front();
        que.pop();
        //cout << "temp"<<que.size() <<endl;
        //cout << mp[0][0]<<endl;
        for(auto u:mp[temp]){
            //cout << u;
            if(temp == u)continue;
            //cout <<"push:"<<ans[u]<<endl;
            if(ans[u]==-10){
                //cout <<"push:"<<u+1<<":"<<temp+1<<ans[u]<<endl;
                ans[u] = temp;
                
                que.push(u);
                cont++;
            }
        }
        
        
        if(cont==N)break;
        //cout <<endl;

    }
    for(int i = 1; i < N;i++){
        cout <<ans[i] + 1<<endl;
    }    
    
}

Measured memory_bytes: 20372
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef complex<double> comp;

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

void solve(void){

	int N;
	cin >> N;

	string res;

	cout << 0 << endl;

	cin >> res;

	if (res == "Vacant")
	{
		return;
	}

	int ok = N-1, ng = 0;
	while (abs(ok - ng) > 1)
	{
		int mid = (ok+ng)/2;
		string s;

		cout << mid << endl;
		cin >> s;

		if (s == "Vacant")
		{
			return;
		}

		if (s == res xor ((mid - ng) & 1))
		{
			ng = mid;
			res = s;
		}
		else
		{
			ok = mid;
		}

	}

	cout << ok << endl;

}

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


Measured memory_bytes: 852
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);

        int n = Integer.parseInt(s.next());

        int[] h = new int[n];

        for (int i = 0; i < n; i++) {
            h[i] = Integer.parseInt(s.next());
        }

        int tmp = 0;
        int c = 0;
        for (int i = 0; i < n; i++) {
            if (tmp <= h[i]) {
                c++;
                tmp = h[i];
            }
        }
        System.out.println(c);
    }
}

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

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;





int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);


	ll N, A, B;

	cin >> N >> A >> B;

	cout << A * (N / (A + B)) + min(N % (A + B), A) << '\n';

	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
    return 0;
}


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

#define debug(a) cerr << #a << " = " << (a) << endl; 
#define get(t, i) get<(i)>((t))
#define fst first
#define snd second

template<typename T> ostream& operator<<(ostream& o, const vector<T>& v) {
  int b = 0; for (const auto& a : v) o << (b++ ? " " : "") << a; return o;
}

template<typename T, typename U> ostream& operator<<(ostream& o, const pair<T, U>& p) {
  o << p.fst << ' ' << p.snd; return o;
}

typedef long long ll;
ll n, k, s;
ll A[101010][2];
ll dp[2][101010];

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> A[i][0] >> A[i][1], s += A[i][1];

  // min weight with val = j
  fill(dp[1], dp[1]+s+1, 1<<30);
  dp[1][0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= s; j++) {
      if (j - A[i][1] >= 0) 
        dp[i%2][j] = min(dp[(i+1)%2][j], dp[(i+1)%2][j-A[i][1]] + A[i][0]);
      else
        dp[i%2][j] = dp[(i+1)%2][j];
    }
  }

  for (int i = s; i >= 0; i--) {
    if (dp[(n-1)%2][i] <= k) {
      cout << i << endl;
      break;
    }
  }

  // cout << dp[(n-1)%2][k] << endl;
}



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

int main() {
  string w;
  cin >> w;
  bool even = true;

  for(char c = 'a'; c <= 'z'; c++) {
    int cnt = 0;
    for(int i=0; i < w.size(); i++) {
      if(w[i] == c) {
        cnt++;
      }
    }
    if(cnt % 2 == 1){
      even = false;
      break;
    }
  }
  cout << (even ? "Yes" : "No") << endl;
}

Measured memory_bytes: 3600
import java.util.Scanner;

class Main {
    public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);
        while (true){
            String str = scn.next();
            if(str.equals("-")) break;

            int count = scn.nextInt();
            for(int i = 0; i < count; i++){
                int num = scn.nextInt();
                String tmp1 = str.substring(0,num);
                String tmp2 = str.substring(num);
                str = tmp2 + tmp1;
            }
            System.out.println(str);
        }
    }
}


Measured memory_bytes: 26404
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <iomanip>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  int a;
  cin >> a;
  double p = a / 2 + a % 2;
  cout << setprecision(10) << p / a << endl;
     
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define speed_up ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define ara(A,N) sort(A,A+N)
#define rev(A,N) sort(A,A+N,greater<long long>())
using namespace std;
int main()
{
    speed_up;
    int ch[150] = {};
    int n, n1;
    cin>>n;
    n1 = n;
    vector<string>str;
    while(n1--)
    {
        string s;
        cin>>s;
        for(int i = 0; i<s.size(); i++)
        {
            ch[s[i]]++;
        }
        str.push_back(s);
    }
   vector<char> vec;
   for(int i = 97; i<=122; i++)
   {
       if(ch[i]>=n)
       {   char c = i;
           vec.push_back(c);
       }
   }

    for(int k = 0; k<vec.size(); k++)
   {   ll mi = INT_MAX;
            int i = 0;
       char check = vec[k];
       for(i = 0; i<n; i++)
       {
           ll cnt = 0;
           string s = str[i];
           for(int j = 0; j<s.size(); j++)
           {
               if( s[j] == check) cnt++;
           }
           mi = min(mi, cnt);
       }
       //cout<<mi<<endl;
       while(mi--)
       {
           cout<<check;
       }
   }
   return 0;
}



Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>

#define SIZE 3

using namespace std;

int main() {
    vector<string> c(SIZE);
    for (int i = 0; i < 3; i++) {
        cin >> c.at(i);
    }
    for (int i = 0; i < 3; i++) {
        cout << c.at(i).at(i);
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define max(a,b) ((a)>(b) ? (a):(b))
int N;
int s[100];
int knownmax[100][10];
int getmaxsum(int n,int sum){
    if(n==N){
        if(!(sum%10))
            return 0;
        else
            return sum;
    }
    if(knownmax[n][sum%10]==-1)
        knownmax[n][sum%10]=max(getmaxsum(n+1,sum%10+s[n]),getmaxsum(n+1,sum%10));
    if(knownmax[n][sum%10])
        return knownmax[n][sum%10]+(sum/10)*10;
    else
        return 0;
}
int main(){
    int i,j;
    scanf("%d",&N);

    for(i=0;i<N;i++)
        scanf("%d",&s[i]);

    for(i=0;i<100;i++)
        for(j=0;j<10;j++)
            knownmax[i][j]=-1;
    printf("%d\n",getmaxsum(0,0));
    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <algorithm>
using namespace std;

int a[200000];

long solve(int n) {
    for (int i = 0; i < n; i++)
        if (a[i] > i)
            return -1;

    long ans = 0;
    for (int i = n - 1, xi = 0; i >= 0; i--, xi = max(xi - 1, 0)) {
        if (a[i] < xi)
            return -1;
        if (a[i] == xi)
            continue;
        ans += a[i];
        xi = a[i];
    }

    return ans;
}

int main() {
    int n;
    while (scanf("%d", &n) == 1) {
        for (int i = 0; i < n; i++)
            scanf("%d", a + i);
        printf("%ld\n", solve(n));
    }
}


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

typedef long long ll;
typedef unsigned long long ull;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SZ(x) (int)(x).size()
#define ZERO(a) memset(a,0,sizeof(a))
#define dbg(x) cout<<#x<<": "<<(x)<<"\n"
#define pb push_back
#define eb emplace_back
#define mp make_pair

int main() {
    set<int> S;
    int a,b,c; cin>>a>>b>>c;
    S.insert(a);
    S.insert(b);
    S.insert(c);
    cout << S.size() << endl;


    return 0;
}

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

using namespace std;

struct DSU {
    int n;
    vector<int> ps;
    int num_components;
    DSU(int n): n(n), ps(n), num_components(n) {
        for (int i = 0 ; i < n; ++i) {
            ps[i] = i;
        }
    }
    int parent(int i) {
        if (ps[i] == i) {
            return i;
        }
        return ps[i] = parent(ps[i]);
    }
    int merge(int i, int j) {
        i = parent(i);
        j = parent(j);
        if (i != j) {
            ps[j] = i;
            --num_components;
            return true;
        }
        return false;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<int> ps(n);
    for (int i = 0; i < n; ++i) {
        ps[i] = i;
    }
    DSU dsu(n);
    for (int i = 0; i < m; ++i) {
        int x, y, z;
        cin >> x >> y >> z;
        --x;
        --y;
        dsu.merge(x, y);
    }
    cout << dsu.num_components << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  int long long N; cin>>N;
  int long long ans;
  for(int long long i=1;i<sqrt(N);i++)
    if(N%i==0 && N/i-1 != i) ans=ans+(N-i)/i;
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

pub trait InputValue {
    fn parse(s: &str) -> Self;
}

pub fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

pub fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B);

// ===

fn main() {
    let (n, k): (i64, i64) = read();
    let mut ans = 0;
    for b in k+1..n+1 {
        let mut f = b;
        while true {
            ans += intersect(1, n+1, f-b+k, f);
            if f > n {
                break;
            }
            f += b;
        }
    }
    println!("{}", ans);
}

fn intersect(a: i64, b: i64, c: i64, d: i64) -> i64 {
    // [a, b) and [c, d)
    let ac = max(a, c);
    let bd = min(b, d);
    if ac <= bd {
        bd-ac
    } else {
        0
    }
}


Measured memory_bytes: 4352
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
    char a[1000];
    scanf("%s",a);
    int l=strlen(a);
    int flag=1;
    for(int i=0;i<l;i++)
    {
        if(i%2==0)
        {
            if(a[i]=='L')
            {
                flag=0;
                break;
            }
        }
        else
        {
            if(a[i]=='R')
            {
                flag=0;
                break;
            }
        }
    }
    if(flag==0)
        printf("No\n");
    else
        printf("Yes\n");
    return 0;
}


Measured memory_bytes: 380
#include<iostream>
#include<string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdint>
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main(){

int n;
ll a[100010];

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

ll MAX = 0;

for(int i = 0; i < n; i++) {
MAX = max(MAX,a[i]);
}

ll h = MOD;
for(int i = 0; i < n; i++) {
if (abs(h - MAX/2) > abs(a[i] - MAX/2) && a[i] != MAX) h = a[i];
}


cout << MAX << " " << h << endl;

return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}


int main(){
  int A, B, C; cin >> A >> B >> C;
  cout << min(B / A, C) << endl;

  return 0;
}


Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimization("Ofast")
#pragma GCC optimization("unroll-loops")
#pragma GCC target ("avx2,avx,fma")
#define ll long long int
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define rep(i,l,r) for(i=l;i<r;i++)
#define bep(i,l,r) for(i=l;i>=r;i--)
#define ld long double
#define ff first
#define ss second
#define pii pair<int,int>
int main()
{
    int i,n;
    cin>>n;
    vector<int>a(n);
    cin>>a[0];
    rep(i,1,n)
        cin>>a[i];
    vector<int>arr;
    arr.pb(a[0]);
    rep(i,1,n)
    {
        int l=0;
        int r=arr.size()-1;
        bool f=0;
        while(l<=r)
        {
            int mid=(l+r)/2;
            if(arr[mid]<a[i])
            {
                r=mid-1;
                f=1;
            }
            else
            l=mid+1;
        }
        if(f)
            arr[l]=a[i];
        else
          arr.pb(a[i]);
    }
    cout<<arr.size();
}


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

int main(){
  string a,b,c,ans;
  cin >> a >> b >> c;
  int d=a.size(),e=b.size();
  if(a.at(d-1) == b.at(0) && b.at(e-1) == c.at(0)){
    ans = "YES";
  }
  else {
    ans = "NO";
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCorder
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }
        public void Solve(ConsoleInput cin)
        {
            var A = cin.ReadInt;
            var P = cin.ReadInt;
            var ans = 3 * A + P;
            ans /= 2;
            WriteLine(ans);

        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 11220
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Q = sc.nextInt();
		String S = sc.next();
		
		int[] l = new int[Q];
		int[] r = new int[Q];
		
		for(int i = 0; i < Q; i++) {
			l[i] = sc.nextInt();
			r[i] = sc.nextInt();
		}
		
		int[] sum = new int[N + 1];
		
		for(int i = 0; i < N - 1; i++) {
			sum[i + 2] = sum[i + 1];
			if(S.charAt(i) == 'A' && S.charAt(i + 1) == 'C') {
				sum[i + 2]++;
			} 
		}
		
		for(int i = 0; i < Q; i++) {
			int count = sum[r[i]] - sum[l[i] - 1];
			if(l[i] > 1) {
				if(S.charAt(l[i] - 1) == 'C' && S.charAt(l[i] - 2) == 'A') {
					count -= 1;
				}
			}
			System.out.println(count);
		}
	}
}


Measured memory_bytes: 82256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long;
using ULL = unsigned long long;

int main() {
    int n; cin >> n;
    vector<LL> a(n);
    rep(i, n) cin >> a[i];

    vector<LL> acc_left(n + 1, 0), acc_right(n + 1, 0);
    rep(i, n) {
        acc_left[i + 1] = a[i] + acc_left[i];
    }
    rep(i, n) {
        acc_right[i + 1] = acc_right[i] + a[n - 1 - i];
    }

    LL ans = 1LL << 60;
    loop(i, 1, n) {
        ans = min(ans, abs(acc_left[i] - acc_right[n - i]));
    }
    cout << ans << endl;
}


Measured memory_bytes: 4992
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define fo(i,j,n) for (int i=(j); i < (n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){ 
    int a, b, c; cin >> a >> b >> c;
    if(b-a == c-b) cout << "YES" << ln;
    else cout << "NO" << ln;
}

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = a; i >= (b); --i)
#define trav(a, x) for(auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = unsigned long long;
using pii = pair<int, int>;
using vi = vector<int>;



int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  string s; cin >> s;
  int r = 0;
  for (auto c : s) {
    r = (r + c - '0') % 9;
  }
  cout << (r ? "No" : "Yes");
}

Measured memory_bytes: 3720
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 2147483600;//10^9
ll MOD  = 1000000007;
vector<int> dy = {0,0,1,-1};
vector<int> dx = {1,-1,0,0};

int main(void){
    int R,G,B,N;
    int ans = 0;
    cin >> R >> G >> B >> N;
    for(int r = 0; r <= N; r++){
        for(int g = 0; g <= N; g++){
            if(r * R + g * G <= N && !((N - r * R - g * G) % B)){
                ans++;
            }
        }
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{
	int a;
	int b;
	int c;
	int d;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	int x = a * b;
	int y = c * d;
	if (x <= y)
		cout << y << endl;
	else
		cout << x << endl;
	return 0;
}

Measured memory_bytes: 256
import numpy as np
N, M, X = map(int, input().split())
item_list = np.array([list(map(int, input().split()))for i in range(N)])


def solve(i, j, item):
    if i == N:
        for k in item:
            if k < X:
                return float("inf")
        return j

    return min([solve(i + 1, j + item_list[i][0], item + item_list[i][1:]), solve(i + 1, j, item)])


ans = solve(0, 0, [0 for i in range(M)])
if ans != float("inf"):
    print(ans)
else:
    print(-1)

Measured memory_bytes: 27232
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<int,int>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

ll gcd(ll a,ll b){return b ? gcd(b,a%b) :a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}



int main()
{
ll x,n;
cin>>x>>n;
vector<ll>v(101);
ll a;
rep(i,n){
    cin>>a;
    v[a]=1;
}
ll ans=x;
ll tmp=100;
rep(i,102){
    if(v[i]!=1){
        if(llabs(i-x)<tmp){
            tmp=llabs(i-x);
            ans=i;
        }
    }
}
cout<<ans<<endl;
}



Measured memory_bytes: 3604
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;



int main(){
	int K,N;
	scanf("%d %d", &N, &K);

	int A[N];
	for(int i=0;i<N;i++) A[i] = 0;
	for(int i=0;i<N;i++){
		int a;
		scanf("%d", &a);
		a--;
		A[a]++;
	}

	sort(A,A+N);
	
	int ans = 0;
	int k=0;
	while(A[k]==0) k++;
	for(int i=k;i<N-K;i++){
		ans += A[i];
	}

	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 1152
#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <list>
#include <map>
#include <deque>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
#define for1(i,n) for (ll i=0;i<(n);i++)
#define for2(i,m,n) for (ll i=(m);i<(n);i++)
#define for3(i,m,n,d) for (ll i=(m);i<(n);i+=(d))
#define DEBUG 0
template <class T>
void dumplist(T list)
{
    for (auto item : list) {
        cout << item << " ";
    }
    cout << endl;
}

void solve()
{
    ll N,K;
    cin >> N >> K;
    deque<ll> q;
    deque<ll> q0;
    for1(i,N) {
        ll v;
        cin >> v;
        q0.push_back(v);
    }

    ll ans = 0;
    list<ll> position;
    for1(c,K+1) {
        ll ab = K - c;
        for1(a,ab+1) {
            ll b = ab - a;
            q = q0;
            position.clear();

            for1(ia,a) {
                if (!q.empty()) {
                    position.push_back(q.front());
                    q.pop_front();
                } else {
                    break;
                }
            }
            for1(ib,b) {
                if (!q.empty()) {
                    position.push_back(q.back());
                    q.pop_back();
                } else {
                    break;
                }
            }
            position.sort(greater<ll>());
            ll value = 0;
            ll idx = 0;
            ll min_pos = position.size() - c;
            for (auto pos: position) {
                ++idx;
                if (idx > min_pos && pos < 0) {
                    break;
                }
                value += pos;
            }
            ans = max(ans, value);
        }
    }

    cout << ans << endl;
}

int main()
{
    do {
        solve();
    } while (DEBUG);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(vector<string>&v)
{
    int c0=0;int c1 = 0;int c2=0;int c3=0;

    for(int i=0;i<v.size();i++)
    {
        if(v[i]=="AC"){
            c0++;
        }
        else if(v[i]=="WA"){
            c1++;
        }
        else if(v[i]=="TLE"){
            c2++;
        }
        else if(v[i]=="RE"){
            c3++;
        }
    }
    cout << "AC" << " " << "x" << " " << c0 << endl;
    cout << "WA" << " " << "x" << " " << c1 << endl;
    cout << "TLE" << " " << "x" << " " << c2 << endl;
    cout << "RE" << " " << "x" << " " << c3 << endl;


}
int main()
{
    vector<string> v;
    int t;
    cin >> t;
    while(t--)
    {
        string s;
        cin >> s;
        v.push_back(s);
    }
    solve(v); 
}


Measured memory_bytes: 7444
#include <iostream>
#include <string>

using namespace std;

int main(){
    
	int n;
	string s;
	cin >> n >> s;
	for (int i = 0; i < s.size(); i++) {
		s[i] = s[i] + n;
		if (s[i] >= 91) {
			s[i] -= 26;
		}
	}
	cout << s <<endl;
	return 0;
}

Measured memory_bytes: 256
k, n = list(map(int,input().split()))
a = list(map(int,input().split()))
max_d = 0
a.append(a[0] + k)
for idx, i in enumerate(a[:-1]):
    if max_d < a[idx + 1] - i:
        max_d = a[idx + 1] - i
print(k - max_d)

Measured memory_bytes: 26444
//master
import java.io.*;
import java.util.*;


public class Main {
    public static int[] h;
    public static boolean[] d;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        long x = sc.nextLong();
        for(int i = -119; i<120; i++) { 
            for(int j = -120; j<119; j++) { 
                if(Math.pow(i,5)-Math.pow(j,5)==x) {
                    p(i + " " + j);
                    return;
                }
             }
         }
    }

    public static <T> void p(T message) {
        System.out.println(message);
    }

    public static <T> void pe(T message) {
        System.err.println(message);
    }

    public static <T> void pp(T message) {
        System.out.print(message);
    }
    
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 25200
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#define LL long long
using namespace std;
const int N = 3001;
LL mp[N][N], f[N][N][4];
int main()
{
	int n,m,k,x,y,v;
	scanf("%d%d%d", &n,&m, &k);
	for(int i = 1;i <= k; i++)
	{
		scanf("%d%d%d", &x, &y, &v);
		mp[x][y] = v;
	}
	f[1][1][1] = f[1][1][2] = f[1][1][3] = mp[1][1];
	f[1][1][0] = 0;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
		{
			if(i < n)
			{
				LL p = max(f[i][j][0], max(f[i][j][1], max(f[i][j][2], f[i][j][3])));
				f[i + 1][j][0] = max(f[i + 1][j][0], p);
				f[i + 1][j][1] = max(f[i + 1][j][1], p + mp[i + 1][j]);	
			}
			if(j < m)
			{
				f[i][j + 1][3] = max(f[i][j + 1][3], f[i][j][3]);
				for(int k = 0; k <= 2; k++)
				{
					f[i][j + 1][k] = max(f[i][j + 1][k], f[i][j][k]);
					f[i][j + 1][k + 1] = max(f[i][j + 1][k + 1], f[i][j][k] + mp[i][j + 1]);
				}
			}
		}
	cout<<max(f[n][m][0], max(f[n][m][1], max(f[n][m][2], f[n][m][3])));
	return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

template<typename T1,typename T2> inline void chmin(T1 &a, T2 b){ if(a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 &a, T2 b){ if(a < b) a = b; }

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
const int MAX_N = 100010;

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

    int N, D;
    cin >> N >> D;
    int ans = 0;

    REP(i, N) {
        int x, y;
        cin >> x >> y;
        if(D * D >= x * x + y * y) { ans++; }
    }

    printf("%lld\n", ans);

    return 0;
}


Measured memory_bytes: 3800
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int k, s; cin >> k >> s;
	int ans = 0;
	rep(i, 0, k + 1) {
		rep(j, 0, k + 1) {
			if (0 <= s - i - j&&s - i - j <= k)ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){

  int a[5] ={};
  int i = 0;
  int num = 9, min = 0, result = 0;
  for(i=0;i<5;i++){
    scanf("%d", &a[i]);
    
  }
  
  for(i=0;i<5;i++)
    if(num > a[i]%10 && a[i]%10 != 0){
      num = a[i]%10;
      min = i;
    }
  
  for(i=0;i<5;i++){
    if(min == i)
      result = result + a[i];
    else
      result = result + ((a[i]+9)/10 * 10);
  }
  printf("%d\n",result);
  
  return 0;
}

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

namespace AtCoder124
{
    class Program
    {
        public static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int[] ss = new int[3];
            ss[0] = int.Parse(s[0]);
            ss[1] = int.Parse(s[1]);
            ss[2] = int.Parse(s[2]);
            if (ss[0] < ss[1])
            {
                if (ss[0] < ss[2] && ss[2] < ss[1])
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }
            else
            {
                if (ss[1] < ss[2] && ss[2] < ss[0])
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
vector<int>a;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        int k;
        cin>>k;
        a.push_back(k);
    }
    sort(a.begin(),a.end());
    long ans=0;
    int j;
    for(j=1; j<n-1; j++)
    {
        vector<int>b(n);
        for(int i=0; i<j; i++)
        {
            b[i] =a[i]+a[j];
        }

        for(int k=j+1; k<n; k++)
        {
            int y=j;
            while(y>0 && b[y-1]>a[k])
            {
                y--;
            }
            ans+=max((j-y),0);
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

#define N 161

int main(){
  int n, d; cin >> n >> d;
  vector<vector<int>> x(n, vector<int>(d));
  vector<int> npow2(N);
  for(int i=0; i<N; i++){
    npow2[i] = i*i;
  }

  for(int i=0; i<n; i++){
    for(int j=0; j<d; j++){
      cin >> x[i][j];
    }
  }
  int ans = 0;
  for(int i=0; i<n; i++){
    for(int j=i+1; j<n; j++){
      int dist = 0;
      for(int k=0; k<d; k++){
        dist += (x[i][k]-x[j][k]) * (x[i][k]-x[j][k]);
      }
      for(int k=0; k<N; k++){
        if(dist == npow2[k]){
          ans++;
          break;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
public class test {
    public static void Main() {
        string[] a = Console.ReadLine().Split();
        int[] b = new int[3];
        
        for (var i = 0; i < 3; i++) {
            b[i] = int.Parse(a[i]);
        }
        var temp = 0;
        for (var i = 1; i < 3; i++) {
            for (var j = i; j > 0; j--) {
                if (b[j] < b[j-1]) {
                    temp = b[j];
                    b[j] = b[j-1];
                    b[j-1] = temp;
                }
            }
        }
        Console.WriteLine(b[0] + " " + b[1] + " " + b[2]);
    }
}


Measured memory_bytes: 15964
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}

/*------------------------------------------------------------------*/

int main(){
    string sa, sb, sc; cin >> sa >> sb >> sc;
    int n = sa.length() + sb.length() + sc.length();

    char c = sa[0];
    for(int i = 0; i < n; i++){
        if(c == 'a'){
            if(sa.length() == 0){
                cout << 'A' << endl;
                return 0;
            }
            c = sa[0];
            sa.erase(0, 1);
        }else if(c == 'b'){
            if(sb.length() == 0){
                cout << 'B' << endl;
                return 0;
            }
            c = sb[0];
            sb.erase(0, 1);
        }else if(c == 'c'){
            if(sc.length() == 0){
                cout << 'C' << endl;
                return 0;
            }
            c = sc[0];
            sc.erase(0, 1);
        }
    }
}

Measured memory_bytes: 256