akhauriyash/Code-Regression huggingface dataset:
n=int(input())
a=[int(j) for j in input().split()]
ans=1
p=2
for i in range(1,n):
    if a[i-1]<a[i]:
        if p==0:
            continue
        if p==2:
            p=0
        else:
            p=2
            ans+=1
    elif a[i-1]>a[i]:
        if p==1:
            continue
        if p==2:
            p=1
        else:
            p=2
            ans+=1

    
print(ans)

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

const ll MOD = 1e9 + 7;

int main(){
    int k, x;
    cin >> k >> x;
    rep(i, 2*k-1) cout << i+x-k+1 << " ";
    cout << endl;
}

Measured memory_bytes: 384
#include <stdio.h>
typedef long long ll;

int main() {
  int k;
  scanf("%d", &k);
  ll a[100005];
  for (int i = 0; i < k; i++) {
    scanf("%lld", &a[i]);
  }
  ll mn = 2;
  ll mx = 2;
  for (int i = k - 1; i >= 0; i--) {
    // [L, R]のaの倍数のminは、ceil(L/a)*a
    //                  maxは、floar(R/a)*a
    ll amn = (mn + a[i] - 1) / a[i] * a[i];
    ll amx = mx / a[i] * a[i];
    if (amn > mx) {
      printf("%d", -1);
      return 0;
    }
    mn = amn;
    mx = amx + a[i] - 1;
  }
  printf("%lld %lld", mn, mx);
}


Measured memory_bytes: 896
import sys
from itertools import combinations
from fractions import gcd

def get_divs(n):
  divs = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divs.append(i)
      if i != n // i:
        divs.append(n//i)
  return divs

input = sys.stdin.readline
A,B= map(int,input().split())
mem = {}
com_divs = list(set(get_divs(A)).intersection(get_divs(B)))
if len(com_divs) == 1:
  print(1)
  exit()

ans = 1
for div in com_divs:
  if len(get_divs(div)) == 2: ans += 1
print(ans)

Measured memory_bytes: 67160
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ProblemD_DigitSumReplace solver = new ProblemD_DigitSumReplace();
        solver.solve(1, in, out);
        out.close();
    }

    static class ProblemD_DigitSumReplace {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int m = in.nextInt();
            Pair o = null;
            for (int i = 0; i < m; i++) {
                int d = in.nextInt();
                long c = in.nextLong();
                Pair t = reduce(d, c);
                if (i == 0) {
                    o = t;
                } else {
                    o = combine(o, t);
                }
            }
            out.println(o.ops);
        }

        private Pair combine(Pair a, Pair b) {
            int rem = a.rem + b.rem;
            long ops = 1 + a.ops + b.ops;
            int u = rem / 10;
            int v = rem % 10;
            if (u > 0) {
                ++ops;
                ++v;
            }
            return new Pair(v, ops);
        }

        private Pair reduce(int d, long c) {
            if (c == 0) {
                return new Pair(0, 0);
            }
            if (c == 1) {
                return new Pair(d, 0);
            }
            if (c % 2 != 0) {
                Pair a = reduce(d, c - 1);
                Pair b = new Pair(d, 0);
                return combine(a, b);
            }
            Pair a = reduce(d, c / 2);
            return combine(a, a);
        }

        class Pair {
            int rem;
            long ops;

            Pair(int rem, long ops) {
                this.rem = rem;
                this.ops = ops;
            }

        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

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

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

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

    }
}



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

namespace CSharpSample01
{

	class Program
	{

		static void Main(string[] args)
		{
			var N = float.Parse(Console.ReadLine());
			var answer = N * 2 * 3.14;

			Console.WriteLine(answer);

		}
	}
}

Measured memory_bytes: 27612
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)

static const ll MOD = 1e9 + 7;

ll n, m;

ll d[301][301] = {};
ll e[301][301] = {};

void wf() {
	repe(k, 1, n) {
		repe(i, 1, n) {
			repe(j, 1, n) {
				if (d[i][j] > d[i][k] + d[k][j]) {
					d[i][j] = d[i][k] + d[k][j];
				}
			}
		}
	}
}

