akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <complex>
#include <vector>

using namespace std;

#define dump(n) cerr<<"# "<<#n<<"="<<(n)<<endl

const double EPS=1e-6;
const double INFTY=1e20;

typedef complex<double> Point;

struct Line{
	Point pos,dir;
	Line(){}
	Line(Point p,Point d):pos(p),dir(d){}
};

double Signum(double x)
{
	return abs(x)<EPS?0:x>0?1:-1;
}
double Comp(double a,double b)
{
	return Signum(a-b);
}
double Dot(Point a,Point b)
{
	return real(conj(a)*b);
}
double Cross(Point a,Point b)
{
	return imag(conj(a)*b);
}
Point Proj(Point a,Point b)
{
	return Dot(a,b)/norm(b)*b;
}
Point Perp(Point a,Point b)
{
	return Proj(a,b)-a;
}
int CCW(Point a,Point b,Point c)
{
	Point d1=b-a,d2=c-a;
	double sign=Signum(Cross(d1,d2));
	if(sign)
		return sign;
	if(Comp(Dot(d1,d2),0)<0)
		return -2; // c-a-b
	if(Comp(norm(d1),norm(d2))<0)
		return 2;  // a-b-c
	return 0;      // a-c-b
}
bool IntersectLS(Line l,Line s)
{
	Point a=l.pos;
	Point b=l.pos+l.dir;
	Point c=s.pos;
	Point d=s.pos+s.dir;
	return CCW(a,b,c)*CCW(a,b,d)<0;
}
bool IntersectSS(Line s1,Line s2)
{
	return IntersectLS(s1,s2) && IntersectLS(s2,s1);
}
double DistLP(Line l,Point p)
{
	return abs(Perp(p-l.pos,l.dir));
}
double DistSP(Line s,Point p)
{
	Point a=s.pos+Proj(p-s.pos,s.dir);
	int ccw=CCW(s.pos,s.pos+s.dir,a);
	if(ccw==-2)
		return abs(p-s.pos);
	if(ccw==2)
		return abs(p-(s.pos+s.dir));
	return DistLP(s,p);
}
double DistSS(Line s1,Line s2)
{
	if(IntersectSS(s1,s2))
		return 0;
	double a=DistSP(s1,s2.pos);
	double b=DistSP(s1,s2.pos+s2.dir);
	double c=DistSP(s2,s1.pos);
	double d=DistSP(s2,s1.pos+s1.dir);
	return min(min(a,b),min(c,d));
}
bool IsCover(Line l,int sx,int sy,int ex,int ey)
{
	Point a=l.pos,b=l.pos+l.dir;
	Point p[4]={Point(sx,sy),Point(ex,sy),Point(ex,ey),Point(sx,ey)};
	int c1=CCW(p[3],p[0],a),c2=CCW(p[3],p[0],b);
	for(int i=1;i<4;i++)
		if(c1*CCW(p[i-1],p[i],a)<0 || c2*CCW(p[i-1],p[i],b)<0)
			return false;
	return true;
}

int main()
{
	for(int n;cin>>n,n;){
		int sx,sy,ex,ey; cin>>sx>>sy>>ex>>ey;
		Line l(Point(sx,sy),Point(ex-sx,ey-sy));
		vector<double> ds(n,INFTY),hs(n);
		for(int i=0;i<n;i++){
			cin>>sx>>sy>>ex>>ey>>hs[i];
			if(IsCover(l,sx,sy,ex,ey)){
				ds[i]=0;
				continue;
			}
			double a=DistSS(l,Line(Point(sx,sy),Point(ex-sx,0)));
			double b=DistSS(l,Line(Point(sx,sy),Point(0,ey-sy)));
			double c=DistSS(l,Line(Point(ex,ey),Point(sx-ex,0)));
			double d=DistSS(l,Line(Point(ex,ey),Point(0,sy-ey)));
			ds[i]=min(min(a,b),min(c,d));
		}
		
		double res=INFTY;
		for(int i=0;i<n;i++){
			double d=ds[i],h=hs[i];
			double x;
			if(d<h)
				x=d;
			else
				x=(h*h+d*d)/(2*h);
			res=min(res,x);
		}
		printf("%.4f\n",res);
	}
	
	return 0;
}

Measured memory_bytes: 0
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;



public class Main{


	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));


		try{
		int n=Integer.parseInt(reader.readLine());//n?????????
		String text=reader.readLine();


		String[] num_array=text.split(" ");
		int[] num_array_int=new int[num_array.length];

		for(int i=0;i<num_array.length;i++){
			num_array_int[i]=Integer.parseInt(num_array[i]);
		}

		swap(num_array_int);

		for(int i=0;i<n;i++){
			System.out.print(num_array_int[i]);
			if(i!=n-1){System.out.print(" ");}
		}System.out.println();
		reader.close();

		}catch(IOException e){
			System.out.println("??¨??????"+e);
		}

	}

	//????????????????????\?????????????????????????????????
	public static void swap(int x[]){
		//????????????????????????
		int len=x.length;
		int a;
		for(int i=0;i<(len/2);i++){
			a=x[i];
			x[i]=x[(len-1)-i];
			x[(len-1)-i]=a;
		}


	}

}

Measured memory_bytes: 24232
i = list(map(int, input().split()))
a = i[0]
b = i[1]
k = i[2]

def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

for i in range(k):
    if is_even(a):
        a = a / 2
        b = b + a

        tmp = a
        a = b
        b = tmp
    else:
        a = a - 1
        a = a / 2
        b = b + a

        tmp = a
        a = b
        b = tmp

if is_even(k):
    print(int(a), int(b))
else:
    tmp = a
    a = b
    b = tmp
    print(int(a), int(b))

