akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
 #include <math.h>

 #define PI 3.14159265358979323846264338327950L

 int main(void) {
 int a, b, h, m;
 scanf("%d%d%d%d", &a, &b, &h, &m);

long double rad = PI * 2 * (
(long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long
double)m / 60.0);

long double rsq = (long double)(a * a + b * b) - (long double)(2 * a *
b) * cosl(rad);
printf("%20.20Lf\n", sqrtl(rsq));
return 0;
}

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

int main(){
   int a,b,c,x,y;
   int ans=0;
   cin >> a >> b >> c >> x >> y;
   ans = a*x+b*y;
   for (int i=0;i < max(x,y);i++){
      int tmp = a*(x-i-1)+b*(y-i-1)+2*c*(i+1);
      if (x-i-1 < 0 ){
         tmp = b*(y-i-1)+2*c*(i+1);
      }
      else if (y-i-1 < 0){
         tmp = a*(x-i-1)+2*c*(i+1);
      }
      ans=min(ans,tmp);
   }
   cout << ans << endl;
   
   
   
   return 0;
}

Measured memory_bytes: 256
a, b = map(int, input().split())
l = list(map(int, input().split()[:a]))
res = 1
d = 0
res= [0]
for item in l:
    res.append(d + item)
    d += item
filtered_res = list(filter(lambda x: x <= b, res))
print(len(filtered_res))

Measured memory_bytes: 3060
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define sqr(a) ((a) * (a))
using namespace std;
inline char nc() {
    static char buf[100000], *l = buf, *r = buf;
    return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++;
}
template<class T> void read(T &x) {
    x = 0; int f = 1, ch = nc();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
    while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
    x *= f;
}
typedef long long ll;
const int maxn = 250 + 5;
int n, m;
int mod;
int f[maxn << 1];
int g[maxn << 1];
int dp[maxn << 1][maxn];
struct data {
    int val;
    int id, type;
    data(int val=0,int id=0,int type=0):val(val), id(id), type(type) {}
    bool operator < (const data &other) const {
        if(val != other.val) return val < other.val;
        return id > other.id;
    }
};
vector<data> A;
inline void update(int &x, int y, int z) {
    if(z < 0) return;
    x = (x + (ll)y * z) % mod;
}
int main() {
    // freopen("F.in", "r", stdin);
    // freopen("F.out", "w", stdout);
    read(n), read(mod);
    for(int i = 0; i < (n << 1); ++i) {
        while(sqr(f[i]) + sqr(i) < sqr(n)) ++f[i];
        while(sqr(g[i]) + sqr(i) <= sqr(n << 1)) ++g[i];
        f[i] = min(f[i], n << 1);
        g[i] = min(g[i], n << 1);
        if(i < n) {
            A.push_back(data(f[i], i, 0));
        }
        else {
            A.push_back(data(g[i], -1, 1));
        }
    }
    sort(A.begin(), A.end());
    int an = 0;
    for(int k = 0, f = 1; k <= n; ++k, f = mod - f) {
        memset(dp, 0, sizeof(dp));
        dp[0][0] = 1;
        int as = 0, bs = 0;
        for(int i = 0; i < (n << 1); ++i) {
            if(A[i].type == 1) {
                for(int j = 0; j <= min(k, as); ++j) {
                    update(dp[i + 1][j], dp[i][j], A[i].val - bs - j);
                }
                ++bs;
            }
            else {
                for(int j = 0; j <= min(k, as); ++j) {
                    update(dp[i + 1][j], dp[i][j], g[A[i].id] - (n + k + as - j));
                    update(dp[i + 1][j + 1], dp[i][j], A[i].val - bs - j);
                }
                ++as;
            }
        }
        an = (an + (ll)f * dp[n << 1][k]) % mod;
    }
    printf("%d\n", an);
    return 0;
}


Measured memory_bytes: 768
#include<iostream>
#include<set>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include<algorithm>
#include <sstream>
using namespace std;
long long inf=100000000000007;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
typedef pair<int,int>  P;
string alph("abcdefghijklmnopqrstuvwxyz");
struct edge{int to,cost;};
vector<edge> G[22];
char fi[1005][1005];
P sg[10];
int d[1005][1005];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
pair<int,double> s[1005];
int c=0;
int n,k;
signed main(){
    int a,b;cin>>a>>b;
    cout<<b*2-a<<endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
using ll = long long;
 
const int nax = 10123;
char k[nax];
const int mod = 1e9 + 7;
 
void add_self(int& a, int b) {
    a += b;
    if(a >= mod) {
        a -= mod;
    }
}
 
int main() {
    scanf("%s", k);
    int D;
    scanf("%d", &D);
    int len = strlen(k);
    vector<array<int,2>> dp(D, array<int,2>{});
    // dp[sum][smaller_already] - the number of ways to choose digits so far
    // such that the sum of digits modulo D is 'sum' and 'smaller_already'
    // says whether we already chosen some digit smaller than in K
    dp[0][0] = 1;
    for(int where = 0; where < len; ++where) {
        vector<array<int,2>> new_dp(D, array<int,2>{});
        for(int sum = 0; sum < D; ++sum) {
            for(bool sm_already : {false, true}) {
                for(int digit = 0; digit < 10; ++digit) {
                    if(digit > k[where] - '0' && !sm_already) {
                        break;
                    }
                    add_self(new_dp[(sum+digit)%D][sm_already || (digit < k[where]-'0')],
                        dp[sum][sm_already]);
                }
            }
        }
        dp = new_dp;
    }
    int answer = (dp[0][false] + dp[0][true]) % mod;
    --answer;
    if(answer == -1) {
        answer = mod - 1;
    }
    printf("%d\n", answer);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a) for(int i = 0; i < a; i++)
#define all(v) v.begin(), v.end()
#define dcout cout << fixed << setprecision(15)
#define arep(i, a) for(auto i : a)
#define F first
#define S second
#define VE vector<int>
#define pb(x) push_back(x)
#define MOD 1000000007
#define INF 10000000000
#define int long long
#define KETA(n) floor(log10(n) + 1)
using namespace std;
signed main() {
    int a, b, c;
    int ans = 0;
    cin >> a >> b >> c;
    for(int i = a; i <= b; i++) {
        if(i % c == 0) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3588
from itertools import permutations
n=int(input())
p=tuple(map(int,input().split()))
q=tuple(map(int,input().split()))
a=[]
for i in range(1,n+1):
  a.append(i)
na=list(permutations(a,n))
na.sort()
print(abs(na.index(p)-na.index(q)))

Measured memory_bytes: 8052
import math
x = int(input())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
if x == 1:
  print(int(360 / x))
elif x == 45:
  print(int(360 / x))
elif x == 90:
  print(int(360 / x))
else:
  z = lcm(x, 360)
  print(int(z / x))


Measured memory_bytes: 9076
#include<bits/stdc++.h>
#define inf 1e9
using namespace std;
int go(vector<int>a,int n){
	vector<int>dp(n+1);
	dp[1]=0;
	for(int i=2;i<=n;i++){
		int op1=abs(a[i]-a[i-1])+dp[i-1];
		int op2=(i==2)?inf:abs(a[i]-a[i-2])+dp[i-2];
		dp[i]=min(op1,op2);
	}
	return dp[n];
}
int main(){
	int n;
	cin>>n;
	vector<int>a(n+1);
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	cout<<go(a,n);
}

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

void solveA(){
  int x;
  cin >> x;

  if(x==7 || (x==5 || x==3)) cout << "YES" << endl;
  else cout << "NO" << endl;
}
void solveB(){
  
}
void solveC(){
  
}
void solveD(){
  
}

int main(){
  solveA();
}


Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

int N;
bool isequal(vector<int> v, vector<int> u){
	rep(i,N) if(v[i] != u[i]) return false;
  	return true;
}

void Main()
{
  	cin >> N;
  	vector<int> P(N), Q(N), R(N);
  	rep(i,N) cin >> P[i];
  	rep(i,N) cin >> Q[i];
  	iota(R.begin(), R.end(), 1);
  	int p = 0;
  	int q = 0;
  	int i = 0;
  	do{
    	if(isequal(P,R)) p = i; 
    	if(isequal(Q,R)) q = i;
      	i++;
    }while(next_permutation(R.begin(),R.end()));
  	cout << abs(p-q) << endl;
	return;
}

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

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())
#define IN(x, a, b) x >= a and x < b

using namespace std;
using ll = long long;

template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T> constexpr T INF = numeric_limits<T>::max() / 2;
#pragma endregion

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

  int N;
  cin >> N;
  int ans = 0;
  FOR(i, 1, N / 2 + 1) {
    if (i != N - i)
      ans++;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int n;
vector<pii> a;
vb used;
vi v;
double sum = 0;
double cnt = 0;
double f(){
    double s = 0;
    for(int i = 0; i < n-1; i++){
        s += sqrt(pow(a[v[i]].fi - a[v[i+1]].fi, 2) + pow(a[v[i]].se - a[v[i+1]].se, 2));
    }
    return s;
}
void rec(int idx){
    if(idx == n){
        cnt++;
        sum += f();
        return;
    }
    for(int i = 0; i < n; i++){
        if(used[i]) continue;
        used[i] = true;
        v[idx] = i;
        rec(idx+1);
        used[i] = false;
    }
}
void solve(){
    cin >> n;
    v.resize(n);
    used.resize(n, false);
    for(int i = 0; i < n; i++){
        int x, y;
        cin >> x >> y;
        a.pb({x, y});
    }
    rec(0);
    cout << fixed << setprecision(7) << sum / cnt;
}
int main(){
    speed;
    int t = 1;
    //cin >> t;
    while(t--) solve();
}

Measured memory_bytes: 384
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);
	static boolean debug = false;

	static String[] s;
	static int[] m = {5, 7, 5, 7, 7};

	static boolean f(int off) {
		int pos = off;
		int idx = 0, cur = 0;
		while (true) {
			cur += s[pos].length();
			if (m[idx] < cur) return false;
			if (m[idx] == cur) {
				idx++;
				cur = 0;
			}
			if (idx == 5) {
				return true;
			}
			pos++;
		}
	}

	static boolean solve() {
		int n = in.nextInt();
		if (n == 0) return false;

		s = new String[n];

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

		for (int i=0; i<n; i++) {
			if (f(i)) {
				out.println((i+1));
				return true;
			}
		}

		return true;
	}

	public static void main(String[] args) {
		debug = args.length > 0;
		long start = System.nanoTime();

		while(solve());
		out.flush();

		long end = System.nanoTime();
		dump((end - start) / 1000000 + " ms");
		in.close();
		out.close();
	}

	static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); }
}

Measured memory_bytes: 31588
#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <time.h>
using namespace std;
typedef long long int ll;

#define EPS (1e-9)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i,n) for(int i=0;i<n;i++)

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

ll beki(ll a, ll b) {
	ll tmp = 1;
	REP(i, b) tmp *= a;
	return tmp;
}

string S;

int main() {
	cin >> S;
	if (S == "Sunny") {
		cout << "Cloudy" << endl;
	}
	else if (S == "Cloudy") {
		cout << "Rainy" << endl;
	}
	else {
		cout << "Sunny" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;

typedef struct pp {
    char name[100];
    int t;
} P;

P Q[100001];
int head, tail, n;

void enqueue(P x) {
    Q[tail] = x;
    tail = (tail + 1) % 100000;
}

P dequeue() {
    P x = Q[head];
    head = (head + 1) % 100000;
    return x;
}

int main() {
    int elaps = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &q);
    for ( i = 1; i <= n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
    head = 1;
    tail = n+1;
    while (head != tail) {
        u = dequeue();
        if (u.t < q) {
            elaps += u.t;
            u.t -= u.t;
        } else {
            elaps += q;
            u.t -= q;
        }
        if (u.t > 0) {
            enqueue(u);
        } else {
            cout << u.name << " " << elaps << endl;
        }
    }
  return 0;
}


Measured memory_bytes: 13288
#include <iostream>
#include <cstring>
#include <climits>
#include <vector>
#include <string>
#include <cmath>
#include <cstdio>
#include <map>
#include <algorithm>
#include <queue>

using namespace std;

int main(){
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,k,x;
	cin>>n>>k;
	int ans = 0;
	for(int i = 1; i <= n; i++){
		cin>>x;
		ans += min(x, k-x);
	}
	cout<<2*ans<<endl;
}



Measured memory_bytes: 256
import sys
input = sys.stdin.readline
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N,M=rl()
S = [[0]*(N+1) for _ in range(M)]
for i in range(M):
    k, *s = rl()
    for s_ in s:
        S[i][s_] = 1
P=rl()

ans = 0
import itertools
for switch in itertools.product(range(2),repeat=N):
    ret = 0
    for p, s in zip(P,S):
        cnt = 0
        for i in range(N):
            cnt += switch[i]*s[i+1]
        if p != cnt%2:
            break
        ret += 1
    ans += ret//M

print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define Endl endl


signed main(void){
    int N;
    cin >> N;
    cout <<(N-2)*180 << endl;
    
    
    return 0;
}



Measured memory_bytes: 256
X =int(input())
A =[i**5 for i in range(1,121)]
a =[i for i in range(1,120)]
B =[i**5 for i in range(-120,121)]
b =[i for i in range(-120,121)]

flg =False
for i in range(len(A)):
    for j in range(len(B)):
        if A[i]  -  B[j]  == X:
            print("{} {}".format(a[i],b[j]))
            flg =True
            break
    if flg:
        break

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long int

void solve(ll caseNo)
{
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for(int i=0;i<n;i++)    cin >> a[i];
    for(int i=0;i<n;i++)    cin >> b[i];

    reverse(b.begin(), b.end());

    int l, r, val;
    for(int i=0;i<n;i++)
    {
        if(a[i] == b[i])    
        {
            val = a[i];
            l = i;
            break;
        }
    }

    for(int i=n-1;i>=0;i--)
    {
        if(a[i] == b[i])
        {
            r = i;
            break;
        }
    }

    int k = l;
    for(int i=0;i<l and k<=r;i++)
    {
        if(b[i] != val and a[i] != val)
        {
            swap(b[i], b[k++]);
        }
    }

    for(int i=r+1;i<n and k<=r;i++)
    {
        if(b[i] != val and a[i] != val)
        {
            swap(b[i], b[k++]);
        }
    }

    bool flag = true;
    for(int i=0;i<n;i++)
    {
        if(a[i] == b[i])
        {
            flag = false;
            break;
        }
    }

    if(flag)
    {
        cout << "Yes" << endl;
        for(int i=0;i<n;i++)
        {
            cout << b[i] << " ";
        }
        cout << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return;
}

int main()
{
    IOS;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll cases;
    cases = 1;
    for(ll i=1;i<=cases;i++)
    {
        solve(i);
    }
    return 0;
}

Measured memory_bytes: 4784
#include <stdio.h>

int main(){
  int N;
  int memo[28]={1,0,0,0
	       ,1,0,0,1
	       ,1,0,0,1
	       ,1,0,1,1
	       ,1,0,1,1
	       ,1,1,1,1
	       ,1,1,1,1}; 
  scanf("%d",&N);
  
  if(N>=28 || memo[N])
    printf("Yes\n");
  else
    printf("No\n");

  return 0;
}
	

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N,X;
    cin >>N>>X;
    vector<ll>m(N);
    ll sum =0;
    rep(i,N){
        cin>>m[i];sum+=m[i];
    }

    sort(all(m));


    cout << N +(X-sum)/m[0] << endl;


    return 0;
    

}

Measured memory_bytes: 3616
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <deque>

long long N;
std::map<long long, int > map;
long long ans;

void check(long long value){
  if (value==1) return;
  if (N/(value-1)==N%(value-1)){
    ans += value-1;
  }
  return;
}

void dfs(long long value, int num){
  //std::cout << "dfs(" << value << "," << num << ") called" << std::endl; 
  //std::cout << "1: mp size = " << map.size() << std::endl;
  if (num==map.size()){
    //printf("check (%lld)\n", value);
    check(value);
  } else {
    //std::cout << "2: mp size = " << map.size() << std::endl;
    long long power = 1;
    auto itr = map.begin();
    std::advance(itr, num);
    //std::cout << "3: mp size = " << map.size() << std::endl;
    //std::cout << map[num] << std::endl;
    //std::cout << "3.5: mp size = " << map.size() << std::endl;
    long long input = value;
    for (int i=0; i<=itr->second; i++){
      //std::cout << "4: mp size = " << map.size() << std::endl;
      //std::cout << "i=" << i << std::endl;
      dfs(input, num+1);
      input *= itr->first;
      //std::cout << "5: mp size = " << map.size() << std::endl;
    }
  }
}

int main(){
  ans = 0;
  scanf("%lld", &N);
  long long N_temp = N;
  for (long long i=2; i*i<=N_temp; i++){
    //printf("i=%d\n", i);
    while (N_temp%i==0){
      map[i]++;
      N_temp /= i;
    }
  }
  if (N_temp!=1){
    map[N_temp]++;
  }
  //std::cout << "size=" << map.size() << std::endl;
  dfs(1, 0);
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    if(a==b)
        printf("%d\n",c);
    else if(a==c)
        printf("%d\n",b);
    else if(b==c)
        printf("%d\n",a);
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;
    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
        //MyDebugger.Test(process, "../TextFile2.txt");
        //MyDebugger.MakeTestCase("../TextFile2.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var s = input.ReadLine();
        var ss = s.Split(' ');

        return ss[1] + ss[0];
    }
}

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

string make_num(int p, long long N, int l){
  string ret = to_string(p);
  int q = -1;
  for(int i = 0; i < p; ++i){
    if(N >= (1LL<<(l-2))) N -= (1LL<<(l-2));
    else{
      q = i;
      break;
    }
  }
  if(q < 0){
    if(N < 9*((1LL<<(l-2))-1)) return ret + make_num(p, N, l-1);
    N -= 9*((1LL<<(l-2))-1);
    for(int i = p+1; i < 10; ++i){
      if(N >= (1LL<<(l-2))) N -= (1LL<<(l-2));
      else{
        q = i;
        break;
      }
    }
  }
  ret += to_string(q);
  if(p < q) swap(p,q);
  string ret_(l-2,'0');
  for(int i = 0; i < l-2; ++i){
    if((N>>i)&1LL) ret_[i] += p;
    else ret_[i] += q;
  }
  reverse(ret_.begin(), ret_.end());
  ret += ret_;
  return ret;
}

int main(){
  long long N;
  while(cin >> N, N){
    int ng = 0, ok = 64;
    while(ok - ng > 1){
      int m = (ng + ok)/2;
      if(N <= 81*((1LL<<m) - 1 - m))
        ok = m;
      else ng = m;
    }
    //cout << ok << endl;
    N -= 81*((1LL<<(ok-1)) - ok) + 1;
    int p = N/(9*((1LL<<(ok-1))-1)) + 1;
    N %= (9*((1LL<<(ok-1))-1));
    cout << make_num(p,N,ok) << endl;
  }
  return 0;
}



Measured memory_bytes: 3236
#include "bits/stdc++.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF ((long long) 1e18)//1234567890987654321
#define INF 1234567890ll
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second	
#define db 0
#define EPS (1e-7)    //0.0000001 the value
#define PI (acos(-1))
#define MAXN (300006)
#define ll long long int 
#define ld long double
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
#define FOR(ii, ss, ee) for(ll ii = ss; ii < ee; ++ii)
#define space " "
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ((ll)x.size())
#define ph push
#define emp emplace
#define btinpct(x) __builtin_popcountll(x)
#define p2(x) (1LL<<(x))
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
inline ll rand(ll x, ll y) { ++y; return (rng() % (y-x)) + x; } //inclusivesss
ll n,q,D[MAXN];
spi A[MAXN];
set<pi>s;
ll ans[MAXN];
int main()
{
	mmst(ans,-1);
	FAST
	cin>>n>>q;
	FOR(i,0,n){cin>>A[i].s.f>>A[i].s.s>>A[i].f;
		A[i].s.s--;
	}
	FOR(i,0,q)cin>>D[i];
	FOR(i,0,q)s.ins(pi(D[i],i));
	sort(A,A+n);
	FOR(i,0,n){
		if(A[i].s.s<A[i].f)continue;
		ll mi=max((ll)0,A[i].s.f-A[i].f);
		auto lb=s.lower_bound(pi(mi,0));
		ll mx=A[i].s.s-A[i].f;
		auto ub=s.upper_bound(pi(mx,LLINF));
		if(ub==s.begin())continue;
		ub--;
		if(*lb>*ub)continue;
		stack<pi>stk;
		for(auto itr=lb; itr!=next(ub); itr++){
			ans[itr->s]=A[i].f;
			stk.ph(*itr);
		}
		while(stk.size())s.erase(stk.top()),stk.pop();
	}
	FOR(i,0,q)cout<<ans[i]<<'\n';//cout<<'\n';
}


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


int main() {
	// your code goes here
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector <ll> h(n, 0);
    for (ll i=0; i<n; i++)
        cin>>h[i];
        
    int best = 0;
    int curr = 0;
    for (ll i=n-2; i>=0; i--) {
        if (h[i] >= h[i+1])
            curr++;
        else curr = 0;
        best = max(best, curr);
    }
    cout<<best<<"\n";
    
	return 0;
}


Measured memory_bytes: 1024
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int N = scanner.nextInt();
			Map<Integer, Integer> map = new HashMap<Integer, Integer>();

			for (int i = 0; i < N; i++) {
				int key = scanner.nextInt();
				if (map.containsKey(key)) {
					;
				} else {
					map.put(key, 1);
				}
			}
			System.out.println(map.size());
		}
	}
}

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

void solve(long long A, long long B, long long C){
	if (A==B && B==C) cout << "Yes\n"; else cout << "No\n";
}

int main(){
	long long B;
	long long C;
	long long A;
	scanf("%lld",&A);
	scanf("%lld",&B);
	scanf("%lld",&C);
	solve(A, B, C);
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
long long N_MAX = 1234567890123;
int main()
{
  long long n,nn,i,res=N_MAX;
  cin >> n;
  nn = sqrt(n)+1;
  for(i=1;i<=nn;i++)
    if(n%i==0)
      res=min(res,i+n/i-2);
  cout << res << endl;
  return 0;
}

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

int main(){
  int a, b; cin >> a >> b;
  if(a%3==0 || b%3==0 || (a+b)%3==0){
    cout << "Possible" << endl;
  }
  else{
    cout << "Impossible" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int simulate(int *w, int n, int k, int c)
{
	int r = 0;
	for(int i = 0; i < n; ++i)
	{
		if(r < w[i])
		{
			if(k-- == 0) { return 0; }
			r = c;
		}
		r -= w[i];
	}
	return 1;
}

int main()
{
	int n, k, mid, low = 0, high = 0;
	int w[100000];
	
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; ++i)
	{
		scanf("%d", &w[i]);
		low = low > w[i] ? low : w[i];
		high += w[i];
	}
	
	while(low < high)
	{
		mid = (low + high) / 2;
		if(simulate(w, n, k, mid))
		{
			high = mid;
		}
		else
		{
			low = mid + 1;
		}
	}

	printf("%d\n", low);
}



Measured memory_bytes: 2184
#include <string>
#include <stack>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
using namespace std;

int main(){
	string word;
	stack<int> s;
	while(cin>>word){
		if(word=="+"){
			int a=s.top();
			s.pop();
			int b = s.top();
			s.pop();
			s.push(a+b);
		}
		else if(word=="-"){
			int a=s.top();
			s.pop();
			int b=s.top();
			s.pop();
			s.push(b-a);
		}
		else if(word=="*"){
			int a = s.top();
			s.pop();
			int b = s.top();
			s.pop();
			s.push(a*b);
		}
		else {
		int i;
            sscanf(word.c_str(), "%d", &i);
			s.push(i);
		}
	}
	printf("%d\n",s.top());
	return 0;
}

Measured memory_bytes: 3336
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define INF I64_MAX
#define MOD 1000000007
#define MEM_SIZE = 1e5+5;

template<typename T> void DEBUG(T e){std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}




//-----CODE------//
//-----CODE------//


void solve(void)
{
  int N;
  cin>>N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++)
  {
    int A;
    cin>>A;
    vec[A]++;
  }
  bool check = 1;
  int ANS = 1;
    if(N%2 == 1)
    {
      if(vec[0] != 1) check = 0;
    }
    else if(N%2 == 0)
    {
      if(vec[0] != 0) check = 0;
    }

  for (int i = 1; i < N; i++)
  {
    if((i%2 + N%2) == 1)
    {
      if(vec[i] != 2)
      {
        check = 0;
      }
      else
      {
        ANS *= vec[i];
        // DEBUG(vec[i]);
        ANS %=MOD;
      }
      
    }
  }

  if(check == 0)
  {
    cout<<0<<endl;
  }
  else
  {
    cout<<ANS<<endl; 
  }
  
  
  

  
  
  return; 
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<int> v(n,INF);
	vector<int> rd(n);
	v[0]=0;
	for(int &x: rd)
		scanf("%d",&x);
	for(int i=0;i<n;i++)
		for(int j=i+1;j<=i+2;j++)
			if(j<n)
				v[j] = min(v[j],v[i]+abs(rd[j]-rd[i]));
	cout<<v[n-1]<<'\n';
}

Measured memory_bytes: 1024
n, m, k = map(int, input().split())
MOD = 998244353

ans = 0
c = 1
for i in range(k + 1):
    ans = (ans + m * pow(m - 1, n - i - 1, MOD) * c) % MOD
    c = (c * (n - 1 - i) * pow(i + 1, MOD - 2, MOD)) % MOD
    # print(f"{ans = }, {c = }")

print(ans)

Measured memory_bytes: 9192
n = int(input())
R = [int(input())]
min = R[0]
x = -1000000000
for i in range(1,n):
    R.append(int(input()))
    if R[i] - min > x:
        x = R[i] - min
    if R[i] < min:
        min = R[i]
print(x)


Measured memory_bytes: 13588
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;

#define FOR(i,n) for(int i = 0; i < n; i++)
#define FORa(i,a,b) for(int i = a; i < b; i++)
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
#define F first
#define S second
#define SORT(a,n) sort(begin(a), begin(a) + n)
#define VSORT(v) sort(v.begin(), v.end())
#define MAX 1000000
#define ll long long
#define LOW(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define UP(s) transform(s.begin(),s.end(),s.begin(),::toupper)

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

int main() {
	ll x, ans = 0, money = 100;
	cin >> x;
	
	while(money < x) {
		money += money/100;
		ans++;
	}
	
	cout << ans << endl;
  
	return 0;
}

Measured memory_bytes: 3564
# i番目とi - 1番目の箱の中身の和がxを超えているとき、i番目から余剰分を引く

import sys
readline = sys.stdin.readline

N,x = map(int,readline().split())
A = list(map(int,readline().split()))

ans = 0
if A[0] > x:
  ans += A[0] - x
  A[0] = x

for i in range(1,len(A)):
  if A[i] + A[i - 1] > x:
    diff = (A[i] + A[i - 1]) - x 
    ans += diff
    A[i] -= diff

print(ans)

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

int main()
{
    std::string s, t;
    std::cin >> s >> t;
    int n = s.length();

    int flag = 0;
    for (int i=0; i<n; i++) {
        std::string rotated;
        rotated = s.substr(i) + s.substr(0, i);    // string型のもつsubstrメソッドで部分文字列を取れる。 + で連結も可能
        if (rotated == t) {
            flag = 1;
            break;
        }
    }
    if (flag) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }
}

Measured memory_bytes: 256
using System;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = Console.ReadLine().Split(' ');
            long a = long.Parse(A[0]);
            long b = long.Parse(A[1]);
            long c = long.Parse(A[2]);
            var d = Math.Pow(10, 100);
            long cnt = 0;
            long e =a/( b + c);
            cnt += b * e;
            a -= e * (b + c);
            for (int i = 0; i < d; i++)
            {
                if (a >= b)
                {
                    cnt += b;
                    a -= b;
                }
                else
                {
                    cnt += a;
                    break;
                }
                if (a >= c)
                {
                    a -= c;
                }
                else
                {
                    break;
                }
            }
            Console.WriteLine(cnt);
        }
    }
}


Measured memory_bytes: 13140
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
template<typename T> void cmin(T &a, T b) { a = min(a, b); }
template<typename T> void cmax(T &a, T b) { a = max(a, b); }

signed main() {
  int n;
  cin >> n;
  map<int, int> m;
  rep(i, n) {
    int a;
    cin >> a;
    m[a]++;
  }
  int ans = 0;
  for (auto x : m) {
    if (x.first == x.second)
      continue;
    else if (x.first < x.second)
      ans += x.second - x.first;
    else
      ans += x.second;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 6272
X,K,D = map(int,input().split())

X = abs(X)

if X == D :
  if K == 0:
    print (X)
  elif K % 2 == 0:
    print(X)
  else:
    print(0)
elif X < D :
  if K == 0 :
    print(X)
  elif K % 2 ==0:
    print(X)
  else:
    print( abs(D - X))
elif X > K * D:
  print (X - K * D)

elif X // D < K:
  K = K - X // D
  if K % 2 == 0:
    print (X % D)
  else:
    print (abs(D - X % D))
else:
  print(X)

Measured memory_bytes: 9132
#include<stdio.h>

int main()
{
	long int N;
	int count = 0;
	scanf("%ld", &N);
	while(N > 0)
	{
		if(N % 10 == 1)
			count++;
		N /= 10;
	}
	
	printf("%d", count);
	
	return 0;
}

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

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define deb(x) cout << x << endl
#define done(x) {cout << x << endl;return;}
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;


const int N = 405;

int d;
vi c(27);
vvi a(N,vi(27));
vector<si> s(27);

int f(vi &v){
  int res = 0;
  fr(i,1,26)
    s[i]={-1,d};
  vi last(27,-1);
  rep(i,0,d){
    last[v[i]]=i;
    s[v[i]].insert(i);
    fr(j,1,26)
      res-=(i-last[j])*c[j];
    res+=a[i][v[i]];
  }
  return res;
}


void solve() {

  
  cin>>d;
  fr(i,1,26)
    cin>>c[i];
  rep(i,0,d)
    fr(j,1,26)
      cin>>a[i][j];
  

  uniform_int_distribution<int> rg1(1,26);
  uniform_int_distribution<int> rg2(0,d-1);
  vi v(d);
  rep(i,0,d)
    v[i]=rg1(mt);
  int res = f(v);
  int q = 1e7;
  rep(_,0,q){
    int x=rg2(mt),y=rg1(mt),del=0;
    int z = v[x];
    s[z].erase(x);
    auto it = s[z].lb(x);
    int nxt = *it, lst = *(--it);
    int fact = c[z]*(x-lst);
    del -= fact*(nxt-x);
    it = s[y].lb(x);
    nxt = *it, lst = *(--it);
    fact = c[y]*(x-lst);
    del+=fact*(nxt-x);
    del+=a[x][y]-a[x][z];
    if(del>0){
      s[y].insert(x);
      v[x]=y;
      res+=del;
    }else
      s[z].insert(x);
  }
  /*cout<<res<<endl;
  vi tmp = {1,17,13,14,13};
  cout<<f(tmp)<<endl;*/
  trav(t,v)
    cout<<t<<' ';

  
}


signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
   //cin >> t;

    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}







int powm(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1)
            res = (res*a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return res;
}

int divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}


int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}


Measured memory_bytes: 3752
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
ll s[1010];
int main()
{
    ll a,b,k;
    int j;
    scanf("%lld%lld%lld",&a,&b,&k);
    if(a>b)
        swap(a,b);
    if(b-a+1<=2*k)
    {
        for(ll i=a;i<=b;i++)
            printf("%lld\n",i);
    }
    else
    {
        j=0;
        for(ll i=0;i<k;i++)
        {
            s[j++] = a+i;
            s[j++] = b-i;
        }
        sort(s,s+j);
        for(int i=0;i<j;i++)
            printf("%lld\n",s[i]);
    }
    return 0;
}

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

int mod = 1000000007;

int64_t monster(int64_t x)
{
    if (x == 1)
        return 1;
    else
        return monster(x / 2) * 2 + 1;
}

int main()
{
    int64_t H;
    cin >> H;
    cout << monster(H);
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;

#define ll long long
const int MOD = 1000000007;//10^9+7
const string SPACE = " ";

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//pは素数,aのb乗をpで割った余り

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//pは素数,(nCr)%p

ll gcd(ll a, ll b) {

	if (a > b) {

		ll tmp = a;
		a = b;
		b = tmp;

	}
	ll r;
	r = b%a;
	if (r == 0)return a;
	else return gcd(r, a);

}
//最大公約数

ll lcm(ll a, ll b) {

	return (a / gcd(a, b))*b;

}
//最小公倍数

ll MAX(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
//MAX

bool func(ll p) {

	if (p == 1)return false;
	else if (p == 2)return true;
	else {

		bool flag = true;
		for (int i = 2; i <= sqrt(p); i++) {

			if (p%i == 0) {

				flag = false;
				break;

			}

		}
		return flag;

	}

}
//素数判定,素数=true,合成数=false

int main() {

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

	if (a + b > c + d)cout << "Left" << endl;
	else if (a + b == c + d)cout << "Balanced" << endl;
	else cout << "Right" << endl;

	return 0;
}

Measured memory_bytes: 256
# coding: utf-8

N, X = map(int,input().split())
R = input().split()
for i in range(len(R)):
    R[i] = int(R[i])
def real(n):
    if n >= 0:
        return n 
    else:
        return -1*n 
moto = []
for i in R:
    moto.append(real(i-X))
ans = min(moto)
for i in moto:
    if i % ans != 0:
        ans = i % ans
print(ans)

Measured memory_bytes: 11096
include Math
N, K = gets.split.map(&:to_i)

ans = 0
cnt = 0
1.upto N do |i|
  # さいころで目iが出た瞬間ゲームに勝利
  if i >= K
    ans += 1.to_f / N.to_f
  # iの方が小さいのでコインを投げる
  else
    # 表が出続ける回数log2(K/i).ceilを計算
    cnt = ( log2(K) - log2(i) ).ceil
    # puts cnt
    ans += 1.to_f / (N * (2**cnt)).to_f
    # puts ans
  end
end
puts ans

Measured memory_bytes: 2300
#include <bits/stdc++.h>
using namespace std;
int a[200005];
int d[200005];
int k,n;

int main() {
  cin>>n>>k;
  for(int i=1;i<=n;i++) {
    cin>>a[i];
  }
  while(k--) {
    memset(d,0,sizeof(d));
    bool f=1;
    for(int i=1;i<=n;i++) {
      if(a[i]!=n) {
        f=0;
        break;
      }
    }
    if(f) {
      break;
    }
    for(int i=1;i<=n;i++) {
      d[max(i-a[i],1)]++;
      d[min(i+a[i],n)+1]--;
    }
    for(int i=1;i<=n;i++) {
      a[i]=a[i-1]+d[i];
    }
  }
  for(int i=1;i<=n;i++) {
    cout<<a[i]<<' ';
  }
  return 0;
}

Measured memory_bytes: 5196
#include<iostream>
#include<vector>
#include<string>

using namespace std;

int main() {
	
	int r, g, b;

	cin >> r >> g >> b;

	if ((r * 100 + g * 10 + b) % 4 == 0)cout << "YES" << endl;
	else cout << "NO" << 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)++)
typedef long long ll;

string check(string S) {
    return S == "ARC" ? "ABC" : "ARC";
}

int main() {
    string S;
    cin >> S;
    cout << check(S);
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int main(){
    long n;
    cin >> n;
    long x[n];
    long y[n];
    long h[n];
    int ansx=0;
    int ansy=0;
    long ansh=0;
    for(int i=0;i<n;i++)cin >> x[i] >> y[i] >> h[i];
    for(int xx = 0;xx<=100;xx++){
        for(int yy=0;yy<=100;yy++){
            bool chk=true;
            int ii=0;
            while(h[ii]==0){
                ii++;
            }
            long tmph = h[ii] + abs(xx-x[ii]) + abs(yy-y[ii]);
            for(int i=0;i<n;i++){
                if(h[i] != max(0L,tmph-abs(xx-x[i])-abs(yy-y[i]))){
                    chk=false;
                    break;
                }
            }
            if(chk){
                ansx=xx;
                ansy=yy;
                ansh=tmph;
                goto xxxx;
            }
            
        }
    }
    xxxx:
    cout<<ansx<<" "<<ansy<<" "<<ansh<<endl;
    
}

Measured memory_bytes: 3632
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
using namespace std;

string s, t;
int ims[114514], imt[114514];
int q;

int main(void)
{
	cin >> s >> t;
	int ls = s.size(), lt = t.size();
	for (int i = 0; i < ls; ++i)
	{
		ims[i + 1] = ims[i] + (s[i] == 'A' ? 1 : 2);
	}
	for (int i = 0; i < lt; ++i)
	{
		imt[i + 1] = imt[i] + (t[i] == 'A' ? 1 : 2);
	}
	cin >> q;
	for (int k = 0; k < q; ++k)
	{
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		--a; --c;
		int v1 = ims[b] - ims[a];
		int v2 = imt[d] - imt[c];
		if (v1 % 3 == v2 % 3)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 1664
while True:
    n = int(input())
    
    if n == 0:
        break
    
    p = [int(i) for i in input().split()]
    j = [int(i) for i in input().split()]

    s = 0
    for i in range(len(p)):
        s += p[i]
    for i in range(len(j)):
        s += j[i]
    
    ans = s
    j.sort()
    
    for i in range(len(j)):
        s -= j[i]
        ans = max(ans, s*(i+2))
        
    print(ans)


Measured memory_bytes: 8068
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        long a = sc.nextLong();
      	long b = sc.nextLong();
      	long c = sc.nextLong();
          
      	if(c > a+b && 4*a*b < (c-(a+b))*(c-(a+b))) System.out.println("Yes");
      	else System.out.println("No");
	}
}

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


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

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


Measured memory_bytes: 3624
#include <iostream>

int main(){
	int D;
	std::cin>>D;

	if(D == 25){
		std::cout<<"Christmas"<<std::endl;
	}else if(D == 24){
		std::cout<<"Christmas Eve"<<std::endl;
	}else if(D == 23){
		std::cout<<"Christmas Eve Eve"<<std::endl;
	}else if(D == 22){
		std::cout<<"Christmas Eve Eve Eve"<<std::endl;
	}

	return 0;
}


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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

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

class UnionFind{
private:
	std::vector<int_fast32_t> par;
	size_t n;

public:
	UnionFind(){}
	UnionFind(size_t n):n(n){
		par.resize(n, -1);
	}

	uint_fast32_t find(uint_fast32_t x){
		return par[x] < 0 ? x : par[x] = find(par[x]);
	}

	size_t size(uint_fast32_t x){
		return -par[find(x)];
	}

	void unite(uint_fast32_t x, uint_fast32_t y){
		x = find(x);
		y = find(y);
		if(x == y) return;
		if(size(x) < size(y)) std::swap(x, y);
		par[x] += par[y];
		par[y] = x;
	}

	bool same(uint_fast32_t x, uint_fast32_t y){
		return find(x) == find(y);
	}
};

const int64 mod = 1e9+7;

int32 toint(string s){
	int32 res = 0;
	REP(i, s.size()){
		res = (res*10+s[i]-'0');
	}
	return res;
}

int64 mpow(int64 x, int64 y){
	if(y == 0) return 1;
	if(y%2) return x*mpow(x, y-1)%mod;
	int64 ret = mpow(x, y/2);
	return ret*ret%mod;
}

int32 N;
map<int32, int32> mp;

int main(void){
	cin >> N;
	FOR(i, 1, N+1){
		int32 x = i;
		FOR(j, 2, sqrt(x)+1){
			while(x % j == 0){
				mp[j]++;
				x /= j;
			}
		}
		if(x != 1) mp[x]++;
	}
	vector<int64> dp(100, 0);
	dp[1] = 1;
	for(auto x: mp){
		vector<int64> dp2(100, 0);
		REP(i, x.sc+1){
			REP(j, 100){
				if(j*(i+1) < 100){
					dp2[j*(i+1)] = (dp2[j*(i+1)]+dp[j])%mod;
				}
			}
		}
		swap(dp, dp2);
	}
	cout << dp[75] << endl;
}


Measured memory_bytes: 256