akhauriyash/Code-Regression huggingface dataset:
[sx,sy,tx,ty] = [int(i) for i in input().split()]
"""
cnt = 0

while cnt < 4:
    #s -> t
    if cnt % 2 == 0:
"""
#出入り*2で周りの点を4回通ることになる
#(sx-1,sy),(sx+1,sy),(sx,sy-1),(sx,sy+1)
#長方形の端を行って帰ってきたあと、それの1周り遠くを進む道

dx = tx-sx
dy = ty-sy
ans = ""
#1周目
ans += "R" * dx + "U" * dy+"L" * dx + "D" * dy
#2週目行き
ans += "D" + "R" *(dx+1) + "U" * (dy+1) +"L"
#2週目帰り
ans += "U" + "L" * (dx+1) + "D" * (dy+1) +"R"

print(ans)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>

#define DIV 1000000007
using namespace std;

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

    string s, t;
    cin >> s >> t;
    for (int i = 0; i < 2 * N; i++) {
        if (!(i % 2))
            cout << s[i / 2];
        else if (i % 2)
            cout << t[i / 2];
    }
    cout << endl;
    
}


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

using namespace std;
typedef long long ll;
//ループ
#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--)
//コンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
#define D()
//定数
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

//2値の最大公約数(順序関係なし・0はダメ)
int gcd(int a, int b){
    return b ? gcd(b, a%b) :a;
}

//n個の最大公約数
int ngcd(vector<int>& a){
    int res;
    res = a.at(0);
    for(int i = 1; i< a.size() && res != 1; i++){
        res = gcd(a.at(i), res);
    }
    return res;
}

//2値の最小公倍数
int lcm(int a, int b) {
    return a / gcd(a, b) * b;
}

//n個の最小公倍数
int nlcm(vector<int> numbers){
    int res;
    res = numbers.at(0);
    for(int i = 0; i< numbers.size();i++){
        res = lcm(res, numbers[i]);
    }
    return res;
}

//素数判定O(√N)
bool isPrime(int x){
    if(x<2) return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(int i = 3; i*i <= x; i+=2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(int n){
    int res = 0;
    while(n>0){
        res += n%10;
        n /= 10;
    }
    return res;
}

//約数全列挙
vector<int> enum_div(int n){
    vector<int> ret;
    for(int i = 1 ; i*i <= n ; ++i){
        if(n%i == 0){
            ret.push_back(i);
            if(i != 1 && i*i != n){
                ret.push_back(n/i);
            }
        }
    }
    return ret;
}

//繰り返し自乗法
long long int mod_pow(long long int x, long long int n, long long int mod){
    long long int res = 1;
    while(n > 0){
        if(n & 1) res = res*x%mod;
        x = x*x%mod;
        n >>= 1;
    }
    return res;
}

//文字列の中で何回文字が出てきたのかを数える
int stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c); //覚える
}

int main(){
    ll N, M ,K; cin >> N >> M >> K;
    vector<ll> A(1,0), B(1,0);
    ll buf;
    ll ans = 0;

    buf = 0;
    REP(i, N){
        ll a; cin >> a;
        buf += a;
        A.push_back(buf);
    }

    buf = 0;
    REP(i, M){
        ll b; cin >> b;
        buf += b;
        B.push_back(buf);
    }

    ll b_pt = M;
    REP(i, M+1){
        if(K < B.at(i)) {
            b_pt = i-1;
            break;
        }
    }

    REP(i, N+1){
        while(K < A.at(i) + B.at(b_pt) && b_pt!=0) b_pt--;
        if(K < A.at(i)) break;
        ans = max(ans, i+b_pt);
    }

    cout << ans << endl;
}

Measured memory_bytes: 7940
#include <bits/stdc++.h>
#include <numeric>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;

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

    int N; cin >> N;
    ll res = 0;
    rep(i, 0, N) {
        ll a; cin >> a;
        while ((a&1) == 0) {
            a >>= 1;
            ++res;
        }
    }

    cout << res << endl;
}

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

int main() {
    int n, d, x;
    cin >> n >> d >> x;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) {
        for (int j = 0; ; ++j) {
            if (j * a[i] + 1 <= d) x++;
            else break;
        }
    }
    cout << x << endl;
}


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

using namespace std;

const int maxn=1e5+5;
typedef long long ll;

int vis[maxn];
int num[maxn];
int main(){
	int n,m,ans1=0,ans2=0;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int x;char s[10];
		scanf("%d%s",&x,s);
		if(strcmp(s,"AC")==0){
			if(!vis[x]){
				vis[x]=1;
				ans1++;
				ans2+=num[x];
			} 
		}	
		else{
			if(!vis[x]){
				num[x]++;
			}
		}
	}
	printf("%d %d",ans1,ans2);
	return 0;
} 

Measured memory_bytes: 1024
n = int(input())
an = list(map(int, input().split()))
if n == 2:
  print(' '.join( map(str, [max(an), min(an)]) ))
  exit()

maxi = max(an)
v = maxi
for a in an:
  if a == maxi:
    continue
  if abs(a-maxi/2) < abs(v-maxi/2):
    v = a
print(' '.join( map(str, [maxi, v]) ))

Measured memory_bytes: 14052
#include<iostream>