Measured memory_bytes: 3192
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define REPD(i,a,b) for (int i=(a);i<(b);i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef set<int> si;
typedef vector<si> vsi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pi;
typedef queue<int> qi;
typedef queue<pi> qpi;
typedef pair<ll, ll> pll;
typedef queue<pll> qpll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const int mod = 1000000007;
const int INF = 1001001001;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 文字変換　
// 順列　do {} while(next_permutation(ALL(X)));
// 最大値　LLONG_MAX
// a内でx以上　auto iter = lower_bound(ALL(a), x);
// a内でxより大きい　auto iter = upper_bound(ALL(a), x);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}


int main() {
  char t[200001];
  cin >> t;
  int n=strlen(t);
  REP(i,n) {
    if(t[i]=='?') t[i]='D';
    cout << t[i];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3832
//参考：https://qiita.com/DaikiSuyama/items/9dba963ba74396b9b7fd
//インクルード(アルファベット順)
#include <algorithm>     //sort,二分探索,など
#include <bitset>        //固定長bit集合
#include <cmath>         //pow,logなど
#include <complex>       //複素数
#include <deque>         //両端アクセスのキュー
#include <functional>    //sortのgreater
#include <iomanip>       //setprecision(浮動小数点の出力の誤差)
#include <iostream>      //入出力
#include <iterator>      //集合演算(積集合,和集合,差集合など)
#include <map>           //map(辞書)
#include <numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include <queue>         //キュー
#include <set>           //集合
#include <stack>         //スタック
#include <string>        //文字列
#include <unordered_map> //イテレータあるけど順序保持しないmap
#include <unordered_set> //イテレータあるけど順序保持しないset
#include <utility>       //pair
#include <vector>        //可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define FIR first    //pairの一つ目の要素
#define SEC second   //pairの二つ目の要素

signed main()
{
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int H, W, K;
    cin >> H >> W >> K;

    //マス目配列
    vector<vector<int>> C(H, vector<int>(W));
    REP(i, H)
    {
        string t;
        cin >> t;

        REP(j, W)
        {
            //黒が１、白が０
            C[i][j] = (t[j] == '#' ? 1 : 0);
        }
    }

    int ans = 0;
    //どの行または列が選択されているかを示す値
    REP(is, 1 << H)
    REP(js, 1 << W)
    {
        //ある行及び列を選択する組み合わせにおける黒色マスの個数
        int count = 0;

        //各マス目を見ていく
        REP(i, H)
        REP(j, W)
        {
            //i行目またはj列目が選択されていた場合、i行j列目のマスは赤色なのでスキップ
            if (is >> i & 1 || js >> j & 1)
                continue;

            //もしi行j列目のマスが黒色の場合+1
            if (C[i][j] == 1)
                count++;
        }

        //もし黒色マスがK個の場合、条件にマッチする
        if (count == K)
            ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3196
#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define F first
#define S second
using namespace std;
#define mod 1000000007

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int t=1;
    while(t--){
        int r,g,b; cin>>r>>g>>b;
        int k; cin>>k;
        int cnt=0;
        while(g<=r){
            g=g*2; cnt++;
        }
        while(b<=g){
            b=b*2; cnt++;
        }
        if(cnt<=k){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
    }

}


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

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] array = new int[3];
		    array[0] = scanner.nextInt();
		    array[1] = scanner.nextInt();
		    array[2] = scanner.nextInt();
		    
		    Arrays.sort(array);
		    
		    if( array[0] + array[1] == array[2] ) 
		    {
		    	System.out.println("Yes");
		    }
		    else 
		    {
		    	System.out.println("No");
		    }
		    
		    scanner.close(); }
		  }

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a[100000];
	int n,k;
	cin>>n>>k;
	k-=1;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	int m=a[k]-a[0];
	for(int l=1;l<n-k;l++){
		m=min(a[l+k]-a[l],m);
	}
	cout<<m<<endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

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

  cout << (a >= n % 500 ? "Yes" : "No") << endl;

  
  return 0;
}

Measured memory_bytes: 256
#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>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#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 ASSERT(cond,mes) assert(cond && mes)

using namespace std;
using ll = long long;

constexpr int mod = 1'000'000'007;
constexpr int INF = 1'050'000'000;

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

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

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

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u * v / gcd(u, v);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    int N;
    cin >> N;
    vector<int>A(N);
    cin >> A;
    vector<int>B(N);
    cin >> B;
    vector<int>C(N);
    cin >> C;

    SORT(A);
    SORT(B);
    SORT(C);

    ll ans = 0;
    REP(i, N) {
        ll a = lower_bound(ALL(A), B[i]) - A.begin();
        ll c = C.end() - upper_bound(ALL(C), B[i]);
        ans += a * c;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

bool binarySearch(const vector<int> &S, int key) {
    int left=0;
    int right=S.size();
    int mid;
    
    while (left < right) {
        mid = (left + right) / 2;
        if (key == S[mid]) return true;
        if (key > S[mid]) left = mid + 1;
        else if (key < S[mid]) right = mid;
    }
    return false;
}

int main() {
    int n; cin>>n;
    vector<int> S(n);
    for (int i=0;i<n;i++) cin>>S[i];

    int cnt=0;
    int q; cin>>q;
    for (int i=0;i<q;i++) {
        int t; cin>>t;
        if (binarySearch(S,t)) cnt++;
    }

    cout << cnt << endl;
    

    return 0;
}


Measured memory_bytes: 3124
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
int main() {
	string s;
	cin >> s;
	bool flag = true;
	rep(i, s.size()) {
		if (i % 2 == 0 &&( s[i] != 'h'||s[i + 1] != 'i')) {
			flag = false;
		}
	}
	if (flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
h, w, v = map(int, input().split())
mas = [list(input()) for i in range(h)]

ans = 0
for i in range(2**h):
  for j in range(2**w):
    res = 0
    hlist = []
    wlist = []
    for k in range(h):
      if (i >> k) & 1:
        hlist.append(k)
    for k in range(w):
      if (j >> k) & 1:
        wlist.append(k)
    
    for k in range(h):
      if k in hlist:
        continue
      for l in range(w):
        if l in wlist:
          continue
        if mas[k][l] == "#":
          res += 1
    if res == v:
      ans += 1
        
print(ans)

Measured memory_bytes: 74160
#include <bits/stdc++.h>
 
using namespace std;
 
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()
#define rep(i, st, n) for (int i = (st); i < (n); ++i)
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
 
template <typename T1, typename T2> bool chkmin(T1 &x, T2 y) { return y < x ? (x = y, true) : false; }
template <typename T1, typename T2> bool chkmax(T1 &x, T2 y) { return y > x ? (x = y, true) : false; }

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifdef DEBUG
    freopen("in", "r", stdin);
#endif
    
    int n, k;
    cin >> n >> k;
    set<int> DD;
    for (int d = 0; d < 10; ++d) DD.insert(d);
    for (int i = 0; i < k; ++i)
    {
        int x;
        cin >> x;
        DD.erase(x);
    }
    vector<int> D(all(DD));
    int mx = D.back();
    int mn = D[0];
    
    vector<int> a;
    int nn = n;
    while (nn > 0)
    {
        a.pb(nn % 10);
        nn /= 10;
    }

    if (a.back() > mx)
    {
        if (mn == 0)
            cout << D[1];
        else
            cout << mn;
        for (int i = 0; i < a.size(); ++i)
            cout << mn;
        cout << '\n';
        return 0;
    }

    for (int x = n; x <= 1000000; ++x)
    {
        int y = x;
        bool ok = true;
        while (y)
        {
            int d = y % 10;
            ok &= DD.count(d);
            y /= 10;
        }
        if (ok)
        {
            cout << x << '\n';
            return 0;
        }
    }

    return 0;
}



Measured memory_bytes: 256
import java.util.*;

public class Main {
	int N, M, X;
	List<Integer> A = new ArrayList<>();
	int result;

	private Main(Scanner in) {
		String[] tokens = in.nextLine().split(" ");
		N = Integer.parseInt(tokens[0]);
		M = Integer.parseInt(tokens[1]);
		X = Integer.parseInt(tokens[2]);
		tokens = in.nextLine().split(" ");
		for (int i = 0; i < M; ++i) {
			A.add(Integer.parseInt(tokens[i]));
		}
	}

	private void calc() {
		Integer[] rightGates = A.stream().filter(x -> x > X).toArray(Integer[]::new);
		Integer[] leftGates = A.stream().filter(x -> x < X).toArray(Integer[]::new);
		result = Math.min(rightGates.length, leftGates.length);
	}

	private void show() {
		System.out.println(result);
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Main ins = new Main(in);
		ins.calc();
		ins.show();
		in.close();

	}

}

Measured memory_bytes: 26964
let readStringArray() = stdin.ReadLine().Split(' ')
let readIntArray() = readStringArray() |> Array.map (fun x -> int x)

let [| X; Y |] = readIntArray()

let group x =
  let g1: Set<int> = Set.ofList [4; 6; 9; 11]
  if Set.contains x g1 then 0
  elif x = 2 then 1
  else 2
  
printfn "%s" <| if (group X) = (group Y) then "Yes" else "No"
  

Measured memory_bytes: 12764
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define gcd(a,b) __gcd(a,b)
#define ff first
#define ss second
#define p pair<int,int>
#define pb push_back
#define endl '\n'
#define w(t) ll test;cin>>test;while(test--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
#define pi acos(-1)

int main()
{
    fast;
    ll n;
    cin>>n;
    ll l;
    cin>>l;
    vector<ll> vec(n);
    for(auto &i:vec)
    {
        cin>>i;
    }
    int temp=0;
    for(int i=0;i<n-1;i++)
    {
        if(vec[i]+vec[i+1]>=l)temp=i+1;
    }
    if(!temp)cout<<"Impossible"<<endl;
    else
    {
        cout<<"Possible"<<endl;
        for(int i=1;i<temp;i++)
        {
            cout<<i<<endl;
        }
        for(int i=n-1;i>temp;i--)
        {
            cout<<i<<endl;
        }
        cout<<temp;
    }
}



Measured memory_bytes: 3916
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

struct edge{ll from, to, cost;};

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,m,p;
  cin >> n >> m >> p;
  edge es[m];
  ll d[n];
  ll a,b,c; 
  rep(i,m){
    cin >> a>> b>>c;
    a--;b--;
    c-=p;c=-c;
    es[i]={a,b,c};       
  }
  ll inf=1e15;
  rep(i,n) d[i]=inf;
  d[0]=0;
  ll cou=0;
  ll kari;
  while(1){
    bool update=false;
    rep(i,m){
      edge e=es[i];
      if(d[e.from]!=inf && d[e.to]>d[e.from]+e.cost){
	d[e.to]=d[e.from]+e.cost;
	update =true;
      }      
    }
    if(!update) break;
    cou++;
    if(cou==m) kari=d[n-1];
    if(cou==2*m){
      if(kari!=d[n-1]){
	cout << -1 << endl;
	return 0;
      }
      else{
	break;
      }
    }
  }
  
  cout << max(0LL, -d[n-1]) << endl;

    
  return 0;
    

}


Measured memory_bytes: 512
#include<stdio.h>

int main(void)
{
 int i,j,n,h[20],m,s;
 scanf("%d",&n);
 for(i=0;i<n;i++)
 scanf("%d",&h[i]);
 m=0;
 s=0;
 for(j=0;j<n;j++){
    if(h[j]>=m){
       m=h[j];
       s=s+1;
    }
 }
 printf("%d\n",s);
 return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
//#define MOD 1000000007
#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

int main(){
    int x,y,a,b,c; cin >> x >> y >> a >> b >> c;
    vector<int> p(a),q(b),r(c);
    rep(i,a) cin >> p[i];
    rep(i,b) cin >> q[i];
    rep(i,c) cin >> r[i];
    sort(p.rbegin(),p.rend());
    sort(q.rbegin(),q.rend());
    sort(r.rbegin(),r.rend());
    priority_queue<int,vector<int>,greater<int>> pq;
    ll ans = 0;
    rep(i,x){
        ans += p[i];
        pq.push(p[i]);
    }
    rep(i,y){
        ans += q[i];
        pq.push(q[i]);
    }
    rep(i,c){
        int u = pq.top();
        if(u < r[i]){
            ans += r[i]-u;
            pq.pop();
        }
        else break;
    }
    cout << ans << endl;
}


Measured memory_bytes: 2552
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef set<int> si;
typedef set<ll> sl;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
#define per(i,a,b) for(int i=(b)-1; i>=(a); --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second

int n, tx, ty, cx, cy;
string s;
vector<int> dx;
vector<int> dy;

int main(void) {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	//freopen("in.txt", "r", stdin);
	cin >> s >> tx >> ty;
	cx = cy = 0;
	n = s.size();
	int idx;
	rep(i,0,n) {
		if(s[i] == 'T') {
			idx = i;
			break;
		} else {
			cx++;
		}
	}
	bool flag = true;
	int loc = 0;
	rep(i,idx+1,n+1) {
		if(i == n || s[i] == 'T') {
			if(loc > 0) {
				if(flag) {
					dy.pb(loc);
				} else {
					dx.pb(loc);
				}
			}
			loc = 0;
			flag = !flag;
		} else {
			loc++;
		}
	}

	//cout << cx << ' ' << cy << endl;
	//cout << dx.size() << ' ' << dy.size() << endl;
	cx += 8000;
	int p = dx.size();
	vector<vector<bool> > dpX(p+1, vector<bool>(16000, false));
	dpX[0][cx] = true;
	rep(i,0,p) {
		rep(j,0,16001) {
			if(dpX[i][j]) {
				if(j+dx[i] <= 16000)
					dpX[i+1][j+dx[i]] = true;
				if(j-dx[i] >= 0)
					dpX[i+1][j-dx[i]] = true;
			}
		}
	}

	cy += 8000;
	int q = dy.size();
	vector<vector<bool> > dpY(q+1, vector<bool>(16000, false));
	dpY[0][cy] = true;
	rep(i,0,q) {
		rep(j,0,16000) {
			if(dpY[i][j]) {
				if(j+dy[i] <= 16000)
					dpY[i+1][j+dy[i]] = true;
				if(j-dy[i] >= 0)
					dpY[i+1][j-dy[i]] = true;
			}
		}
	}

	tx += 8000;
	ty += 8000;
	if(dpX[p][tx] && dpY[q][ty]) {
		cout << "Yes" << '\n';
	} else {
		cout << "No" << '\n';
	}
	return 0;
}


Measured memory_bytes: 8448
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int h=0, a=0;
	int cnt = 0;
	cin >> h >> a;
	while (h > 0)
	{
		h -= a;
		cnt++;
	}
	cout << cnt << endl;

}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
map<pair<ll, ll>, int> mp;
ll mod=1000000007, pr[200010];
int main(){
    int n;
    while(cin>>n){
        ll ans=1;
        ll x, y, g, tmp, x1, y1;
        pr[0]=1;
        for(int i=1; i<=n; ++i){
        	pr[i]=pr[i-1]*2;
        	pr[i]%=mod;
        }
        set<pair<ll, ll>>st;
        for(int i=1; i<=n; ++i){
            scanf("%lld%lld",&x,&y);
            if(x!=0 || y!=0){
	            g=__gcd(x, y);
	            x/=g;
	            y/=g;
        	}
            x1=x;
            y1=y;
        	x*=-1;
            if(x==0 && y!=0){
            	y=1;
            }
            if(y==0 && x!=0){
            	x=1;
            }
            if(x<0){
            	x*=-1;
            	y*=-1;
            }
            if(x1==0 && y1!=0){
            	y1=1;
            }
            if(y1==0 && x1!=0){
            	x1=1;
            }
            if(y1<0){
            	x1*=-1;
            	y1*=-1;
            }
            ++mp[mk(x1, y1)];
            if(st.find(mk(y, x))==st.end())
	           	st.insert(mk(x1, y1));
        }
        for(auto it:st){
        	x=it.fs;
        	y=it.sc;
            x1=x;
            y1=y;
        	x*=-1;
            if(x==0 && y!=0){
            	y=1;
            }
            if(y==0 && x!=0){
            	x=1;
            }
            if(x<0){
            	x*=-1;
            	y*=-1;
            }

            if(x1==0 && y1!=0){
            	y1=1;
            }
            if(y1==0 && x1!=0){
            	x1=1;
            }
            if(y1<0){
            	x1*=-1;
            	y1*=-1;
            }
            if(x==0 && y==0){
            	continue;
            }
            ans*=(pr[mp[mk(y, x)]]+pr[mp[mk(x1, y1)]]-1);
            ans%=mod;
        }
        ans+=mp[mk(0, 0)];
        --ans;
        ans%=mod;
        if(ans<0){
        	ans+=mod;
        }
        cout<<ans<<endl;
    }
  return 0;
}




Measured memory_bytes: 42692
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void) {
    int K, A, B;
    cin >> K >> A >> B;

    for(int i=A; i<=B; i++) {
        if(i%K == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }

    cout << "NG" << endl;
    return 0;
}


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

int n;
int a[200002], b[200002];
int c[200002], d[200002];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
    }
    for (int i = 1; i <= n; i++) {
        scanf("%d", &b[i]);
    }

    int ans = 0, ret;
    for (int k = 0; k <= 28; k++) {
        ret = 0;
        for (int i = 1; i <= n; i++) {
            c[i] = a[i]%(2<<k);
            d[i] = b[i]%(2<<k);
        }
        sort(d+1, d+1+n);
        int r1, r2;
        for (int i = 1; i <= n; i++) {
            int r1 = lower_bound(d+1, d+1+n, 2*(1<<k)-c[i]) - lower_bound(d+1, d+1+n, (1<<k)-c[i]);
            int r2 = lower_bound(d+1, d+1+n, 3*(1<<k)-c[i]) - (d+1);
            ret += (r1+n-r2);
        }
        if (ret % 2) {
            ans += (1<<k);
        }
    }

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

    return 0;
}

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

