akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a,b,c;
	scanf("%lld%lld%lld",&a,&b,&c);
	if (a+b+1>=c) printf("%lld\n",b+c);
	else printf("%lld\n",b+(a+b+1));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int A,B,C,D,E,F,G,H,T,S1,S2;
	cin >> A>>B>>C>>D>>E>>F;
	A *=100;B *=100;
	for(int i=0;i<=30&&i*A<=F;i++){
	 for(int j=0;j<=30&&i*A+j*B<=F;j++){
	 if(i+j){
	   G = i*A+j*B;H=min(G*E/100,F-G);T=0;
	   for(int k=0;k<=3000&&C*k<=H;k++)for(int l=0;l<=3000&&C*k+D*l<=H;l++)T=max(T,C*k+D*l);
	   if(S1==0||T*(S1+S2)>S2*(G+T)){S1=G;S2=T;}
	 }
		}
	}
cout << S1+S2 << " "<<S2<< endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a+b<10){
		printf("%d\n",a+b);
	}else{
		printf("error\n");
	}
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <iomanip>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
#define fcout cout<<fixed<<setprecision(10)
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
//template<typename T>void pp(T x){cout<<x<<endl;}

using namespace std;

int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<char>> v(h,vector<char>(w));
    rep(i,0,h)rep(j,0,w)cin>>v[i][j];

    int ans=INF;
    rep(i,0,h-2){
        for(int j=i+1;i+(j-i)<h-1;j++){
            int anss=0;
            rep(k,0,h){
                rep(l,0,w){
                    if(k<=i){
                        if(v[k][l]!='W')anss++;
                    }else if(k<=j){
                        if(v[k][l]!='B')anss++;
                    }else if(v[k][l]!='R')anss++;
                }
            }
            ans=min(ans,anss);
        }
    }
    cout<<ans<<endl;

    
    return 0;
}


Measured memory_bytes: 3156
#include<stdio.h>
int main(){
  int H,W,h,w;
  scanf("%d%d%d%d",&H,&W,&h,&w);
  if(H%h||W%w){
    puts("Yes");
    for(int i=1;i<=H;++i,puts("")) for(int j=1;j<=W;++j)
      if(i%h||j%w) printf("1000 ");
      else printf("%d ", -1000*(h*w-1)-1);
  }else puts("No");
  return 0;
}

Measured memory_bytes: 1536
import sys
sys.setrecursionlimit(10**6)
from functools import lru_cache

@lru_cache(maxsize=None)
def solve(val , now):
    if val < 6 or now == 0:
        ret_val = val
    # 何もしない
    elif val < counts[now]:
        ret_val = solve(val , now - 1)
    # 何もしない or 手を加えるの小さい方
    else:
        ret_val = min(solve(val , now - 1) , solve(val - counts[now] , now) + 1)
    return ret_val

N = int(input())
coins = [1,6,9]
counts = [1]
for i in range(1,3):
    for j in range(1,N):
        if coins[i] ** j <= N:
            counts.append(coins[i] ** j)
        else:
            break
#print(counts)
print(solve(N , len(counts) - 1))

Measured memory_bytes: 71176
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define eb emplace_back
#define precision(n) cout << fixed << setprecision(n);
#define fast {ios_base::sync_with_stdio(false);cin.tie(NULL);}
int main()
{
    fast;
    string s;
    cin>>s;
    int f=0;
    for(int i=0;i<s.size();i++)
    {
        if(s[2]==s[3]&&s[4]==s[5])
        {
            f=1;
        }
    }
    if(f)
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main()
{
    
    int n,temp,s,w,a,b,c,d;
    map<string,int> hash;
    string tt;
    //vector<string> tool;
    vector<int> all;
    int ans=0;
    cin>>n;
    for(int i = 1;i<=n;i++)
    {
        cin>>tt;
        hash[tt]++;
        if(hash[tt]==1)
            ans++;
    }

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


Measured memory_bytes: 19256
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	
    public static void main(String[] args) {

        int layerNum = 0;
		Set<Integer> mochiSizeSet = new HashSet<>();
		Scanner scan = new Scanner(System.in);
		int mochiNum = scan.nextInt();
        for (int i = 0; i < mochiNum; i++) {
			mochiSizeSet.add(scan.nextInt());
        }
        System.out.print(mochiSizeSet.size());
    }
}


Measured memory_bytes: 23124
lap, num = gets.split(" ").map(&:to_i)
arr = gets.split(" ").map(&:to_i)

length = []
index = 0
(num-1).times do
    length.push((arr[index] - arr[index+1]).abs)
    index += 1
end
length.push(arr[0] + (lap - arr[-1]))

max_index = length.index(length.max)
length.delete_at(max_index)

sum = 0
length.each { |i| sum += i }
puts sum


Measured memory_bytes: 17028
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int k, n, temp;
    map<int, int> count;

    cin >> n >> k;

    for(int i = 0; i < n; i++){
        cin >> temp;
        count[temp]++;
    }

    vector<int> vec;
    for(auto i = count.begin(); i != count.end(); i++){
        vec.push_back(i->second);
    }

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

    int sum = 0;

    //cout << vec.size() << " " << k << " " << int(vec.size() - k) << endl;

    for(int i = 0; i < int(vec.size() - k); ++i){
        sum += vec[i];
    }

    cout << sum << endl;

    return 0;
}


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

using namespace std;

#define EPS 1e-10

int gcd(int x,int y) {
  return y?gcd(y,x%y):x;
}

