akhauriyash/Code-Regression huggingface dataset:
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        int a = reader.nextInt();
        int b = reader.nextInt();
        if (a > b) a--;
        System.out.println(a);
    }

    // Read Class
    static class FS {
        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() { return hasNextByte() ? buffer[ptr++] : -1;}
        private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
        private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    
        public boolean hasNext() { skipUnprintable(); 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 int nextInt() {
            return (int)nextLong();
        }
        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();
            }
        }
    }
}



Measured memory_bytes: 20436
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
int comb[4005][4005];
int main(){
    comb[0][0] = 1;
    for(int i=1;i<=4000;i++){
        comb[i][0] = comb[i][i] = 1;
        for(int j=1;j<i;j++){
            comb[i][j] = (comb[i-1][j] + comb[i-1][j-1])%mod;
        }
    }
    int n, k;
    scanf("%d%d", &n, &k);
    int b = k, r = n-k;
    for(int i=1;i<=k;i++){
        b--;
        if(r < 0) printf("0\n");
        else printf("%d\n", comb[b+i-1][i-1]*1ll*comb[r+i][i]%mod);
        r--;
    }
}

Measured memory_bytes: 61312
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
dist = 10**9


for i, j in ab:
    for o, (p, q) in enumerate(cd):
        dist1 = abs(i - p) + abs(j - q)
        if dist1 < dist:
            dist = dist1
            ch = o + 1
    print(ch)
    dist = 10**9

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>

using namespace std;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    int N; cin >> N;
    vector<int> B(N-1);
    repp(i,0,N-1) cin >> B[i];

    ll ans = 0;
    repp(i,1,N-1) {
        ans += min(B[i], B[i-1]);
    }
    ans += B[0];
    ans += B[N-2];
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int D[7][7]={{},
{0,0,4,2,5,3,0},
{0,3,0,6,1,0,4},
{0,5,1,0,0,6,2},
{0,2,6,0,0,1,5},
{0,4,0,1,6,0,3},
{0,0,3,5,2,4,0}},G[7],N,i,t,f;
int sc(int d)
{
int i;
for(i=1;i<=6;i++)
if(G[i]==d)
return i;
}
int main()
{
for(i=1;i<7;i++)scanf("%d",G+i);
scanf("%d",&N);
for(;N--;)
{
scanf("%d%d",&t,&f);
printf("%d\n",G[D[sc(f)][sc(t)]]);
}
return 0;
}


Measured memory_bytes: 2056
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout<<#x<<": "<<x<<endl
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main(){
  string a,b,c;
  char front;
  cin>>a>>b>>c;
  front=a[0];
  a.erase(a.begin());
  while(1){
    if(front=='a'){
      if(a.size()==0){
        cout<<"A"<<endl;
        break;
      }
      front=a[0];
      a.erase(a.begin());
    }else if(front=='b'){
      if(b.size()==0){
        cout<<"B"<<endl;
        break;
      }
      front=b[0];
      b.erase(b.begin());
    }else{
      if(c.size()==0){
        cout<<"C"<<endl;
        break;
      }
      front=c[0];
      c.erase(c.begin());
    }
  }
}


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

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

using namespace std;

int days(int y, int m, int d){
    int s = 0;
    for(int i = 1; i < y; ++i){
        if(i % 3){
            s += 195;
        }
        else{
            s += 200;
        }
    }
    for(int i = 1; i < m; ++i){
        if(y % 3 && !(i % 2)){
            s += 19;
        }
        else{
            s += 20;
        }
    }
    return s + d;
}

int n;

int main(){
    cin >> n;
    rep(i, n){
        int y, m, d;
        cin >> y >> m >> d;
        cout << days(1000, 1, 1) - days(y, m, d) << endl;
    }
    return 0;
}


Measured memory_bytes: 3096
N = int(input())

def calc_dp(n):
    initial = 10**7
    dp=[initial for _ in range(100100)]#dp用の配列はすこし大きめに作る
    dp[0] = 0

    for i in range(100001):
        count = 0
        while 6**count <= n:
            power_six = 6**count
            count += 1
            if i - power_six >= 0:
                dp[i] = min(dp[i],1 + dp[i-power_six])
                
        count = 1
        while 9**count <= n:
            power_nine = 9**count
            count += 1
            if i - power_nine >= 0:
                dp[i] = min(dp[i],1 + dp[i-power_nine])

    return dp[n]

print(calc_dp(N))