int main() {
    ll n;
    cin >> n;

    set<string> s;
    string st;
    ll ans = 0;
    for (int i=0; i<n; i++) {
        cin >> st;
        if (!s.count(st)) {
            ans++;
            s.insert(st);
        }
    }

    cout << ans << endl;

}

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

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


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int H = sc.nextInt();

		int W = sc.nextInt();

		int[][] tree = new int[H][W];

		long[][] dp = new long[H][W];

		int[][] rec = new int[H][W];

		//格納
		for(int i=0;i<H;i++) {

			for(int j=0;j<W;j++) {

				tree[i][j] = sc.nextInt();

				dp[i][j] = Long.MAX_VALUE;

				rec[i][j] = -1;

			}
		}

		dp[0][0] = 0;

		if(W>1)dp[0][1] = tree[0][1];

		if(H>1)dp[1][0] = tree[1][0];

		rec[0][0] = 0;

		if(W>1)rec[0][1] = 0;

		if(H>1)rec[1][0] = 0;

		int count = H*W;

		while(count>0) {

			for(int i=0;i<H;i++) {

				for(int j=0;j<W;j++) {

					if(!(i==0&&j==0) && !(i==0&&j==1) && !(i==1&&j==0)) {

						solve(dp,tree,rec,H,W,i,j);
					}
				}
			}

			count--;

		}
		System.out.println(dp[H-1][W-1]);

	}

	static void solve(long[][] dp,int[][] tree, int[][] rec,int H, int W, int x, int y) {

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

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

		long z = dp[x][y];

		//移動4方向をループ
		for(int i=0;i<4;i++) {

			int nx = x + dx[i];

			int ny = y + dy[i];

			//移動可能かどうか
			if(nx>=0 && nx<H && ny>=0 && ny<W) {

				//最小をさがす
				if((dp[nx][ny]+((rec[nx][ny]+1)*2+1)*tree[x][y])<z && dp[nx][ny]!=Long.MAX_VALUE) {
	

					rec[x][y] = rec[nx][ny]+1;

					dp[x][y] = dp[nx][ny] + ((rec[x][y])*2+1)*tree[x][y];
					
					z = dp[x][y];
				}
			}
		}
	}
}



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