int main(){
  string s,t; cin >> s;
  int dot,bope=-1;
  for(int i=0;i<s.size();++i) {
    if(s[i]=='(') bope=i;
    else {
      if(s[i]!=')') t+=s[i];
      if(s[i]=='.') dot=i;
    }
  }
  double d=stod(t);
  int a,b;
  int sz=t.size();
  if(bope!=-1) {
    int n=pow(10,bope-dot-1);
    int nn=pow(10,sz-dot-1);
    int x=d*n+EPS;
    int nx=d*nn+EPS;
    a=nn-n,b=nx-x;
  } else {
    int nn=pow(10,sz-dot-1);
    int nx=d*nn+EPS;
    a=nn,b=nx;
  }
  int co=gcd(a,b);
  cout << b/co << "/" << a/co << endl;
	      
  return 0;
}



Measured memory_bytes: 3400
#include<iostream>
#include<set>

using namespace std;

typedef long long ll;

ll P[100000];
ll pos[100000];

int main() {
	int N;
	cin >> N;
	for (int i = 0; i < N; i++)cin >> P[i], pos[P[i] - 1] = i;

	ll ans = 0;
	
	set<ll> S;
	
	for (ll i = N - 1; i >= 0; i--) {
		ll c = 0;

		S.insert(pos[i]);
		auto it = S.find(pos[i]);
		ll b1 = -1, b2 = -1, a1 = N, a2 = N;
		//b2 b1 it a1 a2
		if (it != S.begin()) {
			--it;
			b1 = (*it);
			if (it != S.begin()) {
				--it;
				b2 = (*it);
				it++;
			}
			it++;
		}
		auto befend = S.end(); befend--;
		if (it != befend) {
			++it;
			a1 = (*it);
			if (it != befend) {
				++it;
				a2 = (*it);
				it--;
			}
			it--;
		}

		c += (pos[i] - b1) * (a2 - a1);
		c += (a1 - pos[i]) * (b1 - b2);

		ans += c * (i + 1);
	}

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

Measured memory_bytes: 6528
#include<bits/stdc++.h>                                                                          
using namespace std;
int main()
{
  int a ,b;
  cin >> a >> b;
  int c,d,e;
  c=a+b;
  d=a-b;
  e=a*b;
  int max=c;
  if(d>max)
    max=d;
  if(e>max)
    max=e;
  cout << max << endl;
}


Measured memory_bytes: 384
#include<cstdio>
#include<iostream>
#include<cstring>
#define RG register
using namespace std;
int a,b;
template<typename I> inline void read(I &ot){
	I ch=getchar(), x=0, f=1;
	while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar();	}
	while(ch>='0' && ch<='9'){x=x*10+ch-'0'; ch=getchar();	}
	ot=x*f;}
template<typename I, typename... U> inline void read(I &x,U&... y){read(x); read(y...);}
int main()
{
	//freopen("Discount Fare.in","r",stdin);
	//freopen(".out","w",stdout);
	read(a,b);
	printf("%d",a+b/2);
	//fclose(stdin); fclose(stdout);
	return 0;
}


Measured memory_bytes: 256
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


mod=1000000007
def combinations_count_mod(n, r):
    r = min(r, n - r)
    numer = reduce(lambda x,y: x*y%mod, range(n, n - r, -1), 1)
    denom = pow( reduce(lambda x,y: x*y%mod, range(1, r + 1), 1) , mod-2, mod)
    return numer * denom % mod


def solve(n, s):
    #
    cnt=0
    doneflag=0
    l=0
    r=n-1    

    #
    sameflag=0
    for x in s:
        sameflag *=( x=='R' )
    for x in s:
        sameflag *= ( x=='W')
    if sameflag!=0:
        return 0

    #
    w_cnt=0
    for i in range(n):
        if s[i]=='W':
            w_cnt+=1
            

    ##
    for r in range(0,n)[::-1]:
        #
        if s[r] == 'R':
            for l in range(l,n):
                if s[l]=='W':
                    cnt+=1
                    w_cnt-=1
                    l+=1
                    eprint('r,l, w_cnt ',end=':\n')
                    eprint(r,l, w_cnt)
                    break
        else: # s[r] == 'W'
            w_cnt-=1

        #
        if l>=r or w_cnt==0:
            eprint('r,l, w_cnt ',end=':\n')
            eprint(r,l, w_cnt)
            return cnt       
    return cnt
    
    

def main():
    n = int(input().strip())
    S = input().strip()
    print(solve(n,S))


if __name__ == '__main__':
    main()

Measured memory_bytes: 86152
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
int a[200005];
int main()
{
    ios::sync_with_stdio(false);
    ll n,k;cin>>n>>k;
    for(ll i=1;i<=200001;i++)
        a[i]=(a[i-1]+i)%mod;
    ll sum=0;
    for(ll i=k-1;i<=n;i++)
        sum=(sum+a[n]-a[i]-(i==n?0:a[n-i-1])+1)%mod;
    while(sum<0) sum+=mod;
    cout<<sum<<endl;
}


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

int a, b, h, m;

int main() {
	cin >> a >> b >> h >> m;
	cout << fixed << setprecision(9);
	cout
			<< sqrt(
					a * a + b * b
							- 2 * a * b
									* cos(
											2 * acos(-1) * (60 * h - 11 * m)
													/ 720)) << endl;
}