using namespace std;
bool search(int A[],int n,int key){
	int i=0;
	A[n]=key;
	while( A[i]!=key) i++;
	return i<n;
}
int  BinarySearch(int A[],int n,int key){
	int left=0;
	int right=n;
	int mid;
	while(left<right){
		mid=(left+right)/2;
		if(A[mid]==key)return 1;
		if(A[mid]>key) right=mid;
		else left=mid+1;
	}
	return 0;
}
int main(){
	int n,m;
	cin>>n;
	int* S=new int[n+1];
	for(int i=0;i<n;++i)cin>>S[i];
	cin>>m;
	int *T=new int[m];
	for(int i=0;i<m;++i)cin>>T[i];
	int sum=0;
    for(int j=0;j<m;++j)
	  if(BinarySearch(S,n,T[j]))sum++;
    cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3656
#include <stdio.h>

main()
{
	char x;
	
	scanf("%c",&x);
	
	if(x=='a'||x=='b'||x=='c'||x=='d'||x=='e'||x=='f'||x=='g'||x=='h'||x=='i'||x=='j'||x=='k'||x=='l'||x=='m'||x=='n'||x=='o'||x=='p'||x=='q'||x=='r'||x=='s'||x=='t'||x=='u'||x=='v'||x=='w'||x=='x'||x=='y'||x=='z')
	{
		printf("a");
	}
	else
	{
		printf("A");
	}
}

Measured memory_bytes: 1596
#include<set>
#include<map>
#include <unordered_map>
#include <unordered_set>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>
#include<math.h>
#include <strings.h>
#include <fstream>


#define f first
#define s second
#define pb push_back
#define lp(i,a,n) for(int (i)=(a);(i)<=(int)(n);(i)++)
#define lpd(i,n,a) for(int (i)=(n);(i)>=(a);--(i))
#define mp make_pair
#define clr(a, b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define mod 1000000007
#define eps 1e-8
#define infi 2000000007
#define infll 2e18
#define sz(a) (int) (a).size()

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double,double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef set<int> si;
typedef map<int, int> mii;
typedef map<ll, ll> mll;


int main(){
    string s;
    cin>>s;
    int val = 0;
    for(char c : s){
        val += (c == '+');
        val -= (c == '-');
    }
    cout<<val;
 
}




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

using namespace std;
typedef long long ll;

const ll INF =  1e+12;

struct edge {ll to, cap, rev;};

vector<edge> G[202];
bool used[202];

void add_edge(ll from, ll to, ll cap){
    G[from].push_back((edge{to, cap, (ll)G[to].size()}));
    G[to].push_back((edge{from, 0, (ll)G[from].size()-1}));
}

ll dfs(ll v, ll t, ll f, vector<edge> G[]){
    if(v == t) return f;
    used[v] = true;
    for(ll i = 0; i < G[v].size(); i++){
        edge &e = G[v][i];
        if(!used[e.to] && e.cap > 0){
            ll d = dfs(e.to, t, min(f, e.cap), G);
            if(d > 0){
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

ll N, a[100];

int main(){
    cin >> N;
    for(int i = 0; i < N; i++) cin >> a[i];
    ll flow = 0;
    for(int i = 1; i < N; i++) {
        if(a[i] >= 0){
            add_edge(0, i, a[i]);
        }
        else {
            add_edge(i, N, -a[i]);
        }
    }
    for(int i = 1; i < N; i++) {
        for(int j = i+1; j < N; j++) {
            if((j+1)%(i+1) == 0) add_edge(j, i, INF);
        }
    }
    int s = 0, t = N;
    ll ans = a[0];
    for(int i = 1; i < N; i++) {
        if(a[i] >= 0) ans += a[i];
    }
    while(true){
        memset(used, 0, sizeof(used));
        ll f = dfs(s, t, INF, G);
        if(f == 0){
            break;
        }
        flow += f;
    }
    if(flow >= INF){
        cout << -1 << endl;
    }else{
        cout << max((ll)0, -flow+ans) << endl;
    }
}

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

int main(void) {
    unsigned int k;
    std::string s;

    std::cin >> k >> s;

    if(s.length() <= k) {
        std::cout << s << std::endl;
    } else {
        std::cout << s.substr(0, k) << "..." << std::endl;
    }
    return 0;
}


Measured memory_bytes: 3608
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
#include<vector>
using namespace std;

int main(void){
	int a, b;
	cin >> a >> b;
	cout << max(a + b, max(a - b, a*b));
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <string>
#define MAXN 1000001
#define a first
#define b second

char buf[MAXN];
std::pair<int, int> s[MAXN];

int main() {
  using namespace std;

  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", buf);
    s[i].a = s[i].b = 0;
    for (int j = 0; buf[j]; ++j) {
      if (buf[j] == '(')
        ++s[i].a;
      else {
        if (s[i].a)
          --s[i].a;
        else
          ++s[i].b;
      }
    }
  }

  auto cmp = [](const pair<int, int> &l, const pair<int, int> &r) {
    if (l.a <= l.b && r.a > r.b)
      return true;
    else if (l.a > l.b && r.a <= r.b)
      return false;
    else if (l.a > l.b && r.a > r.b)
      return l.b > r.b;
    else
      return l.a < r.a;
  };

  std::sort(s, s + n, cmp);

  int t = 0;
  for (int i = 0; i < n; i++) {
    if (t < s[i].a) {
      printf("No\n");
      return 0;
    }
    t += s[i].b - s[i].a;
  }
  if (t)
    printf("No\n");
  else
    printf("Yes\n");

  return 0;
}


Measured memory_bytes: 9424
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N;
  cin >> N;
  vector<int> v;
  rep(i,N){
    int a;
    cin >> a;
    v.push_back(a);
  }

  vector<vector<int>> w;
  vector<int> tmp;
  rep(i,N){
    if(tmp.size() == 0 || (tmp.size()>0 && tmp[tmp.size()-1]>=v[i])){
      tmp.push_back(v[i]);
    }else{
      if(tmp.size() > 0) w.push_back(tmp);
      tmp.clear();
      tmp.push_back(v[i]);
    }
  }
  if(tmp.size() > 0) w.push_back(tmp);

  int ret = 0;
  rep(i,w.size()){
    ret = max(ret, (int)w[i].size()-1);
  }
  cout << ret << endl;
  
  return 0;
}



Measured memory_bytes: 6124
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

int main() {
	long long int n;
	cin >> n;
	vector<long long int> a(n);
	vector<long long int> b(n);
	for (long long int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = a[i] * 2;
	}
	vector<long long int> c = a;
	sort(a.begin(), a.end());
	sort(c.begin(), c.end());
	for (long long int i = 1; i < n; i++) {
		c[i] += c[i-1];
		//cout << c[i] << endl;
	}
	long long int ans = 1;
	for (long long int i = n-2; i >= 0; i--) {
		if (c[i]*2 >= a[i+1]) {
			ans++;
			//cout << i << endl;
		} else {
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  string a, b, c;
  cin >> a >> b >> c;
  string ans;
  ans.push_back(toupper(a.front()));
  ans.push_back(toupper(b.front()));
  ans.push_back(toupper(c.front()));
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

bool fn_is_prime(ll n) {
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

bool isOK(int index, int key, vector<ll>& a) {
    if (a[index] >= key) return true;
    else return false;
}

int binary_search(int key, vector<ll>& a) {
    int ng = -1;
    int ok = a.size();

    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;

        if (isOK(mid, key, a)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main()
{
    string s1, s2, s3; cin >> s1 >> s2 >> s3;
    cout << s1[0] << s2[1] << s3[2] << endl;
}


Measured memory_bytes: 3548
#include <iostream>

using namespace std;

int main() {
    int n;  cin >> n;
    long long *a = new long long[n], *b = new long long[n];

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

    if (n % 2) {
        for (int i = 0; i < (n+1)/2; i++)
            b[i] = a[n-1-2*i];
        for (int i = 0; i < n/2; i++) 
            b[(n+1)/2 + i] = a[1 + 2*i];
    }
    else {
        for (int i = 0; i < n/2; i++) 
            b[i] = a[n-1-2*i];
        for (int i = 0; i < n/2; i++)
            b[n/2 + i] = a[2*i];
    }

    for (int i = 0; i < n; i++)
        cout << b[i] << " ";
    cout << endl;
    return 0;
}

Measured memory_bytes: 5248
#include<stdio.h>

int main() {
  int MAX_V = 1000000;
  int prime[MAX_V+1];
  int i, k, v;
  for(i = 2; i <= MAX_V; i++) {
      prime[i] = 1;
    }
      for(i = 2; i*i <= MAX_V; i++) {
        if(prime[i]) {
          for(k = 2 * i; k <= MAX_V; k += i) {
            prime[k] = 0;
          }
        }
      }

  while(scanf("%d", &v) != 0){
    for(int i = v;i > 0;i--){
      if(prime[i] == 1&&prime[i-2] == 1){
          printf("%d %d\n",i-2,i);
          break;
        }
      }
    if(v == 0) break;
  }
  return 0;
}

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

#define REP(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define REPS(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define RREP(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define RREPS(i, n) for (int i = ((int)(n)); i > 0; i--)
#define IREP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define IREPS(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVISORT(v) sort(v.begin(), v.end(), greater<int>());
#define ALL(v) v.begin(), v.end()

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using ll = long long;
using ul = unsigned long;

typedef long long ll;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const int mod=1e9+7;

struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  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 {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};

mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}

int main()
{
    cin.tie( 0 );
    ios::sync_with_stdio( false );
	
	init();
	int n,k;
	cin>>n>>k;
	
	REPS(i,k){
		if(n-k+1-i < 0){
			cout << 0 << endl;
			continue;
		}
		mint ans=comb(n-k+1,i)*comb(k-1,i-1); // 両端を含む赤のグループ分割 * 両端を含まない青の分割
		cout << ans.x << endl;
	}

    return 0;
}

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

int main () {
  int N;
  cin >> N;
  
  vector<int> P(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> P.at(i);
  }
  
  int count = 0;
  int min = P.at(0);
  for (int i = 0; i < N; i++) {
    if (P.at(i) <= min) {
      count++;
      min = P.at(i);
    }
  }
  
  cout << count;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		System.out.println(c(c(a + b, a - b), a * b));
	}
	
	static int c(int a, int b) {
		if(a > b) return a;
		return b;
	}
}


Measured memory_bytes: 22740
# import sys
import numpy as np
# sys.setrecursionlimit(200000)

a, b, x = list(map(int, input().split(" ")))

if b / 2 < (x / (a ** 2)):
    height = b - (x / (a ** 2))
    width = a / 2
    print(np.arctan(height / width) / (2 * np.pi) * 360)
else:
    height = b
    width = (2 * x) / (b * a)
    print(np.arctan(height / width) / (2 * np.pi) * 360)


Measured memory_bytes: 12488
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[5],ans;
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    ans=0+abs(a[0]-a[1])+abs(a[1]-a[2]);
    cout<<ans;
    return 0;

}


Measured memory_bytes: 256
#include <iostream>

int main(){
	int a,c=0,t=0;
	int b[101],f[101],z[101],x[101];
	z[0]=0;
	
	while(std::cin>>a){
         c++;
	    b[c]=a;
	}
	for(int g=1;g<=100;g++){
		f[g]=0;
		z[g]=0;
	}

	for(int d=1;d<=c;d++){
			f[b[d]]++;
			}
	
	for(int g=1;g<=100;g++){
		
			if(f[g]>z[0]){
			
			z[0]=f[g];
			x[0]=g;
				t=0;
			}else if(f[g]==z[0]){
				t++;
			
				x[t]=g;
		}
	}
	
	for(int p=0;p<=t;p++){
		std::cout<<x[p]<<std::endl;
	}
	return 0;
		}
	
	

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

using namespace std;
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define rep(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define frep(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define fwr(x) { cout << x << '\n'; }

typedef complex<ld> cplex;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int inf = 1e9 + 7;
const ll linf = 1ll * inf * inf;
const int N = 1000000 + 1;
const int M = 5000;
const int multipleTest = 0;
const double pi = acos(-1);

vii adj[N];
vector<ll> L, D;
vector<int> L_cnt, D_cnt;
int n, m;
int S, T;


void dijkstra(int root, vector<ll>& dist, vector<int>& cnt) {
    dist.resize(n + 1); cnt.resize(n + 1);
    for (int i = 0; i <= n; ++i) {
        dist[i] = linf;
        cnt[i] = 0;
    }
    dist[root] = 0;
    cnt[root] = 1;
    
    priority_queue<pair<ll, int>> heap;
    heap.push(make_pair(0, root));
    
    while (!heap.empty()) {
        int u = heap.top().second;
        ll cur = -heap.top().first;
        heap.pop();
        if (dist[u] != cur) continue;

        for (ii x : adj[u]) {
            int v = x.first;
            int cost = x.second;
            if (dist[v] > dist[u] + cost) {
                dist[v] = dist[u] + cost;
                cnt[v] = cnt[u];
                heap.push(make_pair(-dist[v], v));
            } else {
                if (dist[v] == dist[u] + cost) {
                    cnt[v] += cnt[u];
                    if (cnt[v] >= inf) cnt[v] -= inf;
                }
            }
        }
    }
}

void solve() {
    cin >> n >> m;
    cin >> S >> T;
    rep(i, 0, m) {
        int u, v, c;
        scanf("%d%d%d", &u, &v, &c);
        adj[u].push_back(make_pair(v, c));
        adj[v].push_back(make_pair(u, c));
    }
    
    dijkstra(S, L, L_cnt);
    dijkstra(T, D, D_cnt);
    
    ll res = L_cnt[T];
    res = res * res;
    res %= inf;
    
    ll maxLength = L[T];
    
    for (int i = 1; i <= n; ++i) {
        if (L[i] + D[i] == maxLength && L[i] == D[i]) {
            ll tmp = (ll)L_cnt[i] * D_cnt[i] % inf;
            res = (res - tmp * tmp) % inf;
            if (res < 0) res += inf;
        }
        for (ii x : adj[i]) {
            int j = x.first;
            int c = x.second;
            
            if (L[i] + c + D[j] == maxLength && L[i] * 2 < maxLength && D[j] * 2 < maxLength) {
                ll tmp = (ll)L_cnt[i] * D_cnt[j] % inf;
                res = (res - tmp * tmp) % inf;
                if (res < 0) res += inf;
            }
        }
    }
    
    
    cout << res;
}

int main() {
#ifdef _LOCAL_
    freopen("inp.txt", "r", stdin);
    //    freopen("out.txt", "w", stdout);
#endif
    
    int Test = 1;
    if (multipleTest)
        cin >> Test;
    
    for(int i = 0; i < Test; ++i) {
        //        printf("Case #%d: ", i + 1);
        solve();
    }
#ifdef _LOCAL_
    cout<< "\n" << 1.0 * clock() / CLOCKS_PER_SEC << "\n";
#endif
}


Measured memory_bytes: 35412
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<vector>
#include<set>
#define N 100000
#define IOS ios::sync_with_stdio(false)
#define INF 1e9
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long ll;
using namespace std;
int abs(int x)
{return x>0?x:-x;}
int sqr(int x)
{return x*x;}
//coding......
ll a[100];
int main()
{
    IOS;
    int a,b,c,d;
   char x,y,m,n;
   cin>>x>>y>>m>>n;
   a=(x-'0');
   b=(y-'0');
   c=(m-'0');
   d=(n-'0');
   if (a+b+c+d==7)
      cout << a<< "+" << b << "+" << c << "+" << d << "=7" <<endl;
   else if (a+b+c-d==7)
      cout << a<< "+" << b << "+" << c << "-" << d  <<"=7" << endl;
    else if (a+b-c+d==7)
      cout << a<< "+" << b << "-" << c << "+" << d <<  "=7" << endl;
    else if (a-b+c+d==7)
      cout << a<< "-" << b << "+" << c << "+" << d <<  "=7" <<endl;
    else if (a+b-c-d==7)
      cout << a<< "+" << b << "-" << c << "-" << d << "=7" << endl;
    else if (a-b+c-d==7)
      cout << a<< "-" << b << "+" << c << "-" << d <<  "=7" <<endl;
    else if (a-b-c+d==7)
      cout << a<< "-" << b << "-" << c << "+" << d <<  "=7" <<endl;
    else if (a-b-c-d==7)
      cout << a<< "-" << b << "-" << c << "-" << d <<  "=7" <<endl;
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
  	int a,b;
  	
  	scanf("%d%d",&a,&b);
  	
  	if(b%a==0){
      printf("%d",a+b);
    }else{
      printf("%d",b-a);
    }
return 0;
}
  	

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

int main() {
  std::string S;
  size_t w;

  std::cin >> S;
  std::cin >> w;

  size_t cnt = 0;
  for (char const c : S) {
    if (cnt == 0) std::cout << c;
    cnt++;
    if (cnt == w) cnt = 0;
  }

  std::cout << std::endl;

  return 0;
}


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

using namespace std;
int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M; 
  cout << fixed << setprecision(16);
  
  long double pi = 3.1415926535897932384626433832795;
  
  //radianへの変換
  long double h = H/12.0+(M/60.0)/12.0;
  long double m = M/60.0;
  long double x = 2.0*pi*(h-m);

  //余弦定理で出す
  long double d = (double) (A*A + B*B) -2.0*A*B*cos(x);
  cout << sqrt(d) << endl;
  
}

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

int main() {

  int a, b, c;
  cin >> a >> b >> c;

  int answer = 0;

  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      answer++;
    }
  }

  cout << answer << endl;

  return 0;

}


Measured memory_bytes: 3112
#include <stdio.h>
#include <algorithm>
using namespace std;
int X, Y;
int n, m, u, v, w, in[2001][2001], cnt[2001];
int main()
{
	scanf("%d%d%d", &n, &X, &Y); X--, Y--;
	for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) if (i - j)in[i][j] = 1e9;
	for (int i = 0; i < n - 1; i++) in[i][i + 1] = in[i + 1][i] = 1;
	for (int i = 0; i < n-1; i++) for (int j = i+1; j < n; j++) in[i][j] = in[j][i] = j - i;
	for (int i = 0; i <= X; i++)for (int j = Y; j < n; j++) {
		in[i][j]-=Y-X-1;
	}
	in[X][Y] = in[Y][X] = 1;
	for (int i = 0; i <= X; i++)for (int j = X + 1; j < Y; j++) {
		in[i][j] = min(in[i][j], in[i][X] + in[X][Y] + in[j][Y]);
	}
	for (int i = X + 1; i < Y; i++)for (int j = Y; j < n; j++) {
		in[i][j] = min(in[i][j], in[X][i] + in[X][Y] + in[Y][j]);
	}

	for (int i = X + 1; i < Y; i++)for (int j = X + 1; j < Y; j++) {
		in[i][j] = min(in[i][j], in[X][i] + in[X][Y] + in[Y][j]);
	}


	for (int i = 0; i < n - 1; i++) for (int j = i + 1; j < n; j++)
		cnt[in[i][j]]++;
	for (int k = 0; k < n - 1; k++)
		printf("%d\n", cnt[k + 1]);
	return 0;
}

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

    public static void main(String[] args)
    {
        Scanner read = new Scanner(System.in);
        String s1 =read.next() , s2=read.next();
        int count=0;
        for (int i=0 ; i<s1.length() ; i++)
        {
            if (s1.charAt(i) == s2.charAt(i))
            {
                continue;
            }
            else {
                 count++;
             }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 41312
#include <iostream>
using namespace std;
const long long orzhjw=666;
int main(){
	long long a,b,x,orzwzc,zc,lyf;
	cin>>a>>b>>x;
	if(a==0){
		zc=b/x;
		lyf=a/x;
	    orzwzc=zc-lyf+1;	
	
	}
	
	else{
		zc=a-1;
	    orzwzc=b/x-zc/x;
		
	} 
	cout<<orzwzc<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  int n;
  cin >> n;
  map<string, int> mp;
  rep(i, n) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << mp.size() << endl;
  return 0;
}


Measured memory_bytes: 19124
#include <iostream>

using namespace std;

int n,c=0;
int D[200];

int main()
{
    cin >> n;
    for(int i=0;i<n*2;i++) {
        cin >> D[i];

        if((i % 2 == 1) && c != 3) {
            if(D[i] == D[i-1]) c++;
            else c = 0;
        }
    }

    if(c >= 3) cout << " Yes ";
    else cout << " No ";

    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    long long int a,b;
    long long int op=0;
    while((cin>>a>>b)){
        long long int res=a+b;
        long long int k=1;
        while((res/k)!=0){
            k=k*10;
            op++;
        }
        if(res==0)
        {
            op=1;
        }
        cout<<op<<endl;
        op=0;
    }
    return 0;
}


Measured memory_bytes: 3060
package main

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

func nInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	/*
		if e != nil {
			panic(e)
		}
		// */
	return i
}

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

var r []int

func main() {
	var sc = bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := nInt(sc)
	q := nInt(sc)
	r = make([]int, n)
	e := make([]map[int]struct{}, n)

	for i := 0; i < n-1; i++ {
		e[i] = map[int]struct{}{}
	}
	e[n-1] = map[int]struct{}{}
	for i := 0; i < n-1; i++ {
		a := nInt(sc)
		b := nInt(sc)
		e[a-1][b-1] = struct{}{}
	}

	for i := 0; i < q; i++ {
		t := nInt(sc)
		u := nInt(sc)
		r[t-1] += u
	}
	for ui := 0; ui < n; ui++ {
		for k := range e[ui] {
			r[k] += r[ui]
		}
		// fmt.Println(ui, r, e[ui])
	}
	for i := 0; i < n-1; i++ {
		fmt.Printf("%d ", r[i])
	}
	fmt.Println(r[n-1])
	// */
}


Measured memory_bytes: 47488
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <map>
using namespace std;
int main()
{
  int r, d, x;
  cin >> r >> d >> x;
  for(int i = 0; i < 10; i++){
    x = r * x - d;
    cout << x << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

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

        if (N >= M) {
            System.out.println(0);
        } else {

            int[] xArr = new int[M];
            for (int i = 0; i < M; i++) {
                xArr[i] = sc.nextInt();
            } 
            Arrays.sort(xArr);
            int[] diff = new int[M - 1];
            for (int i = 0; i < M - 1; i++) {
                diff[i] = xArr[i + 1] - xArr[i];
            }
            Arrays.sort(diff);
            int minSum = 0;
            for (int i = 0; i < M - N; i++) {
                minSum += diff[i];
            }
            System.out.println(minSum);
        }
    }
}

Measured memory_bytes: 47932
#include<bits/stdc++.h>
using namespace std;
char s[105];
int n,pos,maxn;
int main() {
	scanf("%d%s",&n,s+1);
	for(int i=1; i<=n; i++) {
		if(s[i]=='I')pos++;
		else pos--;
		maxn=max(maxn,pos);
	}
	printf("%d\n",maxn);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <utility>
#include <cstdlib>
#include <queue>
#include <iomanip>
#include <cstdio>

using namespace std;

int n;
vector<int> a,b,c;

int main(){
    cin >> n;
    a = b = c = vector<int>(n);

    for(int i=0;i<n;i++) cin >> a[i];
    for(int i=0;i<n;i++) cin >> b[i];
    for(int i=0;i<n;i++) cin >> c[i];
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    sort(c.begin(),c.end());

    long long res = 0;
    for(int i=0;i<n;i++)
    {
        long long A = lower_bound(a.begin(),a.end(),b[i]) - a.begin();
        long long B = n- (upper_bound(c.begin(),c.end(),b[i]) - c.begin());
        res += A*B;
    }

    cout << res << endl;
    return 0;
}


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

#define ll long long
#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define repr(i,n,m) for(int i=m; i<n; i++)
#define MAX 100
#define MOD 1000000007
#define pb push_back
#define debug(x) cout << x << endl;
#define END cout << endl;
#define sorti(x) sort(x.begin(), x.end())

int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i,n) {
    cin >> a[i];
  }
  ll res = 0;
  rep(i,n) {
    if (a[i] == i+1)   {
      res++;
      swap(a[i], a[i+1]);
    }
  }

  cout << res << endl;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = Integer.valueOf(sc.next());
		int b = Integer.valueOf(sc.next());
		int t = Integer.valueOf(sc.next());

		System.out.println(t / a * b);

	}

}


Measured memory_bytes: 21204
N, M, Q = map(int, input().split())
abcd = [tuple(map(int, input().split())) for _ in range(Q)]
ans = float("-inf")
def calcu(arr):
    res = 0
    for a, b, c, d in abcd:
        if arr[b-1] - arr[a-1] == c:
            res += d
    return res

def dfs(A):
    global ans
    if len(A) == N:
        ans = max(ans, calcu(A))
        return
    else:
        start = A[-1] if len(A) > 0 else 1
        for num in range(start, M+1):
            A.append(num)
            dfs(A)
            A.pop()

dfs([])
print(ans)

Measured memory_bytes: 74928
#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main(){
  int N, T, A, num;
  cin >> N;
  cin >> T >> A;
  int H[N];
  double h[N];
  for(int i=0; i<N; i++){
    cin >> H[i];
    h[i] = T - H[i]*0.006;
    if(i==0) num = i;
    else{
      if(fabs(h[i] - A )< fabs(h[num] - A)) num = i;
    }
  }
  cout << num+1 << "\n";
  return 0;
}


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

using namespace std;

int main()
{
  string number = "0123456789";
  int n;
  cin >> n;
  while(n--){
    string order, message;
    cin >> order >> message;
    for(int i = order.size()-1; i >= 0; i--){
      if(order[i] == 'M'){
	for(int j = 0; j < message.size(); j++){
	  if('0' <= message[j] && message[j] <= '9'){
	    int idx = number.find(message[j]);
	    message[j] = number[(idx+1)%number.size()];
	  }
	}
      } else if(order[i] == 'P'){
    	for(int j = 0; j < message.size(); j++){
	  if('0' <= message[j] && message[j] <= '9'){
	    int idx = number.find(message[j]);
	    message[j] = number[(idx-1+number.size())%number.size()];
	  }
	}	
      } else if(order[i] == 'A'){
	reverse(message.begin(), message.end());
      } else if(order[i] == 'E'){
	for(int i = 0; i < message.size() / 2; i++){
	  swap(message[i], message[i + (message.size()+1) / 2]);
	}
      } else if(order[i] == 'C'){
	message = message.substr(1, message.size()-1) + message[0];
      } else if(order[i] == 'J'){
	message = message[message.size()-1] + message.substr(0, message.size()-1);
      }
    }
    cout << message << endl;
  }
  return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, K;
  cin >> A >> B >> K;
  for (int i = 0; i < K; i++) { // 合計K回の操作を行う
    if (i % 2 == 0) { // 奇数回目の操作（iは偶数であることに注意）
      if (A % 2 == 1) { // 高橋君のクッキーが奇数枚の場合
        A--; // 高橋君はクッキーを1枚食べる
      }
      B += A / 2; // 青木君は高橋君からクッキーを半分もらう
      A /= 2; // 高橋君はクッキーを半分あげる
    }
    else { // 偶数回目の操作（iは奇数であることに注意）
      if ( B % 2 == 1) {
        B--;
      }
      A += B / 2;
      B /= 2;
    }
  }
  cout << A << endl;
  cout << B << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <list>
#include<map>
#include<set>
using namespace std;

string s;
int dp[100000];

int cnt(int k) {
    if (k < 1) return dp[k] = 0;
    if (dp[k] != -1) return dp[k];
    if (s[k] == 'C' && s[k - 1] == 'A') return dp[k] = cnt(k - 1) + 1;
    else return dp[k]=cnt(k - 1);
}

int main() {
    int n, q, l, r;
    cin >> n >> q >> s;
    for (int i = 0;i < n; i++) {
        dp[i] = -1;
    }
    for (int i = 0; i < q; i++) {
        cin >> l >> r;
        cout << cnt(r-1)- cnt(l-1) << endl;
    }
}

Measured memory_bytes: 4608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
const ll mo=1000000007;
ll ans=0;
ll dp[0][0];

int main()
{
ll n;
cin >> n;
int table[n]={};
rep(i,n) {
    cin >> table[i];
}
ll max=table[0];
rep(i,n-1){
    if(max<=table[i+1]){
        ans++;
        max=table[i+1];
    }
}

ans+=1;
cout << ans << endl;
return 0;
}





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

int main(int argc, char *argv[])
{
  long long int n, tmp, max = -2147483648, min = 2147483647, sum = 0;
  cin >> n;

  for(int i = 0; i < n; i++) {
    cin >> tmp;
    max = std::max(max, tmp);
    min = std::min(min, tmp);
    sum += tmp;
  }

  cout << min << " " << max << " " << sum << endl;
  return 0;
}



Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int oo = 1e9;
const int MOD = 1000000007;
const int BASE = 26;
const int N = 200011;

#define pb push_back
#define mp make_pair

int f[110][110], d[11][11], A, B, cnt = 1, S, T, fx[110], fy[110];
vector< pair<int, pii> > E;
void addEdge(int u , int v , int w) {
	E.pb(mp(w, mp(u, v)));
}
int main() {
	cin >> A >> B;
	for (int i = 1; i <= A; ++i) {
		for (int j = 1; j <= B ; ++j) {
			scanf("%d", &d[i][j]);
		}
	}
	for (int x = 0 ; x <= 100 ; x++) {
		for (int y = 0 ; y <= 100 ; y++) {
			f[x][y] = -oo;
			for (int i = 1; i <= A; ++i) {
				for (int j = 1; j <= B ; ++j) {
					f[x][y] = max(f[x][y], d[i][j] - i * x - j * y);
				}
			}
		}
	}
	for (int i = 1; i <= A; ++i) {
		for (int j = 1; j <= B ; ++j) {
			int mn = 1e9;
			for (int x = 0 ; x <= 100 ; x++) {
				for (int y = 0 ; y <= 100 ; y++) {
					if (f[x][y] < 0)continue;
					mn = min(mn, f[x][y] + x * i + y * j);
				}
			}
			if (mn != d[i][j]) {
				puts("Impossible");
				return 0;
			}
		}
	}

	for (int i = 0 ; i <= 100 ; ++i) {
		fx[i] = cnt++;
		if (i > 0)
			addEdge(fx[i - 1], fx[i], -1);	
	}
	for (int i = 0 ; i <= 100 ; ++i) {
		fy[i] = cnt++;
		if (i > 0)
			addEdge(fy[i - 1], fy[i], -2);
	}			
	for (int x = 0 ; x <= 100 ; x++) {
		for (int y = 0 ; y <= 100 ; y++) {
			if (f[x][y] < 0)continue;
			addEdge(fx[x],fy[100-y],f[x][y]);
		}
	}
	puts("Possible");
	printf("%d %d\n", cnt - 1, (int)E.size() );
	for (int i = 0; i < E.size(); ++i){
		if(E[i].first == -1){
			printf("%d %d %c\n",E[i].second.first,E[i].second.second,'X');
		}else if(E[i].first == -2){
			printf("%d %d %c\n",E[i].second.first,E[i].second.second,'Y');
		}else{
			printf("%d %d %d\n",E[i].second.first,E[i].second.second,E[i].first );
		}
	}
	printf("%d %d\n",fx[0],fy[100]);
	return 0;
}


Measured memory_bytes: 512
import java.util.*;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();

        for(int i = 0; i < k; i++){
            if(a < b){
                if(b < c){
                    System.out.println("Yes");
                    return;
                }else{
                    c *= 2;
                }
            }else{
                b *= 2;
            }
            if(a < b && b < c){
                System.out.println("Yes");
                return;
            }
        }
        System.out.println("No");

    }
}


Measured memory_bytes: 35844
fun main(args: Array<String>) {
    val num = next().toInt()
    val set: MutableSet<String> = mutableSetOf()
    for (i in 1..num){
        set.add(next())
    }
    println(set.size)

}
fun nextIntList() = next().split(" ").map{ it.toInt() }
fun next() = readLine()!!

Measured memory_bytes: 79244
A=[[0 for j in range(3)]for i in range(9)]
for i in range(9):
  id, a, b=map(str,input().split())
  s =int(a)+int(b)
  p =int(a)*200+int(b)*300
  A[i][0]=id
  A[i][1]=s
  A[i][2]=p

for i in range(9):
  print(A[i][0],A[i][1], A[i][2])


Measured memory_bytes: 5604
import Control.Monad
import Control.Applicative
import Data.List


-- String, Int, Char,Bool, True, False

-- e.g.
-- 1
-- [a] <- map read . words <$> getline => [1] -> a == 1
-- 1
-- a <- readlLn
-- 1 2 3
-- lst <- map read . words <$> getLine => [1, 2, 3]
-- 1 2 3
-- [l, m, n] <- map read . words <$. getLine :: IO [Int] => [1, 2, 3]
-- 'a'
-- c <- getChar => c == 'a'

main :: IO()
main = do
  s <- getLine
  print $ solve s

segments :: [a] -> [[a]]
segments = foldr (++) [] . scanr (\a b -> [a] : map (a:) b) []

mdelete :: String -> Bool
mdelete s = [] == filter (\x -> (x /= 'A') && (x /= 'C') && (x /= 'G') && (x /= 'T')) s

solve :: String -> Int
solve s = foldl f 0 [str | str <- segments s, mdelete str]
  where
    f :: Int -> String -> Int
    f l t = if l > length t
      then l
      else length t


Measured memory_bytes: 508
N, K = list(map(int, input().split()))
s = input()

for i in range(N):
    if i == K-1:
        if s[i] == 'A':
            print('a', end='')
        elif s[i] == 'B':
            print('b', end='')
        else:
            print('c', end='')
    else:
        print(s[i], end='')

Measured memory_bytes: 3064
a, b, c, d = map(int,input())

if a-b-c-d == 7: print('{}-{}-{}-{}=7'.format(a,b,c,d))
elif a-b-c+d == 7: print('{}-{}-{}+{}=7'.format(a,b,c,d))
elif a-b+c-d == 7: print('{}-{}+{}-{}=7'.format(a,b,c,d))
elif a-b+c+d == 7: print('{}-{}+{}+{}=7'.format(a,b,c,d))
elif a+b-c-d == 7: print('{}+{}-{}-{}=7'.format(a,b,c,d))
elif a+b-c+d == 7: print('{}+{}-{}+{}=7'.format(a,b,c,d))
elif a+b+c-d == 7: print('{}+{}+{}-{}=7'.format(a,b,c,d))
else: print('{}+{}+{}+{}=7'.format(a,b,c,d))

Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>

char A[1024];
char B[1024];

size_t Alen, Blen;

int main(void) {
	size_t i, j;
	if (scanf("%1023s", A) != 1) return 1;
	if (scanf("%1023s", B) != 1) return 1;
	Alen = strlen(A);
	Blen = strlen(B);
	for (i = 0; i <= Alen - Blen; i++) {
		int ok = 1;
		for (j = 0; j < Blen; j++) {
			if (B[j] != '_' && A[i + j] != B[j]) {
				ok = 0;
				break;
			}
		}
		if (ok) {
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}



Measured memory_bytes: 2144
# -*- coding: utf-8 -*-

import math

a, b, C = map(float, input().split())
c = math.sqrt((a * a) + (b * b) - 2 * a * b * math.cos(math.radians(C)))
s = (a * b * math.sin(math.radians(C))) / 2
l = a + b + c
h = (2 * s) / a
print(s)
print(l)
print(h)


Measured memory_bytes: 5692
import numpy as np
import sys
buf = sys.stdin.buffer
N = int(buf.readline())
S = np.frombuffer(buf.read(N), dtype='S1')
is_E = (S == b'E')
is_W = ~is_E

left_E = is_E.cumsum() - is_E
left_W = np.arange(N) - left_E
right_E = is_E.sum() - left_E - is_E
right_W = is_W.sum() - left_W - is_W

answer = (left_W + right_E).min()
print(answer)

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

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

const int INF=1e9;
const int MOD=1e9+7;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

struct Edge{
	int src,dst;
	double weight;
	Edge(){}
	Edge(int s,int d,double w):src(s),dst(d),weight(w){}
};
typedef vector<vector<Edge>> Graph;
bool operator<(const Edge& a,const Edge& b){return a.weight<b.weight;}
bool operator>(const Edge& a,const Edge& b){return a.weight>b.weight;}

void Dijkstra(const Graph& g,int v,vd& dist,vi& prev)
{
	priority_queue<Edge,vector<Edge>,greater<Edge>> pq;
	pq.emplace(-1,v,0);
	while(pq.size()){
		Edge cur=pq.top(); pq.pop();
		if(dist[cur.dst]!=INF) continue;
		dist[cur.dst]=cur.weight;
		prev[cur.dst]=cur.src;
		for(Edge e:g[cur.dst])
			pq.emplace(e.src,e.dst,cur.weight+e.weight);
	}
}
void BuildPath(const vi& prev,int v,vi& path)
{
	for(int u=v;u!=-1;u=prev[u])
		path.push_back(u);
	reverse(all(path));
}

int main()
{
	for(int n;cin>>n && n;){
		vi bs(n),xs(n),ys(n);
		rep(i,n) cin>>bs[i]>>xs[i]>>ys[i];
		
		map<int,int> f;
		rep(i,n) f[bs[i]]=i;
		
		Graph g(n);
		rep(i,n) rep(j,n){
			int dx=xs[j]-xs[i],dy=ys[j]-ys[i];
			if(dx*dx+dy*dy<=50*50){
				double d=sqrt(dx*dx+dy*dy);
				g[i].emplace_back(i,j,d);
			}
		}
		
		vvd dists(n,vd(n,INF));
		vvi prevs(n,vi(n,-1));
		rep(i,n) Dijkstra(g,i,dists[i],prevs[i]);
		
		int m; cin>>m;
		rep(i,m){
			int u,v; cin>>u>>v; u=f[u],v=f[v];
			if(dists[u][v]==INF){
				cout<<"NA"<<endl;
				continue;
			}
			vi path; BuildPath(prevs[u],v,path);
			rep(i,path.size())
				cout<<(i?" ":"")<<bs[path[i]];
			cout<<endl;
		}
	}
}

Measured memory_bytes: 1368
#include <iostream>
#include <iomanip>
using namespace std;
#define ll long long

int main() {
    ll n;
    double r;
    cin >> n;
    if(n%2) r = double(n/2 + 1)/double(n);
    else r = (double(n)/2.0)/double(n);
    cout << fixed; cout.precision(14);
    cout << r << endl;
    return 0;
}

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

int main()
{
	int N;
    std::cin >> N;
  
    std::vector<int> v(N+1,0);
      
  	for(int i=0; i<N-1; i++)
    {
      	int A; 
		std::cin >> A;
        v[A] += 1;
    }

  	for(int i=1; i<=N; i++)
    {
  		std::cout << v[i] << std::endl;
    }
	return 0; 
}


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

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            int[] arr = cin.ReadIntArray(3);
            if (arr[0] == arr[1]&&arr[1] == arr[2])
            {
                Console.WriteLine("No");
            }else if (arr[0] != arr[1] && arr[1] != arr[2] && arr[0] != arr[2])
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }
            
            
        }


    }
            


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


Measured memory_bytes: 13268