#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
const int MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
struct edge { int v, w; };

int main() {
	int N; cin >> N;
	vector<int> t(N), v(N);
	rep(i, N) cin >> t[i];
	rep(i, N) cin >> v[i];
	int T = 0;
	rep(i, N) T += t[i];
	vector<int> ub(T * 2 + 1, INF);
	int x = 0;
	rep(i, N) rep(y, t[i]) {
		ub[x] = min(ub[x], v[i] * 2);
		ub[x + 1] = min(ub[x + 1], v[i] * 2);
		ub[x + 2] = min(ub[x + 2], v[i] * 2);
		x += 2;
	}
	ub[0] = ub[T * 2] = 0;
	rep(x, T * 2) ub[x + 1] = min(ub[x + 1], ub[x] + 1);
	for (int x = T * 2; x > 0; x--)
		ub[x - 1] = min(ub[x - 1], ub[x] + 1);
	double ans = 0;
	rep(x, T * 2) ans += (ub[x] + ub[x + 1]) / 2.0;
	printf("%.15f\n", ans / 4);
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
#define  pi  pair<int,int>
#define  pb  push_back
#define  F   first
#define  S   second
const int N=3e5+3;
string s;
int a[N];
int main()
{
    ft
    int t,i,j,n,m,x,l=0,r=0,mn=INT_MAX;
    cin>>n>>s;
    for(i=0;i<n;i++)
    {
        a[i]+=l;
        if(s[i]=='W')
        {
            l++;
        }
    }
    for(i=n-1;i>=0;i--)
    {
        a[i]+=r;
        if(s[i]=='E')
        {
            r++;
        }
        mn=min(mn,a[i]);
    }
    cout<<mn<<"\n";
    return 0;
}

Measured memory_bytes: 1812
#include <bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(long long i=a; i<b; i+=1)
#define repr(i,a,b) for(long long i=a; i<=b; i+=1)
#define vec vector<ll>
#define pb push_back
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())