Measured memory_bytes: 12968
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vp;
typedef set<ll> si;
typedef map<string, ll> msi;
#define REP(i,a,b) \
for(ll i=ll(a);i<=ll(b);i++)
#define DEP(i,a,b) \
for(ll i=ll(a);i>=ll(b);i--)
#define TR(c, it) \
for (auto it = (c).begin(); it != (c).end(); it++)
#define mp make_pair
#define pb push_back
#define F first
#define S second
///ll mod 1e9+7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  
  int T;
  T=1;
  while(T--)
  {
      ll n,i,j,k,l,m;
      cin>>n;
      string s1="AC",s2="WA",s3="TLE",s4="RE",s;
      ll c1=0,c2=0,c3=0,c4=0;
      REP(i,1,n){
        cin>>s;
        if(s==s1)c1++;
        if(s==s2)c2++;
        if(s==s3)c3++;
        if(s==s4)c4++;
      }
      cout<<s1<<" x "<<c1<<"\n";
      cout<<s2<<" x "<<c2<<"\n";
      cout<<s3<<" x "<<c3<<"\n";
      cout<<s4<<" x "<<c4<<"\n";
  }
  return 0;
}

Measured memory_bytes: 3644
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<Integer> height = new ArrayList<>();
		List<Integer> width = new ArrayList<>();
		int h = 0;
		int w = 0;


		int count = 0;
		boolean judge = false;
		while(!judge){
			h = sc.nextInt();
			w = (sc.nextInt());

			if(h == 0 && w == 0){
				judge = true;
			}else{
				height.add(h);
				width.add(w);
				count++;
			}
		}
		for(int i = 0; i < count; i++){
			for(int j = 0; j < height.get(i); j++){
				for(int k = 0; k < width.get(i); k++){
					if((j % 2) == 0){
						if((k % 2) == 0){
							System.out.print("#");
						}else{
							System.out.print(".");
						}

					}else{
						if((k % 2) == 0){
							System.out.print(".");
						}else{
							System.out.print("#");
						}

					}
			}
				System.out.println();
			}
			System.out.println();
		}

	}

}


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

int main(){
 int N , L;
  cin >> N >> L;
  
  int S = N * (L - 1) + (N * (N + 1)) / 2 ;
  
  int j = 1 - L;
  if ( j <= 0 ) S = S - L ;
  if ( j > N) S = S - ( L + N - 1);
  
  cout << S << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    int a = 1e9, b = -1e9;
    for (int i = 0; i < s.size(); ++i)
    {
        if (s[i] == 'A')
            a = min(a, i);
        if (s[i] == 'Z')
            b = i;
    }
    cout << max(b - a + 1, 0);
}


Measured memory_bytes: 720
package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"
	"strconv"
)