Measured memory_bytes: 4192
#include <stdio.h>
int main(void){
	int n;
	int i;
	char s[101];
	int r = 0;
	int b = 0;
	scanf("%d",&n);
	scanf("%s",s);
	for(i=0;i<n;i++){
		if(s[i] =='R'){
			r++;
		}else{
			b++;
		}
	}
	if( r > b ){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}

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

# print(N)

ans = N
i = 1
while i * i <= N:
    # print(i)
    
    div, mod = divmod(N, i)
    
    if mod == 0:
        # print(i)
        # print(div)
        # print(mod)
        
        ans = min(ans, ((i - 1) + (div - 1)))
    
    i += 1
    
print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define rev(a) (a).rbegin(),(a).rend()
#define pll pair<ll,ll>
#define rep(i,a,b) for(long long i = (a); i <= (b); i++)
ll modi = 1000000007;

bool cp(ll n){
    if(n == 1)return false;
    else if(n == 2)return true;
    else if(n ==3)return true;
    for(int i  = 2; i*i<=n; i++){
        if(n%i == 0){
            return false;
        }
    }
    return true;
}
void SforPrime(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;
		}
	}
}
ll calPower(ll val, ll n){
    ll i = 1;
    ll ind = 1;
    ll prev = val;
    while(val<=n){
        if(n%val == 0)ind = i;
        val  = val*prev;
        i++;
    }
    return i-1;
}
int main(){
    //130016239756757
    ll arr[3];
    cin>>arr[0]>>arr[1]>>arr[2];
    sort(arr, arr+3);
    if(arr[0] == 5 && arr[1] == 5 && arr[2] == 7){
      cout<<"YES"<<endl;
    }else cout<<"NO"<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <ostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using ll = long long;
using ld = long double;
//typedef long long ll;

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

#define INF ((1LL << 31) - 1)
#define INFLL ((1LL << 62) - 1)
#define MOD (ll)(1e9+7)
#define EPS 1e-10
#define repi(i,j,n) for(int i = (j); i < (n); ++i)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define P "Yes"
#define NP "No"

template <typename T>
std::ostream& operator << (std::ostream& os, std::vector<T> v) {
  os << "[";
  for (int i = 0; i < int(v.size()); ++i) {
    cout << v[i] << (i == v.size() - 1 ? "]" : ", ");
  }
  return os;
}

int vx[4] = { -1, 0, 1, 0 }, vy[4] = { 0, -1, 0, 1 };
//int vx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, vy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};

// [sx, se), [sy, ey)であることに注意
inline bool check(int sx, int ex, int sy, int ey, int x, int y) {
  return (sx <= x and x < ex and sy <= y and y < ey);
}

inline bool check(int ex, int ey, int x, int y) {
  return check(0, ex, 0, ey, x, y);
}

inline void init() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
}

void solve() {
  int a, b, c, n;
  std::string s, t;
  std::vector<int> x;

  cin >> n >> a;

  n %= 500;

  if (n <= a) {
    cout << P << endl;
  }
  else {
    cout << NP << endl;
  }
  return;
}

int main() {

  solve();

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    string s; cin >> s;
    int sl = s.size();

    bool ans = true;
    REP(i,sl/2) {
        if (s[i] != s[sl-1-i]) {
            ans = false;
            break;
        }
    }

    REP(i,sl/2) {
        if (s[i] != s[i + sl/2+1]) {
            ans = false;
            break;
        }
    }

    ATYN(ans)

    return 0;
}

Measured memory_bytes: 256
N,A,B,C,D = map(int,input().split())
S = str(input())
ans = "Yes"

S0 = S[:A]
Sa = S[A-1:C]
Sb = S[B-2:D+1]
F = max(C,D)
S1 = S[F:]
#if S0.rfind('##')>=0 and S1.find('##')>=0 :
#    Sfe = S[S0.rfind('##'):(F+S1.find('##'))]
#elif S0.rfind('##')>=0 :
#    Sfe = S[S0.rfind('##'):]
#elif S1.find('##')>=0 :
#    Sfe = S[:(F+S1.find('##'))]
#else :
#    Sfe = S


#if S.find('##')>=0 and A<S.find('ABC')<C or B<S.find('ABC')<D:
if Sa.find('##')>=0 or Sb.find('##')>=0:
    ans = "No"

if A<B<D<C and not '...' in Sb:
    ans = "No"

print(ans)


Measured memory_bytes: 3572
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long int ll;
ll lim[1009];
int main()
{
    ll n;
    cin>>n;
    ll cnt=0,ans=0;
    for( int i=1;i<=1000;i++) lim[i]=(i*(i+1))/2;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {   cnt=0;
            while(n%i==0) {n=n/i; cnt++;}
            ans+=upper_bound(lim+1,lim+1000,cnt)-lim-1;
        }
      
    }
    if(n!=1) ans++;
    cout<<ans;
}


Measured memory_bytes: 3624
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<queue>
using namespace std;
int color[100050];
int cnt;
vector<int> G[100050];
#define WHITE 0
#define GRAY 1
#define BLACK 2

class UnionFind{
 public:
  //親の番号を格納する。親だった場合は-(その集合のサイズ）
  vector<int> Parent;
  
  //作るときはParentの値を全て-1になる
  //こうするとすべてバラバラになる。
  UnionFind(int N){
   Parent = vector<int>(N+1,-1);
  }

  int root(int A){
   if(Parent[A] <0)return A;
   return Parent[A]=root(Parent[A]);
  }

  int size(int A){
   return - Parent[root(A)];//親をとっていきたい
  }

  //AとBをくっ付ける
  int connect(int A, int B){
   //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
   A = root(A);
   B = root(B);
   if(A==B){
    return false;
   }
   //大きい方（A)に小さいほう（B)をくっ付けたい
   //大小が逆だったらひっくり返す。
   if(size(A) <size(B))swap(A,B);

   //Aのサイズを更新する。
   Parent[A] +=Parent[B];
   //Bの親をAに変更する
   Parent[B]=A;
   return true;
  }
};