using namespace std;
int main() {
  ll N;
  cin>>N;
  vec A(N);
  rep(i,0,N) cin>>A[i];
  bool ans=true;
  rep(i,0,N) {
    if(A[i]%2==0) {
      if(A[i]%3!=0 && A[i]%5!=0) {
        ans=false;
      }
    }
  }
  if(ans)
    cout<<"APPROVED"<<endl;
  else 
    cout<<"DENIED"<<endl;
}

Measured memory_bytes: 256
package main

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

var (
	abcd string

	ans []string
)

func main() {
	abcd = readString()
	ans = make([]string, len(abcd))

	dfs(0, 0)
	fmt.Println(ans[0] + ans[1] + ans[2] + ans[3] + "=7")
}

func dfs(depth, sum int) bool {
	if sum == 7 && depth == 4 {
		return true
	}
	if depth >= 4 {
		return false
	}
	if depth == 0 {
		ans[depth] = string(abcd[depth])
	} else {
		ans[depth] = "+" + string(abcd[depth])
	}
	if dfs(depth+1, sum+int(abcd[depth]-'0')) {
		return true
	}
	if depth == 0 {
		ans[depth] = string(abcd[depth])
	} else {
		ans[depth] = "-" + string(abcd[depth])
	}
	if dfs(depth+1, sum-int(abcd[depth]-'0')) {
		return true
	}
	return false
}