func main() {
	n := readInt()

	m1, m2 := make(map[int]int), make(map[int]int)

	for i := n; i > 0; i-- {
		a := readInt()
		m1[a+i]++
		m2[-a+i]++
	}

	ans := 0
	for k, v1 := range m1 {
		if v2, ok := m2[k]; ok {
			ans += v1 * v2
		}
	}

	fmt.Println(ans)
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	log.SetFlags(log.Lshortfile)
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 22552
N,M =  map(int,input().split())
A = list(map(int, input().split()))
A_val = sum(A)

lst = sorted(A,reverse=True)[0:M]
for i in lst:
    if i < A_val/(4*M):
        print("No")
        break
    else:
        continue
else:
    print("Yes")

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

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,k,br=0,p=1;
    cin >> n >> k;
    while(p<=n)
    {
        br++;
        p*=k;
    }
    cout << br;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
int A,B,C,D;
int main(){
	scanf("%d%d%d%d", &A,&B,&C,&D);
	cout << ((A+B < C+D) ? "Right" : (A+B == C+D) ? "Balanced" : "Left" ) << endl;
	return 0;
}

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

using namespace std;

string s;
int ss[100050];
inline int query(int x, int y){ if(x == 0) return ss[y]; else return ss[y]-ss[x-1]; }
int main(){
	cin >> s;
	int n = s.length();
	for(int i = 0; i<n; i++) ss[i] = s[i]-'0';
	for(int i = 1; i<n; i++) ss[i] += ss[i-1];
	if(query(0,n-1) == 0){ cout << n; return 0; }
	int ans = INT_MAX;
	for(int i = 0; i<n; i++){
		if(query(i,i) == 1){
			int cur = 0;
			if(query(0,i) == i+1) cur = max(i+1, cur);
			if(query(i,n-1) == n-i) cur = max(n-i, cur);
			cur = max(i, cur);
			cur = max(n-i-1, cur);
			ans = min(ans, cur);
		}
	}
	for(int i = 0; i<n; i++) ss[i] = s[i]-'0';
	for(int i = 0; i<n; i++) ss[i] = 1-ss[i];
	for(int i = 1; i<n; i++) ss[i] += ss[i-1];
	if(query(0,n-1) == 0){ cout << n; return 0; }
	int ans2 = INT_MAX;
	for(int i = 0; i<n; i++){
		if(query(i,i) == 1){
			int cur = 0;
			if(query(0,i) == i+1) cur = max(i+1, cur);
			if(query(i,n-1) == n-i) cur = max(n-i, cur);
			cur = max(i, cur);
			cur = max(n-i-1, cur);
			ans2 = min(ans2, cur);
		}
	}
	cout << max(ans,ans2);
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
int a[12][12];
int main() {
    const int t = 1001001001;
    int n , m , x;
    cin >> n >> m >> x;
    vector <int> C(n);
    rep(i , n){
        cin >> C.at(i);
        rep(j , m){
            cin >> a[i][j];
        }
    }
    int ans = t;
    rep(s,1<<n){
        int cost = 0;
        vector <int> d(m);
        rep(i,n){
            if(s>>i&1){
                cost+=C.at(i);
                rep(j,m){
                    d[j]+=a[i][j];
                }
            }
        }
        bool ok = true;
        rep(j , m){
            if(d[j] < x){
                ok = false;
            }
        }
        if(ok){
            ans = min(ans , cost);
        }
    }
    if(ans == t){
        cout << -1 << endl;
    }
    else{
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3624
data=list(input())
a=10*int(data[0])+int(data[1])
b=10*int(data[2])+int(data[3])

if (a==0 and 1<=b<=12)or (a>=13 and 1<=b<=12):
    print ("YYMM")
elif (b==0 and 1<=a<=12) or (b>=13 and 1<=a<=12):
    print("MMYY")
elif  0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
else:
    print("NA")
    


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>

#define STARTUP {(cin.tie(0));\
 (ios::sync_with_stdio(false));}

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define MAX(list) std::max(list)
#define MIN(list) std::min(list)
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define CINVEC(vec) REP(i,(vec).size()) cin>>(vec)[i];

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
std::istream& operator>>(std::istream& is, std::pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

using ll = long long;
using namespace std;
ll mod = 1'000'000'007;

const int INF = 1'050'000'000;

int main() {
    STARTUP;

    int A, B;
    cin >> A >> B;
    if (A == 1)A += 13;
    if (B == 1)B += 13;
    if (A == B) { cout << "Draw" << endl; }
    else {
        YESNO(A < B, "Bob", "Alice");
    }
    return 0;
}

Measured memory_bytes: 256
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int a[114514];
string s[114514];
vector<pint> ed;
string out[2]={"Second","First"};
int main()
{
	int n,rx=0,ry=114514,lx=114514,ly=0;
	scanf("%d",&n);
	rep(i,n) scanf("%d",&a[i]);
	sort(a,a+n);
	/*rep(i,n){
		s[i]=string(a[i],'L');
		for(int j=a[i]-1;j>=0;j--){
			if(i>0 && j<a[i-1] && s[i-1][j]=='L') s[i][j]='W';
			if(j<a[i]-1 && s[i][j+1]=='L') s[i][j]='W';
		}
	}
	rep(i,n) cout<<s[i]<<endl;*/
	reverse(a,a+n);
	rep(i,n){
		if(i>=n-1 || a[i]>a[i+1]){
			int x=i+1,y=a[i];
			if(x==y){
				cout<<"Second"<<endl;return 0;
			}
			if(x<y) rx=x,ry=y;
			else if(ly<1) ly=y,lx=x;
		}
	}
	/*if(rx<1) cout<<out[(lx+ly)%2]<<endl;
	else if(ly<1) cout<<out[(rx+ry)%2]<<endl;
	else */if(rx<ly) cout<<out[(lx+ly)%2]<<endl;
	else if(rx>ly) cout<<out[(rx+ry)%2]<<endl;
	else cout<<out[(((rx+ry)%2)|((lx+ly)%2))]<<endl;
}


Measured memory_bytes: 1536
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main() {
	int d;
	cin >> d;
	if (d == 25)puts("Christmas");
	else if (d == 24)puts("Christmas Eve");
	else if (d == 23)puts("Christmas Eve Eve");
	else puts("Christmas Eve Eve Eve");
	return 0;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <x86intrin.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define V vector
template <typename T> bool chmin(T &a, const T &b) {if(a > b){a = b; return true;} return false;}
template <typename T> bool chmax(T &a, const T &b) {if(a < b){a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill (A (&array)[N], const T & val) {fill ((T*)array, (T*)(array+N), val);}
V<int> dx = {-1, 1,  0, 0, -1, -1,  1, 1};
V<int> dy = { 0, 0, -1, 1, -1,  1, -1, 1};

const int mod = 1000000007;
//const int mod = 998244353;
struct mint {
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main () {
    int n; cin >> n;
    V<int> a(n); rep(i, n) cin >> a[i];
    V<int> s(n+1, 0); 
    rep(i, n) {
        s[i+1] = s[i] + a[i];
        if (s[i+1] >= mod) s[i+1] -= mod;
    }
    mint ans = 0;
    rep(i, n) {
        int d = s[n] - s[i+1];
        if (d < 0) d += mod;
        ans += (ll)a[i] * d;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4752
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define PI 3.14159265358979323846
#define int64 long long
#define uint64 unsigned long long
using namespace std;

int main()
{
	int64 nn, tmp, ans = 0;
	cin >> nn;
	vector<int64> ll(nn);
	for(int64 ii = 0;ii < nn;ii++)
	{
		cin >> ll[ii];
	}
	sort(ll.begin(), ll.end());
	for(int64 ii = nn - 1;ii >= 0;ii--)
	{
		for(int64 jj = ii - 1;jj >= 0;jj--)
		{
			auto ite = lower_bound(ll.begin(), ll.end(), ll[ii] + ll[jj]);
			tmp = distance(ite, ll.end());
			ans += nn - ii - 1 - tmp;
		}
	}
	cout << ans << endl;
	return 0;
}


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

constexpr int mod = 1e9 + 7;

int main() {
    string s; cin >> s;
    const int n = s.size();
    vector<vector<int>> dp(n + 1, vector<int>(13));
    dp[0][0] = 1;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < 13; ++j) {
            if(s[i] == '?') {
                for(int d = 0; d <= 9; ++d) {
                    (dp[i + 1][(j * 10 + d) % 13] += dp[i][j]) %= mod;
                }
            } else {
                (dp[i + 1][(j * 10 + s[i] - '0') % 13] += dp[i][j]) %= mod;
            }
        }
    }
    cout << dp[n][5] << endl;
}


Measured memory_bytes: 8960
#include<iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[101];
  int maxv = 0;
  int minv = 1000000000;
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  for(int i=0; i<n; i++){
    if(a[i] > maxv){
      maxv = a[i];
    }
    if(a[i] < minv){
      minv = a[i];
    }
  }
  cout << maxv-minv << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<pair<int, int>> a(n);
    ll ans = 0;
    
    rep(i, n) {
        int ta;
        cin >> ta;
        a[i] = make_pair(i, ta);
    }
    
    rep(i, n) {
        int v = a[i].second / 2;
        ans += v;
        a[i].second %= 2;
        
        if (i < (n - 1)) {
            v = min(a[i].second, a[i + 1].second);
            ans += v;
            a[i].second -= v;
            a[i + 1].second -= v;
        }
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
import java.io.*;
import java.math.*;
import java.util.*;
public class Main { //CASH MONEY --> Collections.sort()>>>>>Arrays.sort()
 
	public static void main(String[] args) { //Ball out dawg
		FastScanner I = new FastScanner(); //Input
		OutPut O = new OutPut(); //Output
		String S = I.next();
		Stack<Character> cur = new Stack<Character>();
		Stack<Character> ans = new Stack<Character>();
		for (int i = 0; i < S.length(); i++) {
			if (S.charAt(i)=='1') cur.push('1');
			else if (S.charAt(i)=='0') cur.push('0');
			else if (S.charAt(i)=='B'&&cur.size()>0) cur.pop();
		}
		while (!cur.isEmpty()) {
			ans.add(cur.pop());
		}
		while (!ans.isEmpty()) O.p(ans.pop());
	}
	public static int MEX(int N,int[] cnts) {
		for (int test = 0; test <=N; test++) if (cnts[test]==0) return test;
		return -1;
	}
	public static long ceil(long num, long den) {long ans = num/den; if (num%den!=0) 
	ans++; return ans;}
	public static long GCD(long a, long b) {
		if (a==0||b==0) return Math.max(a,b);
		return GCD(Math.min(a, b),Math.max(a, b)%Math.min(a, b));
	}
	public static long FastExp(long base, long exp, long mod) {
		long ans=1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			exp/=2;
			base*=base;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
	public static long ModInv(long num,long mod) {return FastExp(num,mod-2,mod);}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());};
	}
	static class OutPut{
		PrintWriter w = new PrintWriter(System.out);
		void pln(int x) {w.println(x);w.flush();}
		void pln(long x) {w.println(x);w.flush();}
		void pln(String x) {w.println(x);w.flush();}
		void pln(char x) {w.println(x);w.flush();}
		void pln(StringBuilder x) {w.println(x);w.flush();}
		void p(int x) {w.print(x);w.flush();}
		void p(long x) {w.print(x);w.flush();}
		void p(String x) {w.print(x);w.flush();}
		void p(char x) {w.print(x);w.flush();}
		void p(StringBuilder x) {w.print(x);w.flush();}
	}
}



Measured memory_bytes: 25636
def main():
    import sys
    input = sys.stdin.readline
    K, S = (int(i) for i in input().split())
    ans = 0
    for i in range(K+1):
        for j in range(K+1):
            k = S - i - j
            if 0 <= k <= K:
                ans += 1
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 40940
#include <bits/stdc++.h>
#define itn int
#define gI gi
#define File(x) freopen(x".in","r",stdin); freopen(x".out","w",stdout)

using namespace std;

typedef long long ll;

inline int gi()
{
	int f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
	return f * x;
}

inline ll gl()
{
	ll f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
	return f * x;
}

int n, m, k;

int main()
{
	//File("");
	n = gi(), m = gi(), k = gi();
	int mm = max(n, m);
	if (k % mm == 0) cout << k / mm << endl;
	else cout << k / mm + 1 << endl;
	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (int i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()

int N;
int d[100];

int main() {
    cin >> N;
    REP (i, N) cin >> d[i];
    int ans = 0;
    REP (i, N) REP (j, i) {
        ans += d[i] * d[j];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
<?php

fscanf(STDIN, "%d %d", $a, $b);
$arr = array();
for($c = 1; $c < 4; $c++){
  $arr[] = $a * $b * $c;
}
$flg = 0;
foreach($arr as $v){
  if( ($v % 2) === 1){
    $flg++;
  }
}

if($flg){
  echo "Yes\n";
}else{
  echo "No\n";
}

?>

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

int main() {
  int n;
  cin >> n;
  std::vector<int> a(n);
  std::vector<int> b(n);
  std::vector<int> c(n-1);
  rep(i,n) {
    int x;
    cin >> x;
    x--;
    a.at(i) = x;
  }
  int total = 0;
  rep(i,n) {
    cin >> b.at(i);
    total += b.at(i);
  }
  rep(i,n-1) cin >> c.at(i);

  rep(i,n-1) {
    if (a.at(i)+1 == a.at(i+1)) {
      total += c.at(a.at(i));
    }
  }
  cout << total << endl;
}


Measured memory_bytes: 3640
#include "bits/stdc++.h"
using namespace std; typedef long long int lint; typedef pair<lint, lint> plint; typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define endk '\n'
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
const lint mod = 1e9 + 7, INF = 1e18;
lint dx[8] = { 0, -1, 1, 0, 1, -1, 1, -1 }, dy[8] = { 1, 0, 0, -1, -1, -1, 1, 1 };

lint N, K;
lint X[100000], Y[100000];
char c;

template< typename T >
struct imos2D {
	vector< vector< T > > data;
	int _H, _W;

	imos2D(int H, int W) {
		_H = H; _W = W;
		data.assign(H + 1, vector< T >(W + 1, 0));
	}

	void add(int y, int x, int value) {
		data[y + 1][x + 1] += value;
	}

	void build() {
		for (int i = 0; i <= _H; i++) {
			for (int j = 0; j < _W; j++) {
				data[i][j + 1] += data[i][j];
			}
		}
		for (int j = 0; j <= _W; j++) {
			for (int i = 0; i < _H; i++) {
				data[i + 1][j] += data[i][j];
			}
		}
	}

	///x1 - x2, y1 - y2
	T query(int x1, int y1, int x2, int y2) {
		return data[y2][x2] - data[y1][x2] - data[y2][x1] + data[y1][x1];
	}
};

int main() {
	cin.tie(0); ios_base::sync_with_stdio(false);
	cin >> N >> K;
	REP(i, N) {
		cin >> X[i] >> Y[i] >> c;
		if (c == 'B') Y[i] += K;
		X[i] %= 2 * K;
		Y[i] %= 2 * K;
	}
	imos2D<lint> dt(K * 2, K * 2);
	REP(i, N) dt.add(Y[i], X[i], 1);
	dt.build();

	lint maxv = 0;
	REP(i, K + 1) {
		REP(j, K + 1) {
			lint curr = 0;
			curr += dt.query(0, 0, i, j);
			curr += dt.query(i + K, 0, 2 * K, j);
			curr += dt.query(0, j + K, i, 2 * K);
			curr += dt.query(i, j, i + K, j + K);
			curr += dt.query(i + K, j + K, 2 * K, 2 * K);
			chmax(maxv, max(N - curr, curr));
		}
	}
	cout << maxv << endl;
}

Measured memory_bytes: 36172
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N=1e5+5;

int n, a, b, ans=0;
int x[N];

int32_t main()
{
	IOS;
	cin>>n>>a>>b;
	for(int i=1;i<=n;i++)
		cin>>x[i];
	for(int i=2;i<=n;i++)
	{
		int diff=x[i]-x[i-1];
		ans+=min(diff*a, b);
	}
	cout<<ans;
	return 0;
}



Measured memory_bytes: 1024
#include <cmath>
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<iomanip>
#include<stack>
#include<set>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll mod = 1000000007;
int main() {
	int k;
	cin >> k;
	for (int i = 0; i < k; i++) {
		cout << "ACL";
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 3568
#include<stdio.h>
int main(void)
{
	int h1,h2,k1,k2,a,b,c,d,H,K;
	scanf ("%d%d",&h1,&h2);
	scanf ("%d%d",&k1,&k2);
	scanf ("%d%d%d%d",&a,&b,&c,&d);
	H=h1*a+h2*b+(h1/10)*c+(h2/20)*d;
	K=k1*a+k2*b+(k1/10)*c+(k2/20)*d;
	if (H>K)
	printf ("hiroshi\n");
	else if (H<K)
	printf ("kenjiro\n");
	else
	printf ("even\n");
	return 0;
}

Measured memory_bytes: 584
#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<ll,ll>;

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

ll n;



    vector<pair<ll,ll>>p;
void fs(ll a){
    for(ll i=2;i*i<=n;i++){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        p.emplace_back(i,cnt);
    }
    return;
}


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

struct UnionFind{
    vector<int>d;
    UnionFind(int n=0):d(n,-1){}
    int find(int x){
        if(d[x]<0)return x;
        return d[x]=find(d[x]);
    }
    bool unite(int x,int y){
        x=find(x);y=find(y);
        if(x==y)return false;
        if(d[x]>d[y])swap(x,y);
        d[x]+=d[y];
        d[y]=x;
        return true;
    }
    bool same(int x,int y){return find(x)==find(y);}
    int size(int x){return -d[find(x)];}
};

int deg[100005];
vector<int> to[100005];

int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    UnionFind uf(n);
    rep(i,m){
        int a,b;
        cin>>a>>b;
        a--;b--;
        deg[a]++;
        deg[b]++;
        uf.unite(a,b);
    }
    rep(i,k) {
        int a,b;
        cin>>a>>b;
        a--;b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    rep(i,n){
        ll ans=uf.size(i)-1-deg[i];
        for(int u:to[i]){
            if(uf.same(i,u))ans--;
        }
        if(i==n-1)cout<<ans<<endl;
        else cout<<ans<<" ";
    }

}
 




Measured memory_bytes: 9076
import numpy as np

n,k = map(int,input().split())
a = np.array(list(map(int,input().split())))
f = np.array(list(map(int,input().split())))
a.sort()
f.sort()
f = f[::-1]

def check(x):
  cost = np.maximum(0,a-x//f).sum()
  return cost <= k
  
left = -1
right = 10**12
while right - left > 1:
  mid = (right + left) // 2
  if check(mid):
    right = mid
  else:
    left = mid

print(right)

Measured memory_bytes: 37188
a=int(input())
if 400<=a and a<=599:
    print(8)
if 600<=a and a<=799:
    print(7)
if 800<=a and a<=999:
    print(6)
if 1000<=a and a<=1199:
    print(5)
if 1200<=a and a<=1399:
    print(4)
if 1400<=a and a<=1599:
    print(3)
if 1600<=a and a<=1799:
    print(2)
if 1800<=a and a<=1999:
    print(1)

Measured memory_bytes: 9136
n, m = map(int, input().split())

a = [input().split() for l in range(n)]
b = [input().split() for l in range(m)]

for i in range(n):
    ans = 0
    for j in range(m):
        ans += (int(a[i][j]) * int(b[j][0]))
    print(ans)


Measured memory_bytes: 6272
A, B = list(map(int,input().split()))

def gcd_(a, b):
    if a < b:  a, b = b, a
    if b == 0:  return a
    return gcd_(b, a % b)

def lcm_(x,y):
    return (x * y) // gcd_(x, y)

print(lcm_(A, B))

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

int main() {
  int n;
  cin >> n;
  int a,b,c;
  a = n%10;
  b = n%100/10;
  c = n/100;
  if (a==7||b==7||c==7) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
typedef unsigned long long ull;
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int a,b;
	cin >> a >> b;
	cout << (a-1)*(b-1) << endl;	
	return 0;
}


Measured memory_bytes: 256
n = int(input())
x = input()
flg = [0] * n
for i in range(n):
    if x[i] == '1':
        flg[i] = 1
x = int(x, 2)
cnt = sum(flg)
if cnt == 1:
    x_a = 0
else:
    x_a = x % (cnt - 1)
x_b = x % (cnt + 1)


for i in range(n):
    if flg[i] == 1:
        if cnt == 1:
            print(0)
            continue
        t = (x_a - pow(2, n-i-1, cnt-1)) % (cnt - 1)
    else:
        t = (x_b + pow(2, n-i-1, cnt+1)) % (cnt + 1)

    if t == 0:
        print(1)
    else:
        tmp = 1
        while t > 0:
            pop = bin(t).count('1')
            t = t % pop
            tmp += 1

        print(tmp)


Measured memory_bytes: 80632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, x, y) for (ll i = x; i < y; i++)


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

    if(x==1)
     cout << 0 << endl;
    else if(x==0)
     cout << 1 << endl;
return 0;
}

Measured memory_bytes: 3620
N = int(input())
V = [_ for _ in map(int,input().split())]
v = len(V)
V.sort()
if v == 2:
    print(sum(V)/2)
else:
    i = 2
    X = (V[0] + V[1])/2
    while i != N:
        X = (X + V[i])/2
        i += 1
    print(X)
  
  

Measured memory_bytes: 3060
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    while (true) {
        val m = sc.nextInt()
        val d = sc.nextInt()
        if (m == 0) break
        val cal = Calendar.getInstance()
        cal.set(2004, m-1, d)
        println(when (cal.get(Calendar.DAY_OF_WEEK)) {
            Calendar.MONDAY -> "Monday"
            Calendar.TUESDAY -> "Tuesday"
            Calendar.WEDNESDAY -> "Wednesday"
            Calendar.THURSDAY -> "Thursday"
            Calendar.FRIDAY -> "Friday"
            Calendar.SATURDAY -> "Saturday"
            else -> "Sunday"
        })
    }
}


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

int main() {
  int N;
  cin >> N;
  
  double ans = 0;
  for (int i = 0; i < N; i++) {
    double x;
    string u;
    cin >> x >> u;
    
    if(u=="BTC") x *= 380000.0;
    ans += x;
  }
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
//Author: nimishkhurana
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(i=a;i<b;i++)
#define rrep(i,b,a) for(i=b;i>=a;i--)
#define ld long double
#define ll long long
#define umapi unordered_map<int,int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int> 
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define pb push_back
#define mk make_pair
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define INF 1000000000
template <typename T>
ostream& operator << (ostream& stream, const pair<T,T> &p) {
    return stream<<"("<<p.first<<","<<p.second<<") ";
}

int n;
const int mxn = 1e5;
int h[mxn];
int dp[mxn];

int solve(int i){
    if(i==n-1) return 0;
    if(dp[i]!=-1) return dp[i];
    if(i+1 == n-1)
        return dp[i] = abs(h[i+1] - h[i]);
    
    return dp[i] = min(abs(h[i+1] - h[i]) + solve(i+1), abs(h[i+2] - h[i]) + solve(i+2));
}

int main(){
    fastIO
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    // #endif
    memset(dp, -1, sizeof(dp));

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

    cout<<solve(0);
   
    return 0;
}

Measured memory_bytes: 3328
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    sc.nextLine();
    String[] ss = new String[n];
    for (int i = 0; i < n; ++i) {
      ss[i] = sc.nextLine();
    }

    Arrays.sort(ss);

    StringBuilder sb = new StringBuilder();
    for (String s : ss) {
      sb.append(s);
    }

    System.out.println(sb.toString());
  }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=100010;
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) memset(x,v,sizeof(x))
inline ll read(){
	char ch=getchar();ll x=0,f=0;
	while(ch<'0' || ch>'9') f|=ch=='-',ch=getchar();
	while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
	return f?-x:x;
}
int n,cnt;
char s[maxn];
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	cnt=15-n;
	FOR(i,1,n) if(s[i]=='o') cnt++;
	puts(cnt>=8?"YES":"NO");
}

Measured memory_bytes: 256
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<sstream>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#include<map>
#define rep(i,x,n) for(int i=x;i<=n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define sz(a) int(a.size())
#define rson mid+1,r,p<<1|1
#define pii pair<int,int>
#define lson l,mid,p<<1
#define ll long long
#define pb push_back
#define mp make_pair
#define se second
#define fi first
using namespace std;
const double eps=1e-8;
const int mod=1e9+7;
const int N=1e5+10;
const int inf=1e9;
ll x;
int main(){
	//ios::sync_with_stdio(false);
	//freopen("in","r",stdin);
	cin>>x;
	ll y=100;
	int i;
	for(i=1;y<x;i++){
		y=y+y/100;
	}
	cout<<i-1<<endl;
	return 0;
}

Measured memory_bytes: 3552
#include<bits/stdc++.h>
using namespace std;
#define start ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define f(i, a, n) for( i=a; i<n;i++)
const int N = (int)(1*1e6+10);
typedef long long ss;
int main()
{
    start;
    int i,j,n,m=200,x,p,q;
    cin>>x>>n;
    int sa[n];
    set<int>s;
    for(i=0;i<n;i++)
        {cin>>sa[i];
        s.insert(sa[i]);
        }
        if(n==0)
        {
            cout<<x<<endl;
            return 0;
        }

    sort(sa,sa+n);
    vector<int>sh;
    for(i=-100;i<=200;i++)
        {
           if(s.find(i)==s.end())
            sh.push_back(i);
        }
    for(i=0;i<sh.size();i++)
    {
        p=abs(sh[i]-x);
        if(p<m)
            {m=p;
            q=sh[i];
            }
    }
    cout<<q<<endl;
    return 0;
}


Measured memory_bytes: 3668
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    const N = nextInt()
    const S = next()
    let es = []
    let ws = []
    if(S[0] == "W"){
        es[0] = 0
        ws[0] = 1
    } else {
        es[0] = 1
        ws[0] = 0 
    }
    for(let i = 1; i<S.length;i++){
        if(S[i] == "W") ws[i] = ws[i-1] + 1
        else ws[i] = ws[i-1]

        if(S[i] == "E") es[i]=es[i-1] + 1
        else es[i] = es[i-1] 
    }
    // leader = 0
    let min = es[S.length-1] - es[0]
    for(let i = 1; i<S.length-1; i++){
        let tmp = es[S.length-1] - es[i] + ws[i-1]
        min = Math.min(min, tmp)
    }
    let last = ws[S.length-2]
    min = Math.min(min, last)
    console.log(min)

}
Main()


Measured memory_bytes: 50604
import decimal

n = int(input())
arr = list(map(decimal.Decimal, input().split()))

arr.sort()

while len(arr) > 1:

    s = decimal.Decimal(0)

    s += arr.pop(0)
    s += arr.pop(0)

    arr.append(s / 2)

    arr.sort()

print(arr[0])


Measured memory_bytes: 5076
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			System.out.println(a * b);
	}

}

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

using namespace std;

int main() {
	int n, q;
	cin >> n >> q;
	
	queue<pair<string, int>> que;
	while (n--) {
		string name;
		int time;
		cin >> name >> time;
		que.push({name, time});
	}


	int current_time = 0;
	while (!que.empty()) {
		auto top = que.front();
		que.pop();

		if (top.second > q) {
			current_time += q;
			top.second -= q;
			que.push(top);
		} else {
			current_time += top.second;
			cout << top.first << ' ' << current_time << '\n';
		}
	}
}


Measured memory_bytes: 6312
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N, M;
	vector<int> ans;
	vector<pair<int,int>> in;
	
	cin>>N>>M;
	
	in.resize(M);
	
	for(int i = 0; i < M; i++){
		cin>>in[i].first>>in[i].second;
	}
	
	ans.resize(N);
	
	for(int i = 0; i < 1000; i++){
		string num = to_string(i);
		
		if(num.size() != N) continue;
		
		bool flag = true;
		for(int j = 0; j < M; j++){
			if(num[in[j].first-1] - '0' == in[j].second) {
				
			} else {
				flag = false;
			}
		}
		
		if(flag == true) {
			cout<<i<<endl;
			return 0;
		}
	}
	
	cout<<-1<<endl;
	
	return 0;
}

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

int main(){
    int N;
    vector<int>V;
    cin >>N;
    for(int i=0;i<N;++i){
        int v;
        cin >>v;
        V.emplace_back(v);
    }
    int ans=0;
    for(int i=0;i<N-1;++i){
        for(int j=i+1;j<N;++j){
            ans+=V[i]*V[j];
            }
    }
    

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

Measured memory_bytes: 256
from string import ascii_lowercase as abc
n = int(input())
a = {i + 1: s for i, s in enumerate(abc)}
ans = ''
while n >= 1:
    n, r = divmod(n, 26)
    if r == 0:
        r = 26
        n -= 1
    
    ans += a[r]
print(ans[::-1])

Measured memory_bytes: 68528
n = int(input())
a_list = [int(i) for i in input().split(" ")]
diff_list = []
for i in range(len(a_list)):
    for j in range(i+1,len(a_list)):
        diff_list.append(abs(a_list[i]-a_list[j]))
print(max(diff_list))


Measured memory_bytes: 3188
import collections
N = int(input())
P = list(map(int,input().split()))
ans = 0
P.sort()
cnt = collections.Counter(P)
for i in cnt:
    s = cnt[i]
    if s > i:
        t =  s - i
        ans += t
    elif s < i:
        ans += s
print(ans)


Measured memory_bytes: 18676
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define MOD 1000000007
using namespace std;

int main(void){
	string s;
	cin >> s;
	for(int i=0; i+1<s.length(); i++){
		if(s[i]==s[i+1]){
			cout << i+1 << " " << i+2 << endl;
			return 0;
		}else if(i+2<s.length() && s[i]==s[i+2]){
			cout << i+1 << " " << i+3 << endl;
			return 0;
		}
	}
	cout << -1 << " " << -1 << endl;
	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
int main(){
 int sec,h,m,s;
 scanf("%d",&sec);
 s=sec%60;
 h=(sec-sec%3600)/3600;
 m=(sec-s-h*3600)/60;
 printf("%d:%d:%d\n",h,m,s);
return 0;
}

Measured memory_bytes: 592
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

string s;

int main(){
	cin >> s;
	cout << s.substr(0,s.size()-8) << endl;
}

Measured memory_bytes: 256