int main(void){
 int N,M;
 cin>>N>>M;
 vector<int> A(M),B(M);
 for(int i=0; i<M; i++){
  cin>>A[i]>>B[i];
  A[i];
  B[i];
 }

 vector<long long int > ans(M);
 ans[M-1]=(long long int)N*(N-1)/2;
 
 UnionFind Uni(N);
 for(int i=M-1; i>=1; i--){
  ans[i-1]=ans[i];
  if(Uni.root(A[i]) !=Uni.root(B[i])){
   ans[i-1]-=(long long int)Uni.size(A[i])*Uni.size(B[i]);
   Uni.connect(A[i],B[i]);
  }
 }

 for(int i=0; i<M; i++)cout<<ans[i]<<endl;

 return 0;
}

Measured memory_bytes: 5632
#include <iostream>
#include<math.h>

using namespace std;


int main() {

    long long D, N;

    cin >> D >> N;

    //
    if (N == 100) {
        cout <<  (N + 1) * (int)pow(100 , D) << endl;
        return 0;
    }

    cout <<  N * (int)pow(100 , D) << endl;


//
//    //
//    if( N != 100 )
//    {
//        cout << ((int)pow(100,D)) * N << endl;
//    }
//    else
//    {
//        cout << (N + 1) * ((int)pow(100,D)) << endl;
//
//    }


    return 0;
}


Measured memory_bytes: 256
def main():
    num = int(input())
    data = []
    if num % 2 == 0:
        for i in range(num // 2):
            data.append([i + 1, num - i])
    else:
        for i in range((num - 1) // 2):
            data.append([i + 1, num - 1 - i])
        data.append([num])

    ans = []
    for i in range(len(data) - 1):
        for from_num in data[i]:
            for j in range(i+1, len(data)):
                for to_num in data[j]:
                    ans.append([from_num, to_num])

    print(len(ans))
    for ans_data in ans:
        print(ans_data[0], ans_data[1])


if __name__ == '__main__':
    main()

Measured memory_bytes: 4128
int main() {
    int a=0,b=0,c=0,d=0,e=0,k=0;
    scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&k);
    if (e-a>k) {
        printf(":(\n");
    }
    else {
        printf("Yay!\n");
    }
    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
int main(void)
{
	int a,b,c,x,y,i;
	scanf("%d %d %d",&a,&b,&c);
	
	for(i=a;i<=b;i++){
		if(c%i==0){
			x++;
		}
	}
	
	printf("%d\n",x);
	return 0;
}

Measured memory_bytes: 1028
#include<bits/stdc++.h>
#define ll long long
#define llu unsigned long long

int take() {
    int n;
    scanf("%d",&n);
    return n;

}
double ttake() {
    double n;
    scanf("%lf",&n);
    return n;
}
ll takes() {
    ll n;
    scanf("%lld",&n);
    return n;

}

#define Int take()
#define Dnt ttake()
#define LL takes()
#define done {return 0;}
#define fr(n) for(int i=1;i<=n;i++)
#define FR(a,b,x) for(int i=(a);i<=(b);i+=(x))
#define rfr(n) for(int i=n;i>=1;i--)
int cas;
#define print printf("Case %d:",++cas)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define pii pair<int,int>
#define vii vector<pii>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define mk  make_pair
#define fill(x,v) memset(x,v,sizeof x)

using namespace std;

bool approximatelyEqual(float a, float b, float epsilon) {
    return fabs(a - b) <= ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool essentiallyEqual(float a, float b, float epsilon) {
    return fabs(a - b) <= ( (fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool definitelyGreaterThan(float a, float b, float epsilon) {
    return (a - b) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool definitelyLessThan(float a, float b, float epsilon) {
    return (b - a) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
#define STR {struct info}
#define dbg(x) {cout<<"ekhane"<<x<<endl;}
#define  SS second
#define  FF first
#define PQ priority_queue
#define great greatest
#define less lesser
#define mii map<int,int>
#define mil map<int,ll>
#define mll map<ll,ll>
#define msb map<string,bool>
#define M 100005
//////////////////////////////////////////


int main(){

    int n=Int;
    set<int>s1;
    fr(n) s1.insert(Int);
    cout<<s1.size();
    done;
}





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

#define INF 1e99
#define EPS 1e-7

typedef complex<double> point;
typedef const point &ppoint;

double cross(ppoint a, ppoint b) {
	return a.real() * b.imag() - a.imag() * b.real();
}

double intersect(point pa1, point pa2, point pb1, point pb2) {
	point difa = pa2 - pa1;
	point difb = pb2 - pb1;
	point difab1 = pb1 - pa1;

	double D = cross(difa, -difb);

	if (abs(D) > EPS) {
		double t = cross(difab1, -difb) / D;
		double s = cross(difa, difab1) / D;

		if (t >= 0.0 && t <= 1.0 && s >= 0.0 && s <= 1.0) {
			return t;
		}
	}
	return INF;
}

int main() {
	point s[3], f[3], z[3];
	int x1, x2, y1, y2;

	while (true) {
		for (int i = 0; i < 3; ++i) {
			if (scanf("%d%d%d%d", &x1, &y1, &x2, &y2) != 4) {
				return 0;
			}
			s[i] = point(x1, y1);
			f[i] = point(x2, y2);
		}

		int j;
		for (j = 0; j < 3; ++j) {
			double t = intersect(s[j], f[j], s[(j + 1) % 3], f[(j + 1) % 3]);
			if (t == INF) {
				puts("kyo");
				break;
			}

			z[j] = (1.0 - t) * s[j] + t * f[j];
		}

		if (j == 3) {
			double s = abs(cross(z[1] - z[0], z[2] - z[0])) * 0.5;

			if (s >= 1.9e6) {
				puts("dai-kichi");
			} else if (s >= 1e6) {
				puts("chu-kichi");
			} else if (s >= 1e5) {
				puts("kichi");
			} else if (s > EPS) {
				puts("syo-kichi");
			} else {
				puts("kyo");
			}
		}
	}
}

Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
    
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
    
#define int long long
#define double long double
    
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
    
#define ff first
#define ss second
#define mp make_pair
         
#define pb push_back
#define endl "\n" 
         
#define f(i,l,r) for(int i=l;i<=r;i++)
#define rf(i,r,l) for(int i=r;i>=l;i--)    

#define bp __builtin_popcountll
#define inf 3e15
    
const int N=1e5+5;
const int M=1e9+7;
void solve()
{
	int cur=100;
	int x;
	cin>>x;
	int ans=0;
	while(cur<x)
	{
		ans++;
		int tt=cur/100;
		cur+=tt;
	}
	cout<<ans;
	
}
signed main()  
{
	FAST
    int t=1;
    // cin>>t;
    for(int tc=1;tc<=t;tc++)
    {
    	// cout<<"Case #"<<tc<<": ";
    	solve();
    }
}



Measured memory_bytes: 3692
n = int(input())
a, b = map(int, input().split())
p = list(map(int, input().split()))
x = 0
y = 0
z = 0
for i in p:
    if i <= a:
        x += 1
    elif i >= b + 1:
        z += 1
    else:
        y += 1
print(min(x, y, z))


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
 
const int COMMAX = 500001;
const int MOD = 1000000007;
vector<long long> fac, finv, inv;
 
void InitializePermutation(void){
    fac.push_back(1LL);
    fac.push_back(1LL);
    finv.push_back(1LL);
    finv.push_back(1LL);
    inv.push_back(0LL); //Though 0^(-1) cannot be defined, there should be some number in inv[0]
    inv.push_back(1LL);
    for (int i = 2; i < COMMAX; i++){
        fac.push_back(fac[i-1] * (long long)i % (long long)MOD);
        inv.push_back((long long)MOD - inv[MOD%i] * (long long)(MOD/i) % (long long)MOD);
        finv.push_back(finv[i-1] * inv[i] % (long long)MOD);
    }
}
 
long long Permutation(int n, int r){
    if (n < r) return 0LL;
    if (n < 0 || r < 0) return 0LL;
    return fac[n] * finv[n-r] % MOD;
}
 
long long Combination(int n, int r){
    if (n < r) return 0LL;
    if (n < 0 || r < 0) return 0LL;
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD;
}


int main(void){
    int N, M;
    cin >> N >> M;
    long long res = 0LL;
    int signplus = 1;
    InitializePermutation();
    for(int i=0; i<=N; i++){
        res += MOD + signplus * (Combination(N, i)*Permutation(M-i, N-i)%MOD);
        res %= MOD;
        signplus *= -1;
    }
    cout << res*Permutation(M, N)%MOD << endl;
    return 0;
}

Measured memory_bytes: 15164
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static int add(int a, int b) {
		int res = a + b;
		return res >= mod ? res - mod : res;
	}

	static int mul(int a, int b) {
		int res = (int) ((long) a * b % mod);
		return res < 0 ? res + mod : res;
	}

	static int mod;

	static void solve() throws Exception {
		int n = scanInt();
		mod = scanInt();
		int dyn[][] = new int[n + 1][3 * n + 1];
		dyn[0][0] = 1;
		for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= 3 * n; j++) {
				if (j + 1 <= 3 * n) {
					dyn[i][j + 1] = add(dyn[i][j + 1], dyn[i][j]);
				}
				if (i + 1 <= n && j + 2 <= 3 * n) {
					dyn[i + 1][j + 2] = add(dyn[i + 1][j + 2], mul(dyn[i][j], 3 * n - j - 1));
				}
				if (i + 1 <= n && j + 3 <= 3 * n) {
					dyn[i + 1][j + 3] = add(dyn[i + 1][j + 3], mul(dyn[i][j], (3 * n - j - 1) * (3 * n - j - 2)));
				}
			}
		}
		int ans = 0;
		for (int i = 0; i <= n; i++) {
			ans = add(ans, dyn[i][3 * n]);
		}
		out.print(ans);
	}

	static int scanInt() throws IOException {
		return parseInt(scanString());
	}

	static long scanLong() throws IOException {
		return parseLong(scanString());
	}

	static String scanString() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}

Measured memory_bytes: 81104
class Union_Find:
  def __init__(self,n=0):
    self.vertices=n
    self.mother=[-1 for i in range(self.vertices)]
    self.size_temp=[1 for i in range(self.vertices)]
  
  def root(self,x):
    normalize_v=[]
    while x!=-1:
      normalize_v.append(x)
      y=x
      x=self.mother[x]
    for i in normalize_v[:-1]:
      self.mother[i]=y
    return y
  
  def union(self,x,y):
    root_x=self.root(x)
    root_y=self.root(y)
    if root_x!=root_y:
      self.mother[root_x]=root_y
      self.size_temp[root_y]+=self.size_temp[root_x]
  
  def find(self,x,y):
    if self.root(x)==self.root(y):
      return True
    else:
      return False
  
  def size(self,x):
    return self.size_temp[self.root(x)]
  
n,m=map(int,input().split())
l=[[] for i in range(m)]
for i in range(n):
  inp=list(map(lambda x:int(x)-1,input().split()))[1:]
  for j in inp:
    l[j].append(i)

uf=Union_Find(n)
for i in range(m):
  for j in range(len(l[i])-1):
    uf.union(l[i][j],l[i][j+1])
c=0
for i in range(n):
  c+=uf.root(i)==i
print("YES" if c==1 else "NO")

Measured memory_bytes: 98012
import java.util.Scanner

import scala.collection.mutable.ArrayBuffer

object Main extends App {
  val in = new Scanner(System.in)
  val V = in.nextInt()
  val E = in.nextInt()
  val dinitz = new Dinitz(V)
  for (_ <- 0 until E) {
    val s = in.nextInt()
    val t = in.nextInt()
    val c = in.nextInt()
    dinitz.addEdge(s, t, c)
    //    dinitz.addEdge(t, s, c)
  }

  val f = dinitz.maxFlow(0, V - 1)
  println(f)
}

import java.util

class Dinitz(val V: Int) {

  class Edge(var to: Int, var cap: Long, var rev: Int)

  private val deque = new util.ArrayDeque[Integer]
  private val graph = (for (_ <- 0 until V) yield new ArrayBuffer[Edge]()).toArray
  private var level = new Array[Int](V)
  private var iter = new Array[Int](V)


  def addEdge(from: Int, to: Int, cap: Long): Unit = {
    graph(from).append(new Edge(to, cap, graph(to).size))
    graph(to).append(new Edge(from, 0, graph(from).size - 1))
  }

  private def dfs(v: Int, t: Int, f: Long): Long = {
    if (v == t) return f

    while (iter(v) < graph(v).size) {
      val e = graph(v)(iter(v))
      if (e.cap > 0 && level(v) < level(e.to)) {
        val d = dfs(e.to, t, Math.min(f, e.cap))
        if (d > 0) {
          e.cap -= d
          graph(e.to)(e.rev).cap += d
          return d
        }
      }

      {
        iter(v) += 1
        iter(v) - 1
      }
    }
    0
  }

  private def bfs(s: Int): Unit = {
    util.Arrays.fill(level, -1)
    level(s) = 0
    deque.add(s)
    while ( {
      !deque.isEmpty
    }) {
      val v = deque.poll
      for (e <- graph(v)) {
        if (e.cap > 0 && level(e.to) < 0) {
          level(e.to) = level(v) + 1
          deque.add(e.to)
        }
      }
    }
  }

  def maxFlow(s: Int, t: Int): Long = {
    var flow = 0L

    while (true) {
      bfs(s)
      if (level(t) < 0) return flow
      util.Arrays.fill(iter, 0)

      var f = 1L
      while (f > 0) {
        f = dfs(s, t, Long.MaxValue)
        flow += f
      }
    }

    throw new IllegalStateException()
  }
}

Measured memory_bytes: 52760
#include <bits/stdc++.h>
using intl = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for(intl i = (intl)(n); i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define repid(i, a, b) for(intl i = (intl)(a); i >= (intl)(b); i--)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define all(x) (x).begin,(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define cin(i, a) rep(i, alength(a))cin >> a[i]
#define ccin(i, j, a) rep(i, alength(a))rep(j, alength(a[i]))cin >> a[i][j]
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl
#define sqrt sqrtl
#define int intl
#define itn intl
#define double ld
#define pb push_back
#define mp make_pair
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld eps = 1.0e-14;//-9
void fp(bool flag){
    if(flag)cout << "Yes" << endl;
    else cout << "No" << endl;
}
void fp(bool flag, string s, string t){
    if(flag)cout << s << endl;
    else cout << t << endl;
}
intl kai(intl k){
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl gcd(intl a, intl b){
    if(!b)return a;
    return gcd(b, a % b);
}
signed main(){
    cout << fixed << setprecision(10);
    intl k,n;
    cin >> k >> n;
    intl a[n];
    cin(i,a);
    intl b[n];
    rep(i,n - 1){
        b[i] = a[i + 1] - a[i];
    }
    b[n - 1] = a[0] + (k - a[n - 1]);
    //rdebug(i,b);
    intl max = 0;
    intl idx = 0;
    rep(i,n){
        if(max < b[i]){
            max = b[i];
            idx = i;
        }
    }
    intl cnt = 0;
    rep(i,n){
        if(i == idx)continue;
        cnt += b[i];
    }
    cout << cnt << endl;
    return 0;
}

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

int main(){
    string s,t,ans;
    cin>>s>>t;
    int ss=s.size();
    int tt=t.size();
    bool f=false;
    for(int i=ss-1;i>=0;i--){
        f=true;
        rep(j,t.size()){
            if(i+j>=ss){
                f=false;
                break;
            }
            if((s[i+j]!=t[j])&&(s[i+j]!='?')){
                f=false;
                break;
            }
        }
        if(f==true){
            ans= s.substr(0,i)+t+s.substr(i+t.size());
            rep(j,ss){
                if(ans[j]=='?') ans[j]='a';
            }
            break;
        }
    }
    if(f==true) cout<<ans<<endl;
    else cout<<"UNRESTORABLE"<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <limits.h>

using namespace std;

int cnt=0;

void selectionSort(int arr[], int n)
{
    int i, j, min_idx;
    for (i = 1; i <=n-1; i++)
    {
        min_idx = i;
        for (j = i+1; j <=n; j++)
        if (arr[j] < arr[min_idx])
            min_idx = j;
        swap(arr[min_idx],arr[i]);
        if(arr[min_idx]!=arr[i])cnt++;
    }
}

int main()
{
    int n,v[101];
    cin>>n;
    for(int i=1;i<=n;++i)
        cin>>v[i];
    selectionSort(v,n);
    for(int i=1;i<=n;++i)
        if(i!=n)cout<<v[i]<<" ";
        else cout<<v[i]<<endl;
    cout<<cnt<<endl;
    return 0;
}



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

#define REP(i, n) for(decltype(n) i = 0; i < n; i++)

#define ALL(c)   c.begin(), c.end()
#define SORT(c)  std::sort(ALL(c))
#define RSORT(c) std::sort(ALL(c), std::greater<decltype(c)::value_type>())

using namespace std;
using ll = long long;

const int MOD  = (int)1e9 + 7;
const int INF  = (int)1e9 + 1;
const ll  LINF = (ll)1e18 + 1;

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

    int H, W, h, w;
    std::cin >> H >> W >> h >> w;
    std::cout << H * W - (h * W + w * H - h * w) << std::endl;

    return 0;
}


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

first = int(N/100)
second = N - first*100

f_YY = False
s_YY = False
f_MM = False
s_MM = False

if 0 <= first and first <= 99:
    f_YY = True
if 0 <= second and second <= 99:
    s_YY = True
if 1 <= first and first <= 12:
    f_MM = True
if 1 <= second and second <= 12:
    s_MM = True
    
if (f_YY == True and s_MM == True) and\
    (f_MM == True and s_YY == True):
    print('AMBIGUOUS')
elif f_YY == True and s_MM == True:
    print('YYMM')
elif f_MM == True and s_YY == True:
    print('MMYY')
else:
    print('NA')

Measured memory_bytes: 3064
import java.util.*;

class Main{
	
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();

		if(N==1) System.out.println("Hello World");

		else{
			int A = sc.nextInt();
			int B = sc.nextInt();
			System.out.println(A+B);
		}
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;


int main(){
    int n;
    cin >> n;
    if(n < 0 || n > 52) return -1;
    int S[13] = {0},H[13] = {0},C[13]= {0},D[13]= {0};
    for(int i = 0;i < n; i++){
        char c;
        int v;
        cin >> c >> v;
        if(c == 'S'){
            S[v-1] = 1;
        }else if(c == 'H'){
            H[v-1] = 1;
        }else if(c == 'C'){
            C[v-1] = 1;
        }else if(c == 'D'){
            D[v-1] = 1;
        }else{
            continue;
        }
    }
//    for(auto s:S) cout << s << "\t";
//    cout << "&&&&&&&&&&&&&&&&" << endl;

//    check missing
//    cout << "--------------------------" << endl;
        for(int i = 1; i <= 13; i++){
            if(S[i-1] == 0){
                cout << "S" << " " << i << endl;
            }
        }
    for(int i = 1; i <= 13; i++){
        if(H[i-1] == 0){
            cout << "H" << " " << i << endl;
        }
    }
    for(int i = 1; i <= 13; i++){
        if(C[i-1] == 0){
            cout << "C" << " " << i << endl;
        }
    }
    for(int i = 1; i <= 13; i++){
        if(D[i-1] == 0){
            cout << "D" << " " << i << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
		freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
const int mod = 998244353, inf = 1061109567;
const long long infll = 4557430888798830399;
const int N = 3005;
int n, S, a[N], dp[N][N];
void add(int &x, int y) {
	x += y; if (x >= mod) x -= mod;
}
void rem(int &x, int y) {
	x -= y;
	if (x < 0) x += mod;
}
int mul(int x, int y) {
	return 1ll * x * y % mod;
}
int fpow(int a, int p) {
	if (!p) return 1;
	int tmp = fpow(a, p >> 1);
	tmp = mul(tmp, tmp);
	if (p & 1) tmp = mul(tmp, a);
	return tmp;
}
int inv(int a) {
	return fpow(a, mod - 2);
}
signed main() {
	#ifdef BLU
	in("blu.inp");
	#endif
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> S;
	fw (i, 0, n) cin >> a[i];
	dp[0][0] = fpow(2, n);
	int inv2 = inv(2);
	fw (i, 0, n) fw (j, 0, S + 1) if (dp[i][j]) {
		add(dp[i + 1][j], dp[i][j]);
		if (j + a[i] <= S) add(dp[i + 1][j + a[i]], mul(dp[i][j], inv2));
	}
	cout << dp[n][S];
	return 0;
}

Measured memory_bytes: 38868
import java.io.*;
import java.util.*;

public class Main {

	static int m = 1000000007;

	public static void main(String[] args) throws IOException {
		Scanner scn = new Scanner(System.in);
		int t = scn.nextInt();
		int b = scn.nextInt();
		int c = scn.nextInt();
		System.out.println(c + " " + t + " " + b);
	}

	static class Scanner {

		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

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

using namespace std;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
using vs=vector<string>;
using li=list<int>;
using lil=list<ll>;
using lis=list<string>;
using fli=forward_list<int>;
using fll=forward_list<ll>;
using fls=forward_list<string>;
using si=stack<int>;
using sl=stack<ll>;
using ss=stack<string>;
using qi=queue<int>;
using ql=queue<ll>;
using qs=queue<string>;
using pqi=priority_queue<int>;
using pql=priority_queue<ll>;
using pqs=priority_queue<string>;
using dqi=deque<int>;
using dql=deque<ll>;
using dqs=deque<string>;

#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, a, n) for(int i = (n); i < (a); i++)
#define repr(i, n) for(int i = (n); i >= 0; i--)
#define repr2(i, a, n) for(int i = (n); i >= (a); i--)

template<typename T,typename U>
void Inparray(T &f,U n){
  for(int i=0;i<n;i++) cin>>f[i];
}

template<typename T,typename U>
void Printarray(T f,U n){
  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];
}

template<typename T,typename U>
void Printarray2(T f,U n){
  for(int i=0;i<n;i++) cout<<f[i]<<endl;
}

void flagfunc(bool flag,string A,string B){
  flag ? cout<<A<<endl : cout<<B<<endl;
}

void flag2func(bool flag){
  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

void flag3func(bool flag){
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int a,n;cin>>n;
  bool flag=true;
  rep(i,n){
    cin>>a;
    if((a%2==0 && (a%3!=0 && a%5!=0))){
      flag=false;
      break;
    }
  }
  flagfunc(flag,"APPROVED","DENIED");
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc125/tasks/abc125_c

#include "algorithm"
#include "functional"
#include "iostream"
#include "numeric"
#include "queue"
#include "set"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
using namespace std;
typedef long long ll;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

ll mygcd(ll a, ll b) { return b ? mygcd(b, a % b) : a; }

template <typename Monoid>
struct SegmentTree {
  ll n;  // 最下段の数
  vector<Monoid> nodes;
  ll zero_value;
  using F = function<Monoid(Monoid, Monoid)>;
  const F f;

  SegmentTree(vector<Monoid> vs, Monoid zero_value, F f)
      : zero_value(zero_value), f(f) {
    n = 1;

    while (n < vs.size()) {
      n *= 2;
    }

    nodes = vector<ll>(2 * n - 1, zero_value);

    rep(i, vs.size()) nodes[i + n - 1] = vs[i];

    for (ll i = n - 2; i >= 0; i--) {
      nodes[i] = f(nodes[i * 2 + 1], nodes[i * 2 + 2]);
    }
  }

  void update(Monoid i, Monoid val) {
    i += n - 1;
    nodes[i] = val;

    while (i > 0) {
      i = (i - 1) / 2;
      nodes[i] = f(nodes[2 * i + 1], nodes[2 * i + 2]);
    }
  }

  //  [from, to)
  Monoid query(ll from, ll to) {
    ll res = queryInternal(from, to, 0, 0, n);
    return res;
  }

  Monoid queryInternal(ll from, ll to, ll k, ll l, ll r) {
    if (r <= from || to <= l) {
      return zero_value;
    }

    if (from <= l && r <= to) {
      return nodes[k];
    }

    ll vl = queryInternal(from, to, 2 * k + 1, l, (l + r) / 2);
    ll vr = queryInternal(from, to, 2 * k + 2, (l + r) / 2, r);

    return f(vl, vr);
  }
};

void solve() {
  ll N;
  cin >> N;
  VL as(N);
  rep(i, N) cin >> as[i];

  SegmentTree<ll> st(as, 0ll, mygcd);

  ll res = 0;

  rep(i, N) {
    ll l = st.query(0, i);
    ll r = st.query(i + 1, as.size());
    chmax(res, mygcd(l, r));
  }

  cout << res << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


Measured memory_bytes: 3840
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

long calc(int a, int b, int c) {
    long ans = 0;
    int x = min(b, c);
    ans += x * 2;
    b -= x;
    c -= x;
    x = min(a, c);
    a -= x;
    c -= x;
    ans += x;
    if (c > 0) ans++;
    ans += b;
    return ans;
}

void main() {
    auto abc = readints;
    int a = abc[0], b = abc[1], c = abc[2];
    writeln(calc(a, b, c));
}


Measured memory_bytes: 256
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
using namespace std;
#define ll           long long
#define all(v)       (v).begin() , (v).end()
#define vi           vector <ll>
#define vii          vector <pair<ll,ll>>
#define ii           pair<ll,ll>
#define sz(v)	     ((int)((v).size()))
#define lp(i,a,b)    for(int i=a;i<b;i++)
#define pb           push_back
#define pf           push_front
#define F            first
#define S            second
#define endl         "\n"
#define IOS          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const double PI = 3.14159265358979323846;
const ll inf=2e9,MOD=998244353,MAX=1e5+1;

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    IOS;
    string s;
    cin>>s;
    int res=0;
    lp(i,0,3){
        int cnt=0;
        lp(j,i,3){
            if(s[j]=='R')
                cnt++;
            else
                break;
        }
        res=max(res,cnt);
    }
    cout<<res;
}

Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
using namespace std;
#define ll long long
char s[300005];

int main()
{
    scanf("%s",s);
    int l=strlen(s);
    int x=l-2;
    if(s[0]==s[l-1])
    {
        if(x%2==0) printf("First");
        else printf("Second");
    }
    else
    {
        if(x%2==1) printf("First");
        else printf("Second");
    }
    return 0;
}

Measured memory_bytes: 384
import java.io.*;
import java.util.*;
import java.lang.*;
import java.lang.Math;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    StringBuilder str=new StringBuilder(scan.nextLine());

    char[] output=new char[str.length()];
    str.getChars(0,str.length(),output,0);

    for(int i=0;i<output.length;i++){
      if(!Character.isUpperCase( output[i] ) ){
        output[i]=Character.toUpperCase(output[i]);
      }else if(!Character.isLowerCase(output[i])){
        output[i]=Character.toLowerCase(output[i]);
      }
    }

    //outputを文字列にする
    String ans=new String(output);
    System.out.println(ans);
  }
}


Measured memory_bytes: 26216
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin);i>(end);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=(" <<; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << ")" << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
#define f first
#define s second
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;


int main()
{
	// 入力
	string S;
	cin >> S;

	ll s = S.size();
	ll len = 0;
	ll maxlen = 0;
	REP(i, s) {
		if (S[i] == 'A' || S[i] == 'T' || S[i] == 'C' || S[i] == 'G') {
			len++;
		}
		else {
			if (len > 0) {
				Max(maxlen, len);
				len = 0;
			}
		}
	}
	Max(maxlen, len);

	cout << maxlen << endl;


	return 0;
}

Measured memory_bytes: 256