/*-------------------utilities-------------------*/

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

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

// 最大公約数
func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

// 最小公倍数
func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func comb(n, k int) int {
	if n < k {
		return 0
	}
	if n < 0 || k < 0 {
		return 0
	}
	return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD
}

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7

	COMB_MAX = 510000
)

var (
	readString func() string
)

var (
	fac  = [COMB_MAX]int{}
	finv = [COMB_MAX]int{}
	inv  = [COMB_MAX]int{}
)

func init() {
	readString = newReadString(os.Stdin)
}

func combInit() {
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i := 2; i < COMB_MAX; i++ {
		fac[i] = fac[i-1] * i % MOD
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
		finv[i] = finv[i-1] * inv[i] % MOD
	}
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

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

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

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

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> Q;

ll mod = 1000000007;
int a, b;
ll ans;
vector<P> vec;

int po(int x, int y)
{
	if (y == 0) return 1;
	return po(x, y - 1) * x;
}

int main()
{
	cin >> a >> b;
	if (a >= 13)
	{
		cout << b << endl;
	}
	else if (a >= 6)
	{
		cout << b / 2 << endl;
	}
	else
	{
		cout << 0 << endl;
	}
	cin >> a;
}

Measured memory_bytes: 256
/**
 * @author cplayer on 2018/6/23.
 * @version 1.0
 */

import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {

    public static void main(String[] args) {
        try {
            InputReader in;
            PrintWriter out;
            boolean useOutput = false;
            // if (System.getProperty("ONLINE_JUDGE") == null) useOutput = true;
            if (useOutput) {
                FileInputStream fin = new FileInputStream(new File("src/data.in"));
                in = new InputReader(fin);
                FileOutputStream fout = new FileOutputStream(new File("src/data.out"));
                out = new PrintWriter(fout);
            } else {
                InputStream inputStream = System.in;
                in = new InputReader(inputStream);
                OutputStream outputStream = System.out;
                out = new PrintWriter(outputStream);
            }
            Solver solver = new Solver();
            solver.solve(in, out);
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    static class Solver {

        public void solve(InputReader cin, PrintWriter cout) {
            try {
                int n, k;
                // int onePos = 0;
                n = cin.nextInt(); k = cin.nextInt();
                for (int i = 0; i < n; ++i) {
                    int tmp = cin.nextInt();
                    // if (tmp == 1) onePos = i;
                }
                int ans = 0;
                if ((n - 1) % (k - 1) != 0) ans = (n - 1) / (k - 1) + 1;
                else ans = (n - 1) / (k - 1);
                cout.println(ans);
            } catch (RuntimeException e) {
                e.printStackTrace();
                return;
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }

        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 1000000);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

    }

}

Measured memory_bytes: 31700
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = int(1e9)+7;

#define inchar			getchar//_unlocked
#define outchar(x)		putchar(x)//_unlocked(x)

template<typename T> void inpos(T &x) {
	x = 0;
	register T c = inchar();
	while(((c < 48) || (c > 57)) && (c != '-')) c = inchar();
	bool neg = false;
	if (c=='-') neg = true;
	for(; c < 48 || c > 57; c = inchar()) ;
	for(; c > 47 && c < 58; c = inchar()) {
		x = (x<<3) + (x<<1) + (c&15);
	}
	if(neg) x = -x;
}

template<typename T> void outpos(T n) {
	if(n < 0) { outchar('-'); n *= -1; }
	char snum[65];
	int i = 0;
	do {
		snum[i++] = n % 10 + '0';
		n /= 10;
	} while(n);
	i = i - 1;
	while (i >= 0) outchar(snum[i--]);
}
double tick() { 
	static clock_t oldticks;
	clock_t newticks = clock();
	double diff = 1.0 * (newticks - oldticks) / CLOCKS_PER_SEC; 
	oldticks = newticks;
	return diff;
}

int main () {
	int n;
	inpos(n);
	int x,y,z;
	vector < vector <int > > data(n,vector <int> (3));
	
	for (int i = 0; i<n;i++) {
		// cin >> data[0] >> data[1] >> data[2];
		inpos(x); inpos(y) ; inpos(z);
		// data[i].push_back(x);
		data[i][0] = x;
		data[i][1] = y;
		data[i][2] = z;

	}
 
	for (int i = n-2; i>=0 ;i--) {
		data [i][0] += max(data[i+1][1], data[i+1][2]);
		data [i][1] += max(data[i+1][0],data[i+1][2] );
		data [i][2] += max(data[i+1][0],data[i+1][1] );
	}
	outpos(max (data[0][0], max(data[0][1],data[0][2]) ));

}

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

for i in range(n-1):
    if a[i]+a[i+1] >= l:
        print("Possible")
        for j in range(1,i+1):
            print(j)
        for k in range(n-1,i,-1):
            print(k)
        exit()
print("Impossible")  

Measured memory_bytes: 14060
#A

#デバッグ
debug=1
def pront(*n):
    if debug==1:
        print(n)
        
#10**9+7を底とした処理

base=10**9+7

def add(a,b):#a+b
    return (a+b)%base

def sub(a,b):#a-b
    return (a-b)%base

def multi(a,b):#a*b
    return (a*b)%base

def exp(a,b):#a**b
    x=1
    c=a
    d=b
    while d!=0:
        if d%2==1:
            x=multi(x,c)
        c=(c**2)%base
        d=d//2
    return x

def div(a,b):#a/b
    return(multi(a,exp(b,base-2)))

#入力

R=int(input())


#処理
import math as m

print(m.pi*R*2)


Measured memory_bytes: 9120
import numpy as np
import math

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

a, b, c, d = [int(i) for i in input().split()]
#
#num = np.arange(b - a + 1) + a
#
#if b < c and b < d:
#    print('0')
#    exit(0)
#
#m = min(c, d)
#div = max(c, d)
#tmp = []
#div = num[0] // div + div
#index = 0
#while True:
#    if n[index] % div != 0:
#        if index + div >
#        tmp += range(n[index], n[index])
#        index += 1
#    else:
#        index += div
#
#tmp = np.array(tmp)
#print(tmp[tmp % m == 0].shape[0])


size = b - a + 1
cd = int(c * d // gcd(c, d))
c_num_a = a // c
d_num_a = a // d
cd_num_a = a // cd
c_num_b = b // c
d_num_b = b // d
cd_num_b = b // cd

c_num = c_num_b - c_num_a
d_num = d_num_b - d_num_a
cd_num = cd_num_b - cd_num_a

if a % c == 0:
    c_num += 1
if a % d == 0:
    d_num += 1
if a % cd == 0:
    cd_num += 1

print(size - c_num - d_num + cd_num)

Measured memory_bytes: 12516
//Bismillahir Rahmanir Raheem
//In the name of Allah , Most Gracious , Most Merciful

/*

  * * * * * * *   * * * * * * *   *           *   * * *   * * * * * *
              *   *           *   *           *     *     *           *
              *   *           *   *           *     *     *             *
              *   *           *   *           *     *     *             *
              *   * * * * * * *   * * * * * * *     *     *             *
  *           *   *           *   *           *     *     *             *
  *           *   *           *   *           *     *     *             *
  *           *   *           *   *           *     *     *           *
  * * * * * * *   *           *   *           *   * * *   * * * * * *

*/



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


#define BOOST ios_base::sync_with_stdio(false) , cin.tie(NULL)


int main()
{
    BOOST;

    long long int x,i;
    cin>>x;
    int c = 0;
    for(i=100;i<x;){
        i = i + i*0.01;
        c++;
    }
    cout<<c<<endl;
    return 0;
}












Measured memory_bytes: 3660
#include<iostream>
#define ll long long
#define MOD 1000000007
using namespace std;
int main()
{
    int n;
    cin>>n;
    int *arr=new int[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    ll int **dp=new ll int*[n+1];
    for(int i=0;i<=n;i++)
        dp[i]=new ll int[n+1]();
    
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=n;j++)
            dp[i][j]=0;
    }
    
    for(int len=1;len<=n;len++)
    {
        for(int i=1;i<=n-len+1;i++)
        {
            int j=i+len-1;
            
            if(i==j)
                dp[i][j]=arr[i-1];
            else
            {
                dp[i][j]=max(arr[i-1]-dp[i+1][j],arr[j-1]-dp[i][j-1]);
            }
       
            
        }
     
    }
    cout<<dp[1][n];
           
}


Measured memory_bytes: 73516
#include<bits/stdc++.h> 
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
typedef long long ll;
using namespace std;
inline int read(){
	int n=0,f=1;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if (c=='-') c=getchar(),f=-1;
	for(;c>='0'&&c<='9';c=getchar()) n=n*10+c-48;
	return n*f;
}
const int maxn=400+5;
int n,i,h,A,B,C,D,d[maxn],f[maxn];
bool b[maxn],bz[maxn];
int get(int x){return (f[x])?f[x]=get(f[x]):x;}
void hb(int x,int y){
	x=get(x),y=get(y);
	if (x!=y) f[x]=y;
}
int main(){
	n=read(),h=read()+1;	
	for(;n--;){
		A=read(),B=read(),C=read(),D=read();
		int l=(C)?-C:A,r=(D)?D:-B;
		l+=h,r+=h;
		d[l]--,d[r]++; 
		b[l]=b[r]=1,hb(l,r);
	}
	fo(i,1,h-1) if (d[i]<0) return puts("NO"),0;
	fo(i,h+1,h<<1) if (d[i]>0) return puts("NO"),0;
	fo(i,1,h<<1) if (d[i]) bz[get(i)]=1;
	fo(i,1,h<<1) if (b[i]&&!f[i]&&!bz[i]) return puts("NO"),0;
	puts("YES");
}

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

for i in range(N):
    A[i] = list(map(int, input().split()))

cnt = 0
for a in A:
    x = 0
    for i in range(M):
        x += a[i] * B[i]
    if x + C > 0:
        cnt += 1
    
print(cnt)

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

int main ()
{
    int n;
    bool four = 0;
    cin >> n;
    vector<char> arare(n);
    
    for (int i = 0; i<n ;i++)
    {
        cin >> arare.at(i);
        if(arare.at(i) == 'Y')
        four = 1;
    }

    if (four)
    cout<<"Four"<<endl;
    else 
    cout<<"Three"<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
int k,stack[1010][5],i,j,a,b,n,x,y,z[20][20];
while(1){
scanf("%d %d\n",&a,&b);
if(a==0 && b==0){
break;
}
for(i=0;i<19;i++){
for(j=0;j<19;j++){
z[i][j]=-1;
}
}
for(i=1;i<=a;i++){
for(j=1;j<=b;j++){
z[i][j]=0;
}
}
scanf("%d\n",&n);
for(i=0;i<n;i++){
scanf("%d %d\n",&x,&y);
z[x][y]=-1;
}
stack[1][0]=1,stack[1][1]=1,k=1;
do{
if(z[stack[k][0]+1][stack[k][1]]>=0 && z[stack[k][0]][stack[k][1]+1]>=0){
stack[k][0]++;
k++;
stack[k][0]=stack[k-1][0]-1,stack[k][1]=stack[k-1][1]+1;
z[stack[k-1][0]][stack[k-1][1]]++,z[stack[k][0]][stack[k][1]]++;
}
else if(z[stack[k][0]+1][stack[k][1]]>=0 && z[stack[k][0]][stack[k][1]+1]==-1){
stack[k][0]++;
z[stack[k][0]][stack[k][1]]++;
}
else if(z[stack[k][0]+1][stack[k][1]]==-1 && z[stack[k][0]][stack[k][1]+1]>=0){
stack[k][1]++;
z[stack[k][0]][stack[k][1]]++;
}
else{
k--;
}
}while(k!=0);
printf("%d\n",z[a][b]);
}
return 0;
}


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

string o, e;

int main(void){
	cin >> o >> e;
	int n, m;
	n = o.size();
	m = e.size();
	if(n-m == 1) e+='#';
	rep(i, n){
		cout << o[i];
		if(e[i] != '#') cout << e[i];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 3632
# abc117_b.py
# https://atcoder.jp/contests/abc117/tasks/abc117_b

# B - Polygon /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 2次元平面上に辺の長さがそれぞれ L1,L2,...,LN の N角形(凸多角形でなくてもよい)が描けるかを判定してください。
# ここで、次の定理を利用しても構いません。

# 定理 : 一番長い辺が他の N−1辺の長さの合計よりも真に短い場合に限り、条件を満たす N角形が描ける。

# 制約
#     入力は全て整数である。
#     3≤N≤10
#     1≤Li≤100

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# L1 L2 ... LN

# 出力
# 条件を満たす N角形が描けるなら Yes、そうでないなら No を出力せよ。

# 入力例 1
# 4
# 3 8 5 1

# 出力例 1
# Yes

# 8<9=3+5+1なので、定理より 2 次元平面上に条件を満たす N角形が描けます。

# 入力例 2
# 4
# 3 8 4 1

# 出力例 2
# No

# 8≥8=3+4+1なので、定理より 2 次元平面上に条件を満たす N角形は描けません。

# 入力例 3
# 10
# 1 8 10 5 8 12 34 100 11 3

# 出力例 3
# No


def calculation(lines):
    N = lines[0]
    # N = int(lines[0])
    values = list(map(int, lines[1].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i+1]))

    ma = max(values)
    su = sum(values)

    if ma * 2 < su:
        result = 'Yes'
    else:
        result = 'No'

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['4', '3 8 5 1']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['4', '3 8 4 1']
        lines_export = ['No']
    if pattern == 3:
        lines_input = ['10', '1 8 10 5 8 12 34 100 11 3']
        lines_export = ['No']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()


Measured memory_bytes: 9032
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

ll kei[16]; //各桁ごとの合計
ll sz[16]; //各桁ごとの要素数
ll st[16]; //各桁のスタート地点
ll syou[16][2]; //各桁ごとの15ごとに何文字ずつあるか
int main()
{
	ll s;
	cin>>s;
	//s--;
	for(ll i=0;i<16;i++)
	{
		syou[i][0]=32+(i+2)*8; //大半はこっち
		syou[i][1]=32+(i+1)*5+(i+2)*3; //各桁の最初だけこれ
	}
	ll cnt=6;
	for(ll i=0;i<16;i++)
	{
		kei[i]=syou[i][1]+syou[i][0]*(cnt-1);
		sz[i]=cnt;
		cnt*=10;
	}
	cnt=90;
	st[0]=1;
	for(ll i=1;i<16;i++)
	{
		st[i]=cnt+1;
		cnt=cnt*10+90;
	}
	//どの桁で超過するか求める
	ll now=1;
	int keta=-1; //どの桁かを記録
	for(int i=0;i<16;i++)
	{
		if(s<now+kei[i])
		{
			keta=i;
			break;
		}
		now+=kei[i];
	}
	ll ban=-1; //何番目かを記録
	ll start=-1; //最終的なスタート地点（文字単位なので注意！）
	if(s-now<syou[keta][1])
	{
		ban=0;
		start=s-now;
	}else{
		now+=syou[keta][1];
		ban=(s-now)/syou[keta][0]+1;
		start=(s-now+syou[keta][0])%syou[keta][0];
	}
	//cerr<<now<<" "<<keta<<" "<<ban<<" "<<start<<endl;
	string ans; //答えを含む文字列
	//スタート地点を含む部分を記録
	for(ll i=0;i<15;i++)
	{
		ll tmp=i+st[keta]+ban*15;
		if(tmp%15==0)
			ans+="FizzBuzz";
		else if(tmp%5==0)
			ans+="Buzz";
		else if(tmp%3==0)
			ans+="Fizz";
		else
			ans+=to_string(tmp);
	}
	//その次の文字列を記録
	if(ban+1>sz[keta])
	{
		keta++;
		ban=0;
	}else{
		ban++;
	}
	for(ll i=0;i<15;i++)
	{
		ll tmp=i+st[keta]+ban*15;
		if(tmp%15==0)
			ans+="FizzBuzz";
		else if(tmp%5==0)
			ans+="Buzz";
		else if(tmp%3==0)
			ans+="Fizz";
		else
			ans+=to_string(tmp);
	}

	//答えの出力
	//指定された位置から20文字出せば良い
	for(int i=0;i<20;i++)
		cout<<ans[i+start];
	cout<<endl;
	return 0;
}


Measured memory_bytes: 3288
import java.util.Scanner;

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

		Long answer = null;
		for (int i = 0; i < n; i++) {
			long a = sc.nextLong();
			if (answer == null) {
				answer = a;
				continue;
			}
			answer = gcd(answer, a);
		}
		System.out.println(answer);
	}

	private static long gcd(long a, long b) {
		if (b == 0) return a;
		return gcd(b, a % b);
	}
}


Measured memory_bytes: 48788