int main()
{
	cin >> n >> m;
	repe(i, 1, n) repe(j, 1, n) {
		if (i != j) {
			d[i][j] = 1 << 29;
			e[i][j] = 1 << 29;
		}
	}
	rep(i, 0, m) {
		ll A, B, T; cin >> A >> B >> T;
		d[A][B] = T;
		d[B][A] = T;
		e[A][B] = T;
		e[B][A] = T;
	}

	wf();

	ll cnt = 0;
	repe(i, 1, n) repe(j, 1, n) {
		if (i > j) {
			if (e[i][j] != 1 << 29 && d[i][j] != e[i][j]) {
				cnt++;
			}
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int v0 = a, v1 = b, v2 = a % b;
  while (v2 != 0) {
    v0 = v1;
    v1 = v2;
    v2 = v0 % v1;
  };
  return v1;
}
signed main(){
    int K; cin>>K;
    long long ans =0;
    for(int i=1; i<=K; i++){
        for(int j=1; j<=K; j++){
            for(int m=1; m<=K; m++){
                ans += gcd(gcd(i,j),m);
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3640
import java.util.*;

class Main {

    static int solve(int a, int b, int c) {
        int re =  c - (a-b);
        return re>0?re:0;
    }

    public static void main(String[] as) {
        Scanner stdIn=new Scanner(System.in);
        int a=stdIn.nextInt();
        int b=stdIn.nextInt();
        int c=stdIn.nextInt();

        System.out.println(solve(a,b,c));
    }

}




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

int main() {
    int A , B ,C ,K ;
    cin >> A >>B >> C >> K;
    if(A >= K){
        cout << K << endl;
    }
    else if ((A+B) >= K){
        cout << A << endl;
    }
    else{
        cout << 2*A+B-K <<endl;
    }

  
}

Measured memory_bytes: 3596
n, k = map(int, input().split())
a = [i-1 for i in map(int, input().split())]

left, right = 1, 10**9
while left < right:
    middle = (left + right)//2

    count = 0
    for i in a:
        count += i//middle
    
    if count <= k:
        right = middle
    else:
        left = middle + 1

print(left)

Measured memory_bytes: 31244
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
using namespace std;

int main() {
    long long n, k;
    cin >> n >> k;

    if (k > n) k = n;

    vector<long long> h(n);
    rep(i, 0, n) cin >> h[i];

    sort(h.begin(), h.end());

    long long sum = 0;
    rep(i, 0, n) sum += h[i];
    rep(i, 0, k) {
        int j = n - 1 - i;
        sum -= h[j];
    }

    cout << sum << endl;
    
    return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>0;(i)--)
#define rrep(i,n,m) for(int (i)=(n);(i)<(m);(i)++)
#define rrepr(i,n,m) for(int (i)=(n);(i)>(m);(i)--)
#define SORT(s) sort((s).begin(),(s).end())
#define SORTR(s,t) sort((s).begin(),(s).end(),greater<t>())

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;

const int INF = 1000000000;
const ll LINF = 1000000000000000000ll;
const double PI = acos(-1.0);
const double EPS = 1e-10;

const ll MOD = 1000000007ll;
const int MAX=510000;

int N,M; vll A; priority_queue<ll> Q;
void input(){
    cin>>N>>M;
    rep(i,N){
        ll a; cin>>a; Q.emplace(a);
    }
    return;
}

void solve(){
    /*
        priority_queue の使用 
    */
    rep(i,M){
        ll tmp=Q.top();
        Q.pop();
        Q.emplace(tmp/2);
    }
    ll sum=0;
    rep(i,N) {sum+=Q.top();Q.pop();}
    cout<<sum<<endl;
    
    // SORT(A);
    // rep(i,M){
    //     ll tmp=A[N-1]/2;
    //     auto iter=lower_bound(A.begin(),A.end()-1,tmp);
    //     int d=distance(A.begin(),iter);
    //     for(int j=N-1;j>d;j--) A[j]=A[j-1];
    //     A[d]=tmp;
    // }
    // ll sum=0;
    // rep(i,N) sum+=A[i];
    // cout<<sum<<endl;
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 1400
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

using namespace std;

typedef long long ll;
typedef long double ld;

static const long long MOD = 1000000007;
static const long long INF = 1<<31;

int ans;
string s;

int main(void) {
    cin >> s;

    if (s=="ABC") puts("ARC");
    else puts("ABC");

    //cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3568
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
using namespace std;
int main(){
int a,b;
while(cin>>a>>b,a||b){
int co=0;
if(a<b)swap(a,b);
while(1){
if(b==0)break;
a=a%b;
swap(a,b);
co++;
}
cout<<a<<" "<<co<<endl;
}
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<queue>
#include<assert.h>
#include<tuple>
#include<string>
#include<algorithm>
#include<iostream>
#include<map>
#include<string.h>
#include<vector>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<ctype.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef tuple<int,int,int> t3;

const int MX = 100005;
const int MM = 1000000007;

vector<int> G[MX];
int A[MX];

ll dfs(int x, int p){
	ll tot = 0, mx = 0;
	if( G[x].size() == 1 ) return A[x];
	for(int c : G[x]){
		if( c == p ) continue;
		ll t = dfs(c, x);
		mx = max(mx, t);
		tot += t;
	}
	if( A[x]*2 < tot || A[x] > tot){
		printf("NO\n");
		exit(0);
	}
	if( tot-A[x] < mx - (A[x]*2-tot) ){
		printf("NO\n");
		exit(0);
	}
	return A[x]*2 - tot;
}

int main()
{
	int N, v = 0;
	scanf("%d", &N);
	for(int i = 1; i <= N; i++) scanf("%d", A+i);
	for(int i = 2; i <= N; i++){
		int a, b;
		scanf("%d%d", &a, &b);
		G[a].push_back(b);
		G[b].push_back(a);
	}
	for(int i = 1; i <= N; i++) if( G[i].size() >= 2 ) v = i;
	if( N == 2 ){
		printf("%s\n", A[1] == A[2] ? "YES":"NO");
	}
	else printf("%s\n", dfs(v, -1) ? "NO" : "YES");
}


Measured memory_bytes: 13184
import sys
from functools import lru_cache
inf = float('inf')

n, A, B, C, *l = map(int, sys.stdin.read().split())

@lru_cache(None)
def cost(a, b, c, cnt, i):
    if i == n:
        if not (a and b and c): return inf
        return abs(A - a) + abs(B - b) + abs(C - c) + 10 * (cnt - 3)
    return min(cost(a, b, c, cnt, i+1), 
               cost(a+l[i], b, c, cnt+1, i+1),
               cost(a, b+l[i], c, cnt+1, i+1),
               cost(a, b, c+l[i], cnt+1, i+1))

def main():
    print(cost(0, 0, 0, 0, 0))

if __name__ ==  '__main__':
    main()

Measured memory_bytes: 26556
/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#define int long long
#pragma comment("-Wl,--stack=1024000000")
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#define eprintf(...) 0
#else
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#endif
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){int ret=1;do{if(y&1)ret=(ll)ret*x%md;x=(ll)x*x%md;}while(y>>=1);return ret;}
int dp[100005];
int n,e,t;
int x[100005];
struct SGT{
	#define SIZE 131072
	int f[SIZE<<1],ql,qr;
	void modify(int x,int v){
		x+=SIZE;f[x]=v;
		while(x!=1){
			x>>=1;
			f[x]=min(f[x<<1],f[x<<1|1]);
		}
	}
	int _query(int L,int R,int k){
		if(R<ql||qr<L)return inf*inf;
		if(ql<=L&&R<=qr)return f[k];
		return min(_query(L,(L+R)/2,k<<1),_query((L+R)/2+1,R,k<<1|1));
	}
	int query(int l,int r){
		if(l>r)return inf*inf;
		ql=l;qr=r;return _query(0,SIZE-1,1);
	}
}T1,T2;
signed main(){
	cin>>n>>e>>t;
	for(int i=1;i<=n;i++)cin>>x[i];
	memset(dp,inf,sizeof dp);
	dp[0]=0;T1.modify(0,-x[1]*2);T2.modify(0,0);
	for(int i=1;i<=n;i++){
		/*
		for(int j=1;j<=i;j++){
			dp[i]=min(dp[i],dp[j-1]+x[j]-x[j-1]+max(3ll*(x[i]-x[j]),x[i]-x[j]+t));
		}*/
		int L=0,R=i+1;
		while(R-L>1){
			int mid=(L+R)/2;
			if(2ll*(x[i]-x[mid])>=t)L=mid;
			else R=mid;
		}
		//[0,L-1]
		dp[i]=min(dp[i],T1.query(0,L-1)+x[i]*3);
		//[L,i-1]
		dp[i]=min(dp[i],T2.query(L,i-1)+t+x[i]);
		T1.modify(i,dp[i]-x[i]-x[i+1]-x[i+1]); 
		T2.modify(i,dp[i]-x[i]);
	}
//	for(int i=1;i<=n;i++)cerr<<i<<" "<<dp[i]<<endl;
	cout<<dp[n]+e-x[n]<<endl;
	return 0;
}

Measured memory_bytes: 5504
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>func(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p;
}

int main() {
  string s;
  cin>>s;
  string t=s.substr(0,4)+" "+s.substr(4);
  cout<<t<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
int main(void){
    int n, k, i;
    long long sum_=0;
    scanf("%d %d", &n, &k);
    int h[n];
    for (i=0;i<n;i++){
        scanf("%d", &h[i]);
    }
    qsort(h, n, sizeof(int), compare_int);
    for (i=0;i<n-k;i++){
        sum_ = sum_ + h[i];
    }
    printf("%lld", sum_);
    return 0;
}

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

int main()
{
	string N;
	int A, B;

	cin >> N >> A >> B;

	int n[4] = {0}, nl = N.size(), ans = 0;

	for (int i = 0; i < nl; i++) {
		n[i] = N[i] - '0';
	}

	int M = atoi(N.c_str());

	for (int i = 1,k = 0; i <= M; i++,k = 0) {
		string m = to_string(i);

		int ml = m.size();
		for (int ii = 0; ii < ml; ii++) {
			k += m[ii]-'0';
		}
		if (k >= A && k <= B)ans += i;
	}

	cout << ans;

	return 0;
}

Measured memory_bytes: 256
let N =
    stdin.ReadLine()
    |> int
let A =
    stdin.ReadLine().Split()
    |> Array.map int

let rec logtwo count x =
    match x&&&1 with
    | 1 -> count
    | 0 -> logtwo (count+1) (x>>>1)

A
|> Array.map (logtwo 0)
|> Array.min
|> stdout.WriteLine

Measured memory_bytes: 28372
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")
tests = lambda: range(1, int_in() + 1)
case_out = lambda i, o: out("Case #{}: {}".format(i, o))


def solve(n, a):
    result = 0
    for i, item in enumerate(a):
        if (i + 1) % 2 == 1 and item % 2 == 1:
            result += 1
    return result


if __name__ == "__main__":
    n = int_in()
    a = arr_in()
    out(solve(n, a))

Measured memory_bytes: 61892
#include <bits/stdc++.h>
#define s second
#define f first
#define pb push_back
#define endl '\n'
using namespace std;


typedef long long ll;
typedef pair<int,int> pii;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MAX = 1e6 + 10;

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

	vector<bool> DP(MAX,0);

	int N, K;
	cin >> N >> K;

	vector<int> V(N);

	for(auto &x : V) cin >> x;

	for(int i = 0; i <= K; i++){
		if(DP[i]) continue;
		for(auto j : V) DP[i + j] = 1;
	}

	cout << (DP[K] ? "First" : "Second") << endl;

	return 0;
}


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

static const int MAX=100;
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;
static const int INF=(1<<21);

int n,M[MAX][MAX];

void dig(){
  int color[MAX],d[MAX];
  for(int i=0;i<n;i++){
    color[i]=WHITE;
    d[i]=INF;
  }


d[0]=0;
color[0]=GRAY;

int minc,u;
while(1){
  minc=INF;
  u=-1;
  for(int i=0;i<n;i++){
    if(color[i]!=BLACK&&minc>d[i]){
      minc=d[i];
      u=i;
    }
  }
if(u==-1) break;
  color[u]=BLACK;

  for(int v=0;v<n;v++){
    if(M[u][v]!=INF&&color[v]!=BLACK){
      if(d[v]>d[u]+M[u][v]){
        d[v]=d[u]+M[u][v];
        color[v]=GRAY;
      }
    }
  }
 }

 for(int i=0;i<n;i++){
   cout<<i<<" "<<(d[i]==INF?-1:d[i])<<endl;
 }
}
int main(){
  cin>>n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      M[i][j]=INF;
    }
  }

  int u,k,v,c;
  for(int i=0;i<n;i++){
    cin>>u>>k;
    for(int j=0;j<k;j++){
      cin>>v>>c;
      M[u][v]=c;
    }
  }

  dig();
  return 0;
}

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

using ll = long long int;
using P = std::pair<int, int>;

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

int main()
{
    int n;
    ll k;

    std::cin >> n >> k;

    std::vector<ll> a(n), f(n);

    rep(i, n)
            std::cin >>
        a[i];

    rep(i, n)
            std::cin >>
        f[i];

    std::sort(std::begin(a), std::end(a));
    std::sort(std::begin(f), std::end(f), std::greater<>());

    constexpr ll INF = 1e15;

    ll lb = -1, ub = INF;

    auto g = [](ll x) { return (x > 0) ? x : 0; };

    while (ub - lb > 1)
    {
        ll mid = (lb + ub) / 2;
        ll cnt = 0;
        rep(i, n)
        {
            cnt += g(a[i] - mid / f[i]);
        }
        std::cerr << mid << ' ' << cnt << std::endl;
        if (cnt <= k)
            ub = mid;
        else
            lb = mid;
    }

    std::cout << ub << std::endl;

    return 0;
}

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (s, t) = [e for e in lines[0].split(" ")]

    return (s, t)


def solve(s, t):


    return t + s


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

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

int main() {
	int R;
	char next[4];

	scanf("%d", &R);

	if (R < 1200) {
		strcpy(next, "ABC");
	}
	else if (R < 2800) {
		strcpy(next, "ARC");
	}
	else {
		strcpy(next, "AGC");
	}
	printf("%s", next);


	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long  a[300107],l[300109],r[300103],pos[300105];
long long ans=0;
stack <long long> st;
int n;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    //    pos[a[i]]=l[i]=r[i]=i;
    }
    //a[0]=a[n-1]=n-1;
    for(int i=1;i<=n;i++){
        while(!st.empty() && a[ st.top() ] >= a[i])
            st.pop();
        if(st.empty())
            l[i]=0;
        else
            l[i]=st.top();
        st.push(i);
    }
    while(!st.empty()){
        st.pop();
    }
    for(int i = n;i>=1;i--){
        while(!st.empty() && a[ st.top() ] >= a[i])
            st.pop();
        if(st.empty())
            r[i]=n+1;
        else
            r[i]=st.top();
        st.push(i);
    }
    for(int i=1;i<=n;i++)
        ans+=(r[i]-i)*(i-l[i])*a[i];
    cout<<ans;
    return 0;
}


Measured memory_bytes: 8448
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	
	public static void check(int[] attr, char[][] inputs){
		for(int i = 0; i < inputs.length; i++){
			for(int j = 0; j < inputs[i].length; j++){
				System.out.print(attr[inputs[i][j] - 'A']);
			}
			System.out.println();
		}
		System.out.println();
	}
	
	public static int dfs(int cur, int deep, int bit, int[] attr, ArrayList<Character> list, int max, char[][] inputs){
		if(cur >= deep){
			for(int i = 0; i < inputs.length; i++){
				for(int keta = inputs[i].length - 1; keta >= 0; keta--){
					if(keta != 0 && attr[inputs[i][keta] - 'A'] == 0){
						return 0;
					}else{
						break;
					}
				}
			}
			
			int keta_up = 0;
			for(int keta = 0; keta < max; keta++){
				int result = 0;
				
				for(int i = 0; i < inputs.length; i++){
					if(keta < inputs[i].length){
						result += attr[inputs[i][keta] - 'A'];
					}
				}
				
				if(inputs[inputs.length - 1].length <= keta){
					return 0;
				}else{
				
					result -= attr[inputs[inputs.length - 1][keta] - 'A'];
					result += keta_up;
				
					keta_up = result / 10;
					result %= 10;
				
					if(result != attr[inputs[inputs.length - 1][keta] - 'A']){
						return 0;
					}
				}
			}
			
			if(keta_up != 0){
				return 0;
			}
			//check(attr, inputs);
			//System.out.println(Arrays.toString(attr));
			
			return 1;
		}else{
			int count = 0;
			
			for(int number = 0; number < 10; number++){
				if((bit & (1 << number)) != 0){
					continue;
				}
				
				attr[list.get(cur) - 'A'] = number;
				count += dfs(cur + 1, deep, bit | (1 << number), attr, list, max, inputs);
			}
			
			return count;
		}
	}

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

		while (true) {
			final int n = sc.nextInt();
			
			if(n == 0){
				break;
			}
			
			TreeSet<Character> set = new TreeSet<Character>();
			
			char[][] inputs = new char[n][];
			int max = Integer.MIN_VALUE;
			
			for(int i = 0; i < n; i++){
				char[] input = sc.next().toCharArray();
				
				for(char c : input){
					set.add(c);
				}
				
				inputs[i] = new char[input.length];
				
				for(int j = 0; j < input.length; j++){
					inputs[i][j] = input[input.length - j - 1];
				}
				
				max = Math.max(max, input.length);
			}
			
			ArrayList<Character> list = new ArrayList<Character>(set);
			
			System.out.println(dfs(0, list.size(), 0, new int[26], list, max, inputs));
		}
	}

}

Measured memory_bytes: 22568
#include <bits/stdc++.h>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define REPR(i, n) for (int i = n-1; i >= 0; --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTG(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<n)
#define bit_check(bit, i) (bit>>i) & 1
#define setpre(n) fixed << setprecision(n)
#define ENDL cout << endl;
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VP = vector<PII>;
using VI = vector<int>;
using VVI = vector<VI>;
using Vll = vector<ll>;
using VVll = vector<Vll>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
const int INF = 1e9;
const ll mod = 1e9 + 7;

int POW(ll a, ll b, ll m)
{
    ll res = 1;
    while(b > 0)
    {
        if (b & 1) res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return (int)res;
}

int main() {
  string S;
  cin >> S;
  ll len = S.size();
  VVll dp(len, Vll(13, 0));
  REPR(i, len)
  {
    if (i == len - 1)
    {
        if (S.at(i) != '?')
        {
            REP(j, 13) if (S.at(i)-'0' == j) dp.at(i).at(j) = 1;
        }
        else REP(j, 10) dp.at(i).at(j) = 1;
        continue;
    }
    REP(j, 13)
    {
        if (S.at(i) == '?')
        {
            REP(s_i, 10)
            {
                dp.at(i).at(j) += dp.at(i+1).at((13 + j - ((s_i * POW(10, len-i-1, 13)) % 13)) % 13);
                dp.at(i).at(j) %= mod;
            }
        }
        else
        {
            dp.at(i).at(j) += dp.at(i+1).at((13 + j - (((S.at(i)-'0') * POW(10, len-i-1, 13)) % 13)) % 13);
            dp.at(i).at(j) %= mod;
        }
    }
  }
  cout << dp.at(0).at(5) << endl;

  return 0;
}

Measured memory_bytes: 13696
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <utility>
typedef long long ll;
const int INF = 1e9+1;
const int MOD = 2e9 + 9;
const ll LINF = 1e18;
using namespace std;
int main() {
	int s;
	int cnt = 0;
	cin >> s;
	vector<int> a(1000001);
	a.at(s) = 1;
	while (1) {
		if (s % 2 == 0) {
			s = s / 2;
			cnt++;
			if (a.at(s) == 1) {
				cout << cnt+1 << endl;
				return 0;
			}
			else {

				a.at(s) = 1;
			}
		}
		else {
			cnt++;
			s = 3 * s + 1;
			if (a.at(s) == 1) {
				cout << cnt+1 << endl;
				return 0;
			}
			else {
				a.at(s) = 1;
			}
		}
		
	}
	
	return 0;
}


Measured memory_bytes: 7220
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

const ll MOD = 1000000007;

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

	int h, w; cin >> h >> w;
	vector<vector<ll>> dp(h, vector<ll>(w, 0));


	string in, last;
	dp[0][0] = 1;
	for(int i = 0; i < h; i++) {
		cin >> in;
		for(int j = 0; j < w; j++) {
			if(j > 0 && in[j - 1] != '#') dp[i][j] += dp[i][j - 1];
			if(i > 0 && last[j] != '#') dp[i][j] += dp[i - 1][j];
			if(dp[i][j] >= MOD) dp[i][j] %= MOD;
		}
		last = in;
	}

	cout << dp[h - 1][w - 1] << endl;
}

Measured memory_bytes: 8064
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

t = [(x + l, x - l) for x, l in XL]
t.sort()
max_r = -float('inf')
result = 0
for i in range(N):
    r, l = t[i]
    if max_r <= l:
        result += 1
        max_r = r
print(result)

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

int main(){
    int a, b, c;
    char op;
    
    do{
        cin >> a >> op >> b;
        if(op=='+') {c=a+b;
        } else if(op=='-') {c=a-b;
        } else if(op=='*') {c=a*b;
        } else if(op=='/') {c=a/b;
        } else if(op=='?') {break;
        } else {break;}
        cout << c << endl;
    } while(op!='?');

    return 0;
}


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

int main() {
	string a, b, c;
	cin >> a >> b >> c;
	int aleft = a.size();
	int bleft = b.size();
	int cleft = c.size();
	int turn = 1;//    1 = a,2 = b,3 = c
	while(true){
		if(turn == 1){
			if(aleft == 0){
				cout << "A" << endl;
				return 0;
			}
			if(a.at(a.size() - aleft) == 'a'){
				turn = 1;
				aleft--;
			}
			else if(a.at(a.size()-aleft) == 'b'){
				turn = 2;
				aleft--;
			}
			else if(a.at(a.size()-aleft) == 'c'){
				turn = 3;
				aleft--;
			}
			else{
				cout << "error(unknown A card)" << endl;
				return 0;
			}
		}
		else if(turn == 2){
			if(bleft == 0){
				cout << "B" << endl;
				return 0;
			}
			if(b.at(b.size()-bleft) == 'a'){
				turn = 1;
				bleft--;
			}
			else if(b.at(b.size()-bleft) == 'b'){
				turn = 2;
				bleft--;
			}
			else if(b.at(b.size()-bleft) == 'c'){
				turn = 3;
				bleft--;
			}
			else{
				cout << "error(unknown B card)" << endl;
				return 0;
			}
		}
		else if(turn == 3){
			if(cleft == 0){
				cout << "C" << endl;
				return 0;
			}
			if(c.at(c.size()-cleft) == 'a'){
				turn = 1;
				cleft--;
			}
			else if(c.at(c.size()-cleft) == 'b'){
				turn = 2;
				cleft--;
			}
			else if(c.at(c.size()-cleft) == 'c'){
				turn = 3;
				cleft--;
			}
			else{
				cout << "error(unknown C card)" << endl;
				return 0;
			}
		}
		else{
			cout << "error(unknown turn)" << endl;
			return 0;
		}
	}
	cout << "error(loop is end)" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

// DAME:
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h, w;
    cin >> h >> w;
    ll ans = INF;
    // 上1つ下二つで分割と三つに分解
    for(int i=1; i<=h-1; i++){
        ll sa = i*w;
        ll sb = (w/2)*(h-i);
        ll sc = (w-(w/2))*(h-i);
        chmin(ans, abs(max({sa, sb, sc}) - min({sa, sb, sc})));
        sb = ((h-i)/2)*w;
        sc = ((h-i)-((h-i)/2))*w;
        chmin(ans, abs(max({sa, sb, sc}) - min({sa, sb, sc})));
    }
    swap(h, w);
    // 左一つ右二つで分割
    for(int i=1; i<=h-1; i++){
        ll sa = i*w;
        ll sb = (w/2)*(h-i);
        ll sc = (w-(w/2))*(h-i);
        chmin(ans, abs(max({sa, sb, sc}) - min({sa, sb, sc})));
        sb = ((h-i)/2)*w;
        sc = ((h-i)-((h-i)/2))*w;
        chmin(ans, abs(max({sa, sb, sc}) - min({sa, sb, sc})));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n=int(input())
stack=[0,0,0,0,0]
march=["M","A","R","C","H"]
for i in range(n):
  k=input()
  for j in range(5):
    if k[0]==march[j]:
      stack[j]+=1
      break
ans=0
for i in range(3):
  for j in range(i+1,4):
    for k in range(j+1,5):
      ans+=stack[i]*stack[j]*stack[k]
print(ans)

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

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF 1000000000 //
#define LINF (ll)4000000000000000000 //
#define MOD (ll)1000000007
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define PI 3.1415926535898
#define NP(v) next_permutation(v.begin(),v.end())

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

int main() {
    string a, b, c;
    cin >> a >> b >> c;
    cout << a[0] << b[1] << c[2] << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

ll power(ll x,ll n){
    if(n==0) return 1;
    ll res=power(x*x%mod,n/2);
    if(n&1) res=res*x%mod;
    return res;
}

int main(){
  int k;
  string s;
  cin>>k>>s;
  int n=s.size();
  ll a[n+k+1];
  a[0]=1;
  rep(i,1,n+k+1) a[i]=a[i-1]*i%mod;
  ll b[n+k+1];
  b[n+k]=power(a[n+k],1e9+5);
  for(int i=n+k-1;i>=0;i--) b[i]=b[i+1]*(i+1)%mod;
  //b[0]=1;
  //rep(i,1,n+k+1) b[i]=power(a[i],1e9+5);
  ll ans=0;
  rep(i,0,k+1){
    ans+=power(25,i)*a[n+k]%mod*b[i]%mod*b[n+k-i]%mod;
    ans%=mod;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 35536
#include<bits/stdc++.h>
using namespace std;
double dp[3000][3000];
int main()
{
    int n;
    double p[3001];
    cin >> n;
    for(int i=0;i<n;i++)
    {
        cin >> p[i];
    }
    dp[0][0]=1;

    for(int j=1;j<=n;j++)
    {
        dp[0][j]=dp[0][j-1]*(1-p[j-1]);
        for(int i=1;i<=j;i++)
        {
            dp[i][j]= dp[i-1][j-1]*(p[j-1])+dp[i][j-1]*(1-p[j-1]);
        }
    }
    double ans =0;
    for(int i=n/2+1;i<=n;i++)
    {
        ans+=dp[i][n];
    }
    cout << setprecision(9) <<  ans << endl;
    return 0;
}

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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> T(N);
    for(int i = 0; i < M; ++i) {
        int k; cin >> k;
        for(int j = 0; j < k; ++j) {
            int s; cin >> s;
            T[--s] |= 1 << i;
        }
    }
    int pmask = 0;
    for(int i = 0; i < M; ++i) {
        int p; cin >> p;
        if(p) pmask |= 1 << i;
    }
    int ans = 0;
    for(int mask = 0; mask < (1 << N); ++mask) {
        int lmask = 0;
        for(int i = 0; i < N; ++i) {
            if(mask & (1 << i)) lmask ^= T[i];
        }
        if(pmask == lmask) ++ans;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
  int n, i;
  scanf("%d", &n);
  int sum = 0;
  int re = n;
  for (i = 0;; i++) {
    if (n > 0) {
      sum += n % 10;
      n /= 10;
    } else {
      break;
    }
  }
  if (re % sum == 0) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 7;
int a[N];
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> a[i];

    if (a[0]) {
        cout << "-1\n";
        exit(0);
    }   
    for (int i = 1; i < n; ++i) {
        if (a[i] > a[i - 1] + 1) {
            cout << "-1\n";
            exit(0);
        }   
    }   

    int ans = 0;
    set <int> ms;
    int sh = 0;
    for (int i = n - 1; i >= 0; --i) {
        --sh;
        while (ms.size() && *ms.begin() + sh == 0) ms.erase(ms.begin());
        if (a[i]) ms.insert(a[i] - sh);
        ans += ms.size();
        #ifdef HOME
        cout << i << " : ";
        for (auto e : ms) cout << e << ' ';
        cout << '\n';
        #endif
    }   
    cout << ans << '\n';
}  


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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) (a).begin(),(a).end()

const double pi = acos(-1.0);

int main(){
    double a,b,the;
    cin >> a >> b >> the;
    the *= pi / 180;

    double c,s,l,h;
    c = sqrt(a*a + b*b - 2*a*b*cos(the));
    s = 0.5*a*b*sin(the);
    h = b*sin(the);
    l = a + b + c;

    printf("%.9f\n%.9f\n%.9f\n", s, l, h);
    return 0;
}


Measured memory_bytes: 3652
import numpy as np

def main():
    A, B, C, K = map(int, input().split())
    if K == 0:
        print(A-B)
        return
    base = np.matrix([[0, 1, 1], [1, 0, 1], [1 ,1 ,0]])
    X = base ** K
    result = np.matrix([[A, B, C]]) \
        .dot(X) \
        .dot(np.matrix([[1], [-1], [0]]))
    ans = result[0, 0]
    if ans > 10**18:
        print("Unfair")
    else:
        print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 12484
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
#define rep(i,n) for (int i=0; i<n;++i)
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
int N;
ll A[200005];
ll SUM[200005];

int main() {
  INCANT;
  cin >> N;
  rep(i, N) cin >> A[i];
  SUM[N-1] = 0ll;
  for (int i=N-2; i>=0; i--) {
    SUM[i] = SUM[i+1]+A[i+1];
    SUM[i]%=MOD;
  }
  ll ans = 0ll;
  rep(i, N-1) {
    ans+=SUM[i]*A[i];
    ans%=MOD;
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 6772
#include "bits/stdc++.h"

typedef long long ll;
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<pair<int, int>> xys[15];
    for (int i = 0; i < n; ++i) {
        xys[i] = vector<pair<int, int>>();
        int a;
        cin >> a;
        for (int j = 0; j < a; ++j) {
            int x, y;
            cin >> x >> y;
            xys[i].emplace_back(x - 1, y);
        }
    }
    int ans = 0;
    for (int bit = 0; bit < (1 << n); ++bit) {
        bool ok = true;
        for (int i = 0; i < n; ++i) {
            int j;
            for (j = 0; j < xys[i].size(); ++j) {
                if (!(bit & 1 << i)) continue;
                if (bit & 1 << i) {
                    if ((bit & (1 << xys[i][j].first)) != xys[i][j].second << (xys[i][j].first)) ok = false;
                }
            }
        }
        if (ok) {
            int honest = 0;
            int tmp = bit;
            while (tmp > 0) {
                if (tmp & 1) honest++;
                tmp >>= 1;
            }
            ans = max(honest, ans);
        }
    }

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int  main()
{
int x,m,n,i,j,cnt=0;
cin>>n>>m;
vector<pair<int,int>> h;
for(i=0;i<n;i++)
{
cin>>x;
h.push_back(make_pair(x,1));
}
//for(i=0;i<n;i++)
//cout<<h[i].first<<" "<<h[i].second<<"  ";
int a,b;
for(i=0;i<m;i++)
{
cin>>a>>b;
if(h[a-1].first>h[b-1].first)
h[b-1].second=0;
else if(h[a-1].first<h[b-1].first)
h[a-1].second=0;
else
{
h[a-1].second=0;
h[b-1].second=0;
}
}
for(i=0;i<n;i++)
{
if(h[i].second==1)
cnt++;
}
cout<<cnt;
return 0;
}

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


namespace AtCoderTemplate
{
    public class App
    {
        public static void Main(string[] args)
        {
            int a,b;
            {
                var tmp = Console.ReadLine().Split(' ')
                .Select(i=>int.Parse(i)).ToArray();
                a = tmp[0];
                b = tmp[1];
            }
            Console.WriteLine(Enumerable.Range(1,b-a).Aggregate((p,v)=>p+v)-b);
        }
}
}

Measured memory_bytes: 13396
#include<bits/stdc++.h>
#define ll long long int

using namespace std;
const ll N=100010;

int main()
{
    ll k,x;
    cin>>k>>x;
    vector<ll> ans;
    ans.push_back(x);
    for(ll i=1;i<k;++i)
    {
        if(x-i>=-1*1000000)
        {
            ans.push_back(x-i);
        }
        if(x+i<=1000000)
        {
            ans.push_back(x+i);
        }
    }
    sort(ans.begin(),ans.end());
    for(ll i=0;i<ans.size();++i)
    {
        cout<<ans[i]<< " ";
    }


    return (0);
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int count = 0;
		for(int i = a; i <= b; i++){
			if(c % i == 0){
				count++;
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 26304
#include <bits/stdc++.h>
using namespace std;
#define LL long long
LL A, B;
int main()
{
    cin >> A >> B;
    if (A == B) return puts("1"), 0;
    int s, t = -1;
    for (int i = 60; ~i; -- i)
        if (((1ll << i) & A) != ((1ll << i) & B))
        {
            s = i; break;
        }
    for (int i = s - 1; ~i; -- i)
        if ((1ll << i) & B)
        {
            t = i; break;
        }
    LL L1 = ((1ll << (s + 1)) - 1) & A, R1 = (1ll << s) | ((1ll << (t + 1)) - 1);
    LL L2 = (1ll << s) | (((1ll << (s + 1)) - 1) & A), R2 = ((1ll << (s + 1)) - 1);

    if (L2 <= R1) cout << R2 - L1 + 1;
    else cout << R2 - L2 + 1 + R1 - L1 + 1;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<string,int>;
const double PI = acos(-1);

int main() {
string s;
cin >> s;
string t = "CODEFESTIVAL2016";
int cnt  = 0;
rep(i,s.size())if(s.at(i)!=t.at(i)) cnt++;
  cout << cnt << endl;
}


Measured memory_bytes: 3652
#include<iostream>
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define vi vector<int>
#define lvi vector<long long>
#define pi pair<int,int>
#define lpi pair<long long ,long long>
#define mp make_pair
#define pb push_back
#define ll long long 
#define N 100005
#define faltu ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod 1000000007
#define mod1 1000000000000000007
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>multiordered_set;
ll int pw(ll int a, ll int b,ll md) {
    if (b == 0) return 1;
    ll int t = pw(a, b / 2,md);
    if (b % 2 == 0) return (t * t)%mod;
    else return ((t * t)%mod * a)%mod;
}
vector<int> pm;
void prm(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
              prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p]) pm.push_back(p);
}
bool cmp(const pair<ll int,ll int> &a,const pair<ll int,ll int> &b)
{
    if(a.first==b.first)return a.second<b.second;
    return a.first<b.first;
}
ll int gcd(ll int a,ll int b)
{
    if(!a)return b;
    return gcd(b%a,a);
}
bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    for (int i = 2; i < n; i++) 
        if (n % i == 0) 
            return false; 
    return true; 
} 
map<int,int>pa;
int find(int i){
    if(pa[i]==i)return i;
    return pa[i]=find(pa[i]);
}     
void join(int i,int j){
    int a=find(i);
    int b=find(j);
    if(b>=a)pa[b]=a;
    else pa[a]=b;
}               
int ddx[]={-1,-1,-1,0,1,1,1,0};
int ddy[]={-1,0,1,1,1,0,-1,-1};
int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};
int n,m;
ll p[N],h[N],x[N],y[N];
vector<int>ed[N];
int main()
{
    faltu;
    int t=1;
   // cin>>t;
    while(t--)
    {
        int n,cnt=0,ans=0;
        cin>>n;
        string s;
        cin>>s;
        for(int i=0;i<n;i++)if(s[i]=='W')cnt++;
        for(int i=n-1;i>=0&&cnt>0;i--)
        {
            if(s[i]=='R')ans++;
            cnt--;
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 6116
#include<stdio.h>
#define N 100
#define LINK 1
#define NOT_LINK -1
#define WHITE 2
#define GRAY 3
#define BLACK 4

void enqueue(int);
int dequeue(void);
void BFS(int); //幅優先探索

int head = 0;
int tail = 0;
int q[N]; //キュー
int d[N+1]; //始点から各頂点iまでの距離
int m[N+1][N+1]; //頂点iから頂点jに辺があるかないか
int n; //頂点の数

int main(){
  int u, k, v; //uは頂点, kはuの出次数, kはuに隣接する頂点
  int i, j;

  //初期化
  for(i=0;i<N;i++){
    for(j=0;j<N;j++){
      m[i][j] = NOT_LINK;
    }
  }

  //入力
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d %d", &u, &k);
    for(j=0;j<k;j++){
      scanf("%d", &v);
      m[u][v] = LINK;
    }
  }

  //幅優先探索開始、始点は1
  BFS(1);

  //出力
  for(i=1;i<=n;i++) printf("%d %d\n", i, d[i]);
    
  return 0;
}

void enqueue(int x){
  q[tail] = x;
  if(tail == N-1) tail = 0;
  else tail++;
}

int dequeue(void){
  int x;
  x = q[head];
  if(head == N-1) head = 0;
  else head++;
  return x;
}

void BFS(int s){
  int color[N+1];
  int u, v;
  int i;

  //初期化
  for(i=1;i<=n;i++){
    color[i] = WHITE;
    d[i] = NOT_LINK;
  }

  //始点の設定
  color[s] = GRAY;
  d[s] = 0;
  enqueue(s);

  while(head != tail){
    u = dequeue(); //uの訪問を完了させる
    for(v=1;v<=n;v++){
      //u -> v　かつ vが未訪問
      if(m[u][v] == LINK && color[v] == WHITE){
	color[v] = GRAY;
	d[v] = d[u] + 1;
	enqueue(v);
      }
    }
    color[u] = BLACK;
  }
  
}



Measured memory_bytes: 2108
dp = [0]*55556
dp[0] = 1
dp[1] = 1
prime = []
for i in range(55556):
    if dp[i] == 0:
        prime.append(i)
        for j in range(i, 55556, i):
            dp[j] = 1
Enable = []
for i in prime:
    if i % 5 == 1:
        Enable.append(i)
N = int(input())
for i in Enable[:N]:
    print(i, end=" ")

Measured memory_bytes: 68024
#include<iostream>
using namespace std;
int main(){
    int ans=0;
    string s;
    cin>>s;
    for(int i=0;i<(s.size()+1)/2;i++){
        ans+=(s[i]!=s[s.size()-i-1]);
    }
    cout<<ans<<endl;
    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll mod=1e9+7;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    ll prefix[n+1];
    prefix[n]=0;
    for(int i=n-1;i>=0;i--)
    {
        prefix[i]=prefix[i+1]+a[i];
    }
    ll sum=0;
    for(int i=0;i<n-1;i++)
    {
        ll res=((a[i]%mod)*(prefix[i+1]%mod))%mod;
        sum=((sum%mod)+(res%mod))%mod;
    }
    
    cout<<sum<<'\n';
    
    
    return 0;
}

Measured memory_bytes: 6776
S = input()
N = len(S)
children = [1]*N

for i in range(N-1):
    if S[i] == "R":
        if S[i+1] == "R":
            children[i+2] += children[i]
            children[i] = 0
for i in range(1,N):
    if S[-i] == "L":
        if S[-i-1] == "L":
            children[-i-2] += children[-i]
            children[-i] = 0

children = [str(_) for _ in children]
print(" ".join(children))

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

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

    vector<int> v(n), c(n);
    rep (i, n)
        cin >> v[i];
    rep (i, n)
        cin >> c[i];

    int ans = 0;
    rep (i, n)
        ans += max(v[i] - c[i], 0);

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

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  int p = 0, i;
  char s[4];
  
  for(i = 0 ; i < 4 ; i++)
  {
    scanf("%c", &s[i]);
    if(s[i] == '+')
      p += 1;
    else
      p -= 1;
  }
  
  printf("%d", p);
  
  return 0;
}

Measured memory_bytes: 128
unittest
{
	assert( [ "3", "2 3 1" ].parse.expand.solve == "3 1 2" );
	assert( [ "5", "1 2 3 4 5" ].parse.expand.solve == "1 2 3 4 5" );
	assert( [ "8", "8 2 7 3 4 5 6 1" ].parse.expand.solve == "8 2 4 5 6 7 3 1" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( as );
}

auto solve( long[] as )
{
	return zip( as, iota( 1L , as.length.signed + 1 ) ).array.sort().map!( ( a ) => a[ 1 ].to!( string ) ).join( " " );
}


Measured memory_bytes: 9196
#include <stdio.h>
int main(void){
  int n,b,f,r,v,m[4][3][10]={};
  scanf("%d",&n);
  while(n-->0){
    scanf(" %d%d%d%d",&b,&f,&r,&v);
    m[b-1][f-1][r-1]+=v;
  }
  for(b=0;b<4;b++){
    for(f=0;f<3;f++){
      for(r=0;r<10;r++)printf(" %d",m[b][f][r]);
      puts("");
    }
    if(b!=3)printf("####################\n");
  }
  return 0;
}

Measured memory_bytes: 608