akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	//c>b>a
	int k;
	cin>>k;
	while(b<=a)
	{
		b = b*2;
		k--;
	}
	while(c<=b)
	{
		c = c*2;
		k--;
	}
	//cout<<k<<endl;
	//cout<<a<<" "<<b<<" "<<c<<endl;
	if(k<0)
		cout<<"No"<<endl;
	else
		cout<<"Yes"<<endl;
}

Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) 
#define mREP(a,b) for (int i = a; i == (b); --i) 
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
/*
	　　　  　 ,ﾍ／L──- 、
	　　　   　Lﾆ)r_」=＝= ｲ
	　　 　,ﾍ、i ﾉノλﾉﾊﾉﾍ
	　　   ,'　｀(ﾊﾘ ﾟ ヮﾟﾉi)　',
	　　 .i　　 >〈(つ,i!と)　　i
	　　  vﾍγk´_/___i,ゝﾍノ
	　　　　　 ｀ﾞr_,ｨ_ｧﾞ´
*/
string s;
cin >> s;
map<char, int>a;
rep0(i, s.length() - 1) {
	a[s[i]]++;
}
bool can = true;
for (auto& j : a) {
	if (j.second % 2 != 0) {
		can = false;
	}
}
if (can) {
	cout << "Yes" << endl;
}
else {
	cout << "No" << endl;
}
return 0;
}


Measured memory_bytes: 256
module Main where

import Control.Applicative
import Control.Monad
import Data.Maybe
import Data.Array
import Data.Char

(!?) :: Array (Int, Int) Char -> (Int, Int) -> Maybe Char
a !? (i, j)
    | bounds a `inRange` (i, j) = Just $ a ! (i, j)
    | otherwise                 = Nothing

f1 :: Array (Int, Int) Char -> (Int, Int) -> Int
f1 arr (i, j) = length $ filter (== '#') cs
  where
    ps = [(i + s, j + t) | s <- [-1, 0, 1], t <- [-1, 0, 1], any (/= 0) [s, t]]
    cs = catMaybes $ fmap (arr !?) ps

f2 :: Array (Int, Int) Char -> (Int, Int) -> Char
f2 arr (i, j)
    | Just '#' <- arr !? (i, j) = '#'
    | otherwise                 = intToDigit $ f1 arr (i, j)

main :: IO ()
main = do
    [h, w] <- fmap read . words <$> getLine :: IO [Int]
    arr <- fmap (listArray ((1, 1), (h, w)) . concat) $ replicateM h getLine
    forM_ [1 .. h] $ \s -> do
        let ps = range ((s, 1), (s, w))
        let line = fmap (f2 arr) ps
        putStrLn line

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

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

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

    set<ll> candidates;
    for (int i = 1; i * i <= sum; i++) {
        if (sum % i == 0) {
            candidates.insert(i);
            candidates.insert(sum / i);
        }
    }

    ll ans = 1;
    for (ll x: candidates) {
        ll need;

        vector<ll> r(N);
        rep (i, N) {
            r[i] = A[i] % x;
        }
        sort(r.begin(), r.end());

        ll B = 0;
        rep (i, N) {
            B += x - r[i];
        }

        ll A = 0;
        need = 1e18;

        rep (i, N) {
            A += r[i];
            B -= x - r[i];
            need = min(need, max(A, B));
        }

        if (need <= K) {
            ans = max(ans, x);
        }
    }

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


Measured memory_bytes: 384
var
	f1,f2:array[0..100010] of longint;
	max,t:array[1..2,1..2] of longint;
	n,i,x,s:longint;
begin
	read(n);
	fillchar(f1,sizeof(f1),0);
	fillchar(f2,sizeof(f2),0);
	fillchar(max,sizeof(max),0);
	for i:=1 to n do
	begin
		read(x);
		if i mod 2=1 then
		begin 
			inc(f1[x]);
			if f1[x]>max[1,1] then
			begin
				if x<>t[1,1] then 
				begin
					max[1,2]:=max[1,1];
					t[1,2]:=t[1,1];
				end;
				max[1,1]:=f1[x];
				t[1,1]:=x;
			end
			else if f1[x]>max[1,2] then 
				begin 
					max[1,2]:=f1[x];
					t[1,2]:=x;
				end;
		end
		else
		begin 
			inc(f2[x]);
			if f2[x]>max[2,1] then
			begin
				if x<>t[2,1] then
				begin
					max[2,2]:=max[2,1];
					t[2,2]:=t[2,1];
				end;
				max[2,1]:=f2[x];
				t[2,1]:=x;
			end
			else if f2[x]>max[2,2] then 	
				begin 
					max[2,2]:=f2[x];
					t[1,2]:=x;
				end;
		end;
	end;
	s:=0;
	if (t[1,1]<>t[2,1]) then s:=max[1,1]+max[2,1]
	else if max[1,2]+max[2,1]>max[1,1]+max[2,2] then s:=max[1,2]+max[2,1]
	else s:=max[1,1]+max[2,2];
	if (t[1,1]=t[2,1]) and (max[1,2]=0) and (max[2,2]=0) then writeln(n div 2)
	else writeln(n-s);
end.

Measured memory_bytes: 896
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e3 + 5, mod = 1e9+7;
int n, d[N];

void unique_factorization(int n){
    int m = sqrt(n + 0.5);
    for (int i = 2; i <= m; i++){
        while (n%i == 0) {
            n/= i;
            d[i] ++;
        }
        if(n==1) break;
    }
    if(n>1)d[n]++;
}

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    
    for (int i = 2; i <= n; i++){
        unique_factorization(i);
    }
    
    long long ans = 1;
    for (int i = 2; i <= n; i++){
        if(d[i] >=1){
            (ans *= (d[i]+1))%=mod;
        }
    }
    cout<<ans<<endl;
    
    
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define sortr(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define max 10000005
#define nil -1
constexpr int inf = 100000000;

struct edge{
    int to,cost;
};

vector<vector<edge>> g;
vector<int> d;
int n;

void dic(int s){
    priority_queue<P,vector<P>,greater<P>> que;
    d.resize(max);
   fill(d.begin(),d.end(),inf);
   d[s]=0;
   que.push(P(0,s));
   while(!que.empty()){
       P p=que.top();que.pop();
       int v=p.second;
       if(p.first>d[v]){
           continue;
       }
       for(int i=0;i<g[v].size();i++){ 
           edge e=g[v][i];
           if(d[v]+e.cost<d[e.to]){
               d[e.to]=d[v]+e.cost;
               que.push(P(d[e.to],e.to));
           }
       }
   }
}

int main() {
  int  u,k,v,c;
  cin>>n;
    g.resize(n);
    d.resize(n);
  rep(i,n){
      cin>>u>>k;
      for(int j=0;j<k;j++){
          cin>>v>>c;
          g[u].push_back({v,c});
        }
    }
    dic(0);
    rep(i,n){
        cout<<i<<" "<<d[i]<<endl;
    }
  return 0;
}



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

vector<vector<int>> G;
vector<int> points;
vector<int> ans;

void dfs(int u, int p) {
  ans.at(u) += points.at(u);
  for (int v : G.at(u)) {
    if (v == p) continue;
    ans.at(v) += ans.at(u);
    dfs(v, u);
  }
}

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

  G.resize(N);
  rep(i, N - 1) {
    int a, b;
    cin >> a >> b;
    a--; b--;

    G.at(a).push_back(b);
    G.at(b).push_back(a);
  }

  points.resize(N, 0);
  rep(i, Q) {
    int p, x;
    cin >> p >> x;
    p--;

    points.at(p) += x;
  }

  ans.resize(N, 0);

  dfs(0, -1);
  rep(i, N) {
    cout << ans.at(i);
    if (i != N - 1) cout << " ";
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 27392
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long;
using ULL = unsigned long long;

int main() {
    LL n, k; cin >> n >> k;
    vector<LL> a(n);
    rep(i, n) {
        cin >> a[i];
    }
    LL res = 0;
    for (int d = 60; d >= -1; d--) {
        if (d != -1 and not (k & (1LL << d))) continue;

        LL tmp = 0;
        for (int e = 60; e >= 0; e--) {
            LL mask = (1LL << e);
            int num = 0;
            rep(i, n) {
                if (a[i] & mask) num++;
            }

            if (e > d) {
                if (k & mask) tmp += mask * (n - num);
                else tmp += mask * num;
            } else if (e == d) {
                tmp += mask * num;
            } else {
                tmp += mask * max((LL)num, n - num);
            }
        }
        res = max(res, tmp);
    }
    cout << res << endl;
}


Measured memory_bytes: 1024
import sys
n=int(input())
if n%2==1:
    print(0)
else:
    a=n//2
    count=0
    i=1
    while(True):
        b=a//(5**i)
        if b == 0:
            break
        else:
            count+=b
            i+=1
    print(count)

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<queue>
using namespace std;

int main(){
  int h,w;
  cin>>h>>w;
  vector<string> a(h);
  for(int i=0;i<h;i++){
    cin>>a[i];
  }
  int cnt=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++)if(a[i][j]=='#')cnt++;
  }
  queue<int> x;
  queue<int> y;
  x.push(0);
  y.push(0);
  while(x.empty()!=1){
    int nx=x.front();
    int ny=y.front();
    //cout<<nx<<" "<<ny<<endl;
    x.pop();
    y.pop();
    if(nx==w-1&&ny==h-1&&cnt==w+h-1){
      cout<<"Possible"<<endl;
      return 0;
    }
    //cout<<a[ny][nx+1]<<" "<<a[ny+1][nx]<<endl;
    if(nx+1<w&&a[ny][nx+1]=='#'){
      x.push(nx+1);
      y.push(ny);
    }
    if(ny+1<h&&a[ny+1][nx]=='#'){
      x.push(nx);
      y.push(ny+1);
    }
  }
  cout<<"Impossible"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int a[101]={}, b, count=0;
    for(int i=0;i<12;i++){
        cin>>b;
        a[b-1]++;
    }
    for(int i=0;i<100;i++){
        if(a[i]==4) count++;
        if(a[i]==8) count += 2;
        if(a[i]==12) count += 3;
    }
    if(count == 3) cout<<"yes"<<endl;
    else cout<<"no"<<endl;
    return 0;
}



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

#define fo(i,s,t) for(int i = s; i <= t; ++ i)
#define fd(i,s,t) for(int i = s; i >= t; -- i)
#define bf(i,s) for(int i = head[s]; i; i = e[i].next)
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define VI vector<int>
#define sf scanf
#define pf printf
#define fp freopen
#define SZ(x) ((int)(x).size())
#define IF_DEBUG 0
typedef long long ll;
typedef double db;
const int inf = 1<<30;
const ll INF = 1ll<<60;
const db Inf = 1e20;
const db eps = 1e-9;

void gmax(int &a,int b){a = (a > b ? a : b);}
void gmin(int &a,int b){a = (a < b ? a : b);}
map<int,int> shit;
int n, x, ans;
int main()
{
	sf("%d",&n);
	fo(i,1,n)
	{
		sf("%d",&x);
		shit[x] ++;
		if(shit[x]%2==0) -- ans;
		else ++ ans;
	}
	pf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#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 de(x) cout << #x << " = " << x << endl
#define dd(x) cout << #x << " = " << x << " "
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pw(x) (1ll << (x))
#define endl '\n'
typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef pair<int, int> pii;

const int N = 202020;

int n, a[N], b[N];

int main() {
	std::ios::sync_with_stdio(0);
	std::cin.tie(0);
	cin >> n;
	rep(i, 1, n + 1) cin >> a[i] >> b[i];
	sort(a + 1, a + 1 + n);
	sort(b + 1, b + 1 + n);
	int x, y;
	if(n & 1) {
		x = a[n / 2 + 1];
		y = b[n / 2 + 1];
	} else {
		x = a[n / 2] + a[n / 2 + 1];
		y = b[n / 2] + b[n / 2 + 1];
	}
	cout << y - x + 1 << endl;
	return 0;
}


Measured memory_bytes: 5188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
int dx[4]={0,0,-1,1},dy[4]={1,-1,0,0};
const int INF=1e9;
int dp[200010];

int main(int argc, char const *argv[]) {
  int n;
  int h[200010];
  std::cin >> n;
  dp[0]=INF;
  for(int i=1; i<=n; i++){
    std::cin >> h[i];
    dp[i]=INF;
  }

  dp[1]=0;
  for(int i=2; i<=n; i++){
    dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]));
  }
  std::cout << dp[n] << '\n';

  return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <vector>

// @author: pashka

using namespace std;

int main() {
    std::ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    printf(((c >= a) && (c <= b)) ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 256
//
// Created by 26019 on 2020/6/7/007.
//
#include <iostream>

using namespace std;

int main() {
    long long n;
    cin >> n;
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
        if (!(i%3==0||i%5==0)) sum += i;
    }
    cout << sum;
    return 0;
}



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

using cap_type = int;

struct edge {
    int to, rev;
    cap_type cap;
    edge(int t, cap_type c, int r) : to(t), rev(r), cap(c) {}
};
using graph = vector<vector<edge>>;

void add_edge(graph& g, int from, int to, cap_type cap) {
    g[from].emplace_back(to, cap, g[to].size());
    g[to].emplace_back(from, 0, g[from].size() - 1);
}

cap_type augment(graph& g, vector<int> const& level, vector<int>& iter, int v, int t, cap_type f) {
    if(v == t) return f;
    for(int& i = iter[v]; i < (int)g[v].size(); ++i) {
        auto& e = g[v][i];
        if(e.cap > 0 && level[v] < level[e.to]) {
            const auto d = augment(g, level, iter, e.to, t, min(f, e.cap));
            if(d > 0) {
                e.cap -= d;
                g[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

cap_type max_flow(graph& g, int s, int t) {
    const auto inf = numeric_limits<cap_type>::max() / 2;
    cap_type flow = 0;
    while(true) {
        vector<int> level(g.size(), -1);
        level[s] = 0;
        queue<int> que;
        que.push(s);
        while(!que.empty()) {
            const int v = que.front();
            que.pop();
            for(auto const& e : g[v]) {
                if(e.cap > 0 && level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    que.push(e.to);
                }
            }
        }
        if(level[t] < 0) return flow;
        vector<int> iter(g.size());
        cap_type f{0};
        while((f = augment(g, level, iter, s, t, inf)) > 0) {
            flow += f;
        }
    }
}


class union_find {
public:
    union_find(int n) : par(n, -1) {}

    int root(int x) {
        return par[x] < 0 ? x : par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        x = root(x), y = root(y);
        if(x == y) return;
        if(par[x] < par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
    }

    int size(int x) {
        return -par[root(x)];
    }

private:
    vector<int> par;
};

int main() {
    int n, m; cin >> n >> m;
    graph g(n + n + 2);
    const int src = n + n, sink = src + 1;
    union_find uf(m);
    vector<int> rid(n, -1), cid(n, -1);
    for(int i = 0; i < m; ++i) {
        int r, c; cin >> r >> c;
        r--, c--;
        add_edge(g, r, c + n, 1);
        if(rid[r] != -1) {
            uf.unite(rid[r], i);
        }
        if(cid[c] != -1) {
            uf.unite(cid[c], i);
        }
        rid[r] = cid[c] = i;
    }
    for(int i = 0; i < n; ++i) {
        add_edge(g, src, i, 1);
        add_edge(g, i + n, sink, 1);
    }

    set<int> kinds;
    for(int i = 0; i < m; ++i) {
        kinds.insert(uf.root(i));
    }

    cout << m - max_flow(g, src, sink) << " " << m - kinds.size() << endl;
}



Measured memory_bytes: 3332
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){//桁数
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){//最小公倍数
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){//最大公約数
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  string a;
  cin>>a;
  int b=0,c=0;
  rev(a);
  fo(i,a.size()){
    if(a[i]=='T')
      b++;
    else{
      c++;
      if(b>0){
        b--;
        c--;
      }
    }
  }
  cout<<b+c<<endl;
}

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

int main(){
int a, b;
char op;

while(true){
cin >> a >> op >> b;

switch(op){
 case'+': cout << a + b << endl; break;
 case'-': cout << a - b << endl; break;
 case'*': cout << a * b << endl; break;
 case'/': cout << a / b << endl; break;
 case'?': return false;
}

}


}

Measured memory_bytes: 1160
import java.io.*;

class Main
{
	public static void main(String args[]) throws IOException
	{
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
		String[] array = str.split(" ");

		int a = Integer.parseInt(array[0]);
		int b = Integer.parseInt(array[1]);

		int S = a * b;
		int L = 2 * (a + b);

		System.out.println(S + " " + L);
	}
}

Measured memory_bytes: 24384
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define YESNO(i) puts((i)?"YES":"NO");
#define YesNo(i) puts((i)?"Yes":"No");
#define yesno(i) puts((i)?"yes":"no");
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll d,t,s;cin>>d>>t>>s;
  print((d<=t*s)?"Yes":"No");
  return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>

int main(){
  char s1[128], s2[128];
  int N;
  scanf("%d %s %s", &N, &s1, &s2);
  for(int i = 0; i < N; i++) {
    int k;
    for(k = 0; k < N - i; k++) {
      if(s1[i + k] != s2[k]) break;
    }
    if(k == N - i) {
      printf("%d\n", N + i);
      return 0;
    }
  }
  printf("%d\n", 2 * N);
}

Measured memory_bytes: 128
#include<stdio.h>
int main(){
    int N,K;
    scanf("%d %d", &N, &K);
    int total[N];
    int i;
    for(i=0;i<N;i++){
        scanf("%d", &total[i]);
    }
    for(i=K;i<N;i++){
        if(total[i-K]<total[i]){
            printf("Yes\n");
        }else {
            printf("No\n");
        }
    }
    return 0;
}

Measured memory_bytes: 2400
N, Q = gets.split(' ').map(&:to_i)
S = gets.chomp

ac = Array.new
S.size.times do |i|
  if i == 0
    ac[0] = 0
  elsif S[i] == 'C' && S[i-1] == 'A'
    ac[i] = ac[i-1] + 1
  else
    ac[i] = ac[i-1]
  end
end

Q.times do
  l, r = gets.split(' ').map(&:to_i)
  puts ac[r - 1] - ac[l - 1]
end

Measured memory_bytes: 5372
#include <stdio.h>

int main()
{
  char str[10];
  scanf("%s", str);
  if(str[0]=='S') printf("Cloudy\n");  
  else if(str[0]=='C') printf("Rainy\n");  
  else if(str[0]=='R') printf("Sunny\n");  
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n;
    cin >> n;
    vector<int> v(n);
    REP(i,n){cin >> v[i];}
    vector<int> w = v;
    sort(w.begin(),w.end());
    REP(i,n){
        if(v[i]<=w[n/2-1]){
            cout << w[n / 2] << endl;
        }else{
            cout << w[n / 2 - 1] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3712
import sys
n = int(sys.stdin.readline())
H = list(map(int, sys.stdin.readline().split()))

P =[0 for _ in range(n)]
P[1] = abs(H[1]-H[0])
for pos in range(2, n):
    a = abs(H[pos]-H[pos-1])
    b = abs(H[pos]-H[pos-2])
    P[pos] = min((P[pos-1] + a), (P[pos-2] + b))

print(P[n-1])

Measured memory_bytes: 13888
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
 
#define pb push_back
#define mk make_pair
#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define sf(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define TEST int test; cin >> test;while(test--)
#define ii pair<int,int>
#define iil pair<ll,ll>
#define loop(i,a,b) for(int i = a ; i < b ; i++)
#define INF 2147483647
 
 
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
const double pi = acos(-1.0);
 
 
ll gcd(ll a, ll b)
{
    if(b==0) return a;
    a%=b;
    return gcd(b,a);
}
 
 
ll mod(ll a, ll b)
{
    ll c = a % b;
    if (c < 0)
        c += b;
    return c;
}
ll power(ll x, unsigned long long y)
{
    int res = 1;     // Initialize result
 
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x);
 
        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x);  // Change x to x^2
    }
    return res;
}
int isPrime[5000000] ;
vector< vector<ll> > pf(1000000), pr(1000000);
void sieve(int n)
{
    for(int i = 2 ; i*i <= n ; i++)
    {
        if(!isPrime[i])
        {
            // v.pb(i);
            for(int j = i+i ; j <= n; j = j + i)
            {
                isPrime[j] = 1;
                pf[j].pb(i);
            }
        }
    }
    return;
}
 
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
     ll a,b,c,k;
     cin >> a >>b >> c >>k;
     if(k <= (a+b))
     {
       cout << min(k,a);
     }
     else{
       cout << a - (k-b-a) << endl;
     }
 
    return 0;
 
 
 
}

Measured memory_bytes: 50104
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>

using namespace std;

void solve() {
    string forecast;
    string result;
    cin >> forecast;
    cin >> result;
    int n = 0;
    for(int i = 0; i < 3; i++){
        if(forecast.substr(i,1) == result.substr(i,1))
            n++;
    }

    cout << n << endl;

}

int main() {
    solve();
    return 0;
}

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

#define INF (INT64_MAX)
#define MOD (1000000000+7)
#define MAX 10

string S;

int n[MAX];
int p[MAX];
int perm[MAX];

long long num( int s, int e )
{
	long long res = 0;
	for( int i = s; i < e; i++ ) {
		res = res * 10 + n[i];
	}
	return res;
}

int main() {
	cin >> S;

	int sz = S.size();
	for( int i = 0; i < sz; i++ ) {
		n[i] = S[i] - '0';
	}
	long long ans = 0;
	for( int i = 0; i < sz; i++ ) {
		if( i == 0 ) {
			ans += num( 0, sz );
		}
		else {
			memset( perm, 0, sizeof( perm ) );
			for( int j = 0; j < i; j++ ) {
				p[j] = j + 1;
				perm[j] = 1;
			}
			while( true ) {
				ans += num( 0, p[0] );
				for( int k = 0; k < i - 1; k++ ) {
					ans += num( p[k], p[k + 1] );
				}
				ans += num( p[i - 1], sz );
				bool ret = prev_permutation( perm, perm + sz - 1 );
				if( ret != true ) {
					break;
				}
				int ofs = -1;
				for( int j = 0; j < i; j++ ) {
					ofs = find( perm + ofs + 1, perm + sz - 1, 1 ) - perm;
					p[j] = ofs + 1;
				}
			}
		}
	}

	cout << ans << endl;

	return 0;
}


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


int main() {
    ll H, W, N;
    cin >> H >> W >> N;
    map<pair<ll, ll>, int> mp;
    for (int i = 0; i < N; i++) {
        ll a, b;
        cin >> a >> b;
        for (int j = -1; j <= 1; j++) {
            for (int k = -1; k <= 1; k++) {
                mp[{a+j, b+k}]++;
            }
        }
    }
    
    vector<ll> ans(10, 0);
    ll sum = 0;
    for (auto p : mp) {
        ll x = p.first.first, y = p.first.second;
        if (x <= 1 || x >= H || y <= 1 || y >= W) continue;
        if (p.second > 0) {
            ans[p.second]++;
            sum++;
        }
    }
    ans[0] = (H-2)*(W-2)-sum;
    for (int i = 0; i <= 9; i++) cout << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 56448
#include <stdio.h>
 
#define N 10000
#define Q 500
 
int main(){

  int S[N],T[Q];
  int n,m,i,j,c=0,flag=0;

  scanf("%d",&n);

  for(i=0; i<n ; i++){
    scanf("%d",&S[i]);
  }
 
  scanf("%d",&m);

  for(i=0; i<m ; i++){
    scanf("%d",&T[i]);
  }

  for(i=0; i<m ; i++){
    flag=0;
    for(j=0; j<n ; j++){
      if(flag!=0 && flag!=1)
    continue;
      if(S[j]==T[i]){
    c++;
    break;
      }
    }
  }
  if(c==0) printf("0\n");
  else printf("%d\n",c);
  return 0;
}
 

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

int main(){

    string S;
    cin >> S;

    bool ans = true;
    int C_count = 0;
    if(S[0] != 'A') ans = false;
    for(int i = 1; i < S.length(); i++){
        if(S[i] != 'A' && S[i] != 'C'){
            if('A' <= S[i] && S[i] <= 'Z') ans = false;
        }
        if(2 <= i && i <= S.length() - 2){
            if(S[i] == 'C') C_count++;
        }
    }

    if(ans && C_count == 1) cout << "AC" << endl;
    else cout << "WA" << endl;

    return 0;
}

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

int main() {
    string s; cin >> s;
    vector<char> op(3);
    for (int t = 0; t < (1 << 3); t++) {
        int num  = s[0] - '0';
        for (int i = 0; i < 3; i++) {
            if (t & (1 << i)) {
                num += s[i + 1] - '0';
                op[i] = '+';
            } else {
                num -= s[i + 1] - '0';
                op[i] = '-';
            }
        }
        if (num == 7) {
            cout << s[0];
            for (int i = 0; i < 3; i++) {
                cout << op[i] << s[i + 1];
            }
            cout << "=7" << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0) 
#define setbit0(n, i) ((n) & (~(1LL << (i)))) 
#define setbit1(n, i) ((n) | (1LL << (i))) 
#define togglebit(n, i) ((n) ^ (1LL << (i))) 
#define lastone(n) ((n) & (-(n))) 
char gap = 32;
template<typename T> 
ostream& operator<<(ostream &os, const vector<T> &v) { 
    os << '{'; 
    for (const auto &x : v) os << gap << x;
        return os << '}'; 
}
template<typename A, typename B> 
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long 
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string m;
    ll n;
    cin >> n >> m;
    ll res = 0;
    ll sz = m.size();
    ll gun = 1;
    for (ll i = sz - 1; i >= 0;i--){
        if(m[i]!='.'){
            res = res + (gun * (m[i] - '0') * n);
            gun *= 10;
        } 
    }
    res /= 100;
    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 3656
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int a;
    cin >> a;
    cout << a+a*a+a*a*a << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define MAX_N 10000
#define INF 1e9

using namespace std;

typedef int long long ll;
typedef int long l;
typedef pair<int, int> Pii;

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

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k) {
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    COMinit();
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    int cnt = min(w - b, h - a);
    int res = 0;
    for (int i = 0; i < cnt; i++) {
        res += ((ll)COM(b + h - a - 1, h - a - i - 1) * COM(w - b + a - 1, w - b - i - 1)) % MOD;
        res = res > MOD ? res - MOD : res;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 12160
S = input()
Q = int(input())
Query = []
kaisu = 0
sento = ""
for i in range(Q):
    Query.append(input().split())

for i in Query:
    if int(i[0]) == 1:
        kaisu = kaisu + 1
    elif int(i[0]) == 2:
        if kaisu % 2 == 0:
            if int(i[1]) == 1:
                sento = sento + i[2]
            else:
                S = S + i[2]
        else:
            if int(i[1]) == 2:
                sento = sento + i[2]
            else:
                S = S + i[2]
S = ''.join(list(reversed(sento))) + S
if kaisu % 2 == 0:
    print(S)
else:
    print(''.join(list(reversed(S))))

Measured memory_bytes: 42292
a, b, c = gets.split(' ').map!(&:to_i)

exist = Hash.new(false)

ans = 'NO'

times = 1
loop do
  r = (a * times) % b
  if r == c
    ans = 'YES'
    break
  end

  break if exist[r] # すでに存在している余りだった場合は、これ以降は出現しない

  exist[r] = true
  times += 1
end

puts ans


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

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

    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    
    int ans = 0;
    for(int i=a[0]; i<=a[n-1]; i++){
        int x = lower_bound(a.begin(),a.end(),i+2) - lower_bound(a.begin(),a.end(),i-1);
        ans = max(ans, x);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
import sys
import fractions
from functools import reduce

readline = sys.stdin.buffer.readline


def main():
    gcd = fractions.gcd

    def lcm(a, b):
        return a * b // gcd(a, b)

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

    B = A[::]
    while not any(b % 2 for b in B):
        B = [b // 2 for b in B]

    if not all(b % 2 for b in B):
        print(0)
        return

    semi_lcm = reduce(lcm, (a // 2 for a in A))
    print((M // semi_lcm + 1) // 2)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 12004
if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    count = 0

    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if i*500 +j*100+k*50 ==x:
                    count+=1
    print(count)


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

const int MAX_N = 100000;

int main(){
    int a,b,c,d;
    int e,f,g,h;
    cin >> e>>f>>g>>h;
    if(e>g){
        a=g;
        b=h;
        c=e;
        d=f;
    }else{
        a=e;
        b=f;
        c=g;
        d=h;
    }
    

    if(a<c&&b>d){
        cout << d-c << endl;   
    }else if(b-c<0){
        cout<< '0' << endl;
        
    }else cout << b-c << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		int N = sc.nextInt();
		long L = sc.nextLong();
		long T = sc.nextLong();
		int[] x = new int[N];
		boolean[] cw = new boolean[N];
		for(int i=0; i<N; i++) {
			x[i] = sc.nextInt();
			cw[i] = sc.nextInt()==1;
		}

		int[] pos = new int[N];
		for(int i=0; i<N; i++)
			pos[i] = (int)((x[i]+(cw[i] ? T%L : L-(T%L)))%L);
		Arrays.sort(pos);
			
		long cnt = 0;
		for(int i=1; i<N; i++) {
			if(cw[i]!=cw[0]) {
				long dis = ((x[i]-x[0])*(cw[0] ? 1 : -1)+L)%L;
				cnt = (cnt + (2*T + L-dis-1)/L)%N;
			}
		}
			
		int a = Arrays.binarySearch(pos, (int)((x[0]+(cw[0] ? T%L : L-(T%L)))%L));
		if(cw[0] && a>0 && pos[a-1]==pos[a])
			a--;
		if(!cw[0] && a<N-1 && pos[a+1]==pos[a])
			a++;
		int idx = (int)((a + cnt*(cw[0] ? -1 : 1) + N)%N);
		
		for(int i=0; i<N; i++)
			pw.println(pos[(idx+i)%N]);
		
		sc.close();
		pw.close();
	}
}


Measured memory_bytes: 62704
a, b, x = [int(i) for i in input().split()]

import math

h = (2 * x) / (a * b)
if h <= a:
    print(90 - math.degrees(math.atan(h / b)))
else:
    print(math.degrees(math.atan(((((a ** 2) * b) - x) * 2) / (a ** 3))))


Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
int main() {
	int A,B,C,X;
  cin>>A>>B>>C>>X;
  int res=0;
  for(int a=0;a<=A;a++){
    for(int b=0;b<=B;b++){
      for(int c=0;c<=C;c++){
        int total=500*a+100*b+50*c;
        if(total==X)res++;
      }
    }
  }
  cout<<res<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
#define MOD (int)(1e9 + 7) 
  
// Function to find the count of integers 
// obtained by replacing '?' in a given 
// string such that formed integer 
// gives remainder 5 when it is divided by 13 
int modulo_13(string s, int n) 
{ 
    long long dp[n + 1][13] = { { 0 } }; 
  
    // Initialise 
    dp[0][0] = 1; 
  
    for (int i = 0; i < n; i++) { 
        for (int j = 0; j < 10; j++) { 
            int nxt = s[i] - '0'; 
  
            // Place digit j at ? position 
            if (s[i] == '?') 
                nxt = j; 
  
            // Get the remainder 
            for (int k = 0; k < 13; k++) { 
                int rem = (10 * k + nxt) % 13; 
                dp[i + 1][rem] += dp[i][k]; 
                dp[i + 1][rem] %= MOD; 
            } 
            if (s[i] != '?') 
                break; 
        } 
    } 
  
    // Return the required answer 
    return (int)dp[n][5]; 
} 
  
// Driver code 
int main() 
{ 
  	string s;
  	cin>>s;
    int n = s.size(); 
    cout << modulo_13(s, n); 
  
    return 0; 
} 

Measured memory_bytes: 13972
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
 
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;
 
#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second
 
int main(int argc, char **argv) {
	string s;
	cin >> s;
	sort(ALL(s));
	cout << (s[0] == s[1] && s[1] != s[2] && s[2] == s[3] ? "Yes" : "No") << endl;
	return 0;
}
 

Measured memory_bytes: 256
def main():
  l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
  K = int(input())

  print(l[K-1])

if __name__ == "__main__":
    main()

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

typedef double D;
typedef complex<D> P;

#define X real()
#define Y imag()

const D eps=1e-8;
const D inf=1e12;
const D PI=acos(-1);

bool cmp_x(const P& a,const P& b){ return a.X==b.X?a.Y<b.Y:a.X<b.X; }
bool cmp_y(const P& a,const P& b){ return a.Y==b.Y?a.X<b.X:a.Y<b.Y; }
bool cmp_a(const P& a,const P& b){ return arg(a)==arg(b)?norm(a)<norm(b):arg(a)<arg(b); }
D cross(P a,P b){ return (conj(a)*b).Y; }
D dot(P a,P b){ return (conj(a)*b).X; }
D toRag(D deg){ return deg*PI/180.0; }
P rot(P base,P a,D theta){ return base+polar(abs(a-base),arg(a-base)+theta); }

struct L : public vector<P> { // line and segment
  L(const P& a,const P &b){
    push_back(a);
    push_back(b);
  }
};

vector<P> convex_hull(vector<P>& ps){
  sort(ps.begin(),ps.end(),[](const P& a,const P& b){ return a.X==b.X?a.Y<b.Y:a.X<b.X; });
  int n=ps.size();
  int k=0;
  vector<P> qs(n*2);
  for(int i=0;i<n;i++){
    while(k>1&&cross(qs[k-1]-qs[k-2],ps[i]-qs[k-1])<=0)k--;
    qs[k++]=ps[i];
  }
  for(int i=n-2,t=k;i>=0;i--){
    while(k>t&&cross(qs[k-1]-qs[k-2],ps[i]-qs[k-1])<=0)k--;
    qs[k++]=ps[i];
  }
  qs.resize(k-1);
  return qs;
}

int N;
vector<P> sav,ps;
D res[101];

int main(){
  cin>>N;
  rep(i,N){
    D x,y;
    cin>>x>>y;
    ps.push_back(P(x,y));
  }
  sav=ps;
  vector<P> cs=convex_hull(ps);
  int M=cs.size();
  rep(i,M){
    P p=cs[i];
    P pre=cs[(M-1+i)%M];
    P nxt=cs[(i+1)%M];

    P p1=pre-p;
    P p2=p-nxt;

    D r1=atan2(p1.X,-p1.Y);
    D r2=atan2(p2.X,-p2.Y);
    rep(j,N)if(sav[j]==p){
      res[j]=(r2-r1)/(2.0*PI);
      if(res[j]<0)res[j]=1.0+res[j];
    }
  }

  rep(i,N)printf("%.10f\n", res[i]);
  return 0;
}


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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD ((ll)1e9+7)

ll N,M,K,fa[202020];
ll i, j, k,l;

ll moddiv(ll a,ll b){
    for(ll m=MOD-2;m>0;m/=2){
        if(m&1){
            a=a*b%MOD;
        }
        b=b*b%MOD;
    }
    return a;
}


int main(){
    scanf("%lld%lld%lld", &N,&M,&K);
    fa[0] = 1;
    fornum(i,0,N*M){
        fa[i + 1] = fa[i] * (i + 1)%MOD;
    }
    ll n = moddiv(((N * (N + 1) % MOD * (2 * N + 1) % MOD) + MOD - (3 * N * (N + 1) % MOD)) % MOD, 12) * M%MOD*M % MOD;
    ll m = moddiv(((M * (M + 1) % MOD * (2 * M + 1) % MOD) + MOD - (3 * M * (M + 1) % MOD)) % MOD, 12) * N%MOD*N % MOD;
    //printf("%lld %lld ", n, m);
    printf("%lld", (n + m) % MOD * moddiv(fa[N * M - 2], fa[K - 2] * fa[N * M - K] % MOD) % MOD);
    return 0;
}


Measured memory_bytes: 1792
s=str(input())
ans=int(len(s)/2)

for i in range(97, 97+26):
  if chr(i) in s:
    ct= s.count(chr(i))
    place=[0]*ct
    for j in range(ct-1):
      place[0]=s.find(chr(i))+1
      place[j+1]=s[place[j]:].find(chr(i))+place[j]+1
    haba=max(len(s)-place[ct-1],place[0]-1)
    for j in range(ct-1):
      haba=max(haba,place[j+1]-place[j]-1)
    ans=min(ans,haba)

print(ans)

Measured memory_bytes: 3064
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

signed main() {
  string s;
  cin >> s;
  cout << string(sz(s), 'x') << endl;
  return (0 ^ _ ^ 0);
}



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

string s, t;
int dp[3005][3005][3] = {0};

string solve();

int main() {
  cin >> s >> t;
  cout << solve() << endl;
  return 0;
}

string solve() {
  string ans;
  int adata[3] = {0};
  int ch[2] = {0};
  for(int i = 0; i < t.size(); ++i)
    if(s[0] == t[i]) dp[0][i][0] = 1;
  for(int i = 0; i < s.size(); ++i)
    if(s[i] == t[0]) dp[i][0][0] = 1;
  for(int i = 0; i < s.size(); ++i)
    for(int j = 0; j < t.size(); ++j) {
      dp[i][j][1] = dp[i][j][2] = -1;
      if(i != 0 && dp[i][j][0] < dp[i - 1][j][0]) {
        dp[i][j][0] = dp[i - 1][j][0];
        dp[i][j][1] = i - 1;
        dp[i][j][2] = j;
      }
      if(j != 0 && dp[i][j][0] < dp[i][j - 1][0]) {
        dp[i][j][0] = dp[i][j - 1][0];
        dp[i][j][1] = i;
        dp[i][j][2] = j - 1;
      }
      if(i != 0 && j != 0 &&
         dp[i][j][0] <
             dp[i - 1][j - 1][0] + (s[i] == t[j])) {
        dp[i][j][0] = dp[i - 1][j - 1][0];
        dp[i][j][1] = i - 1;
        dp[i][j][2] = j - 1;
        dp[i][j][0] += (s[i] == t[j]);
      }
      if(adata[0] < dp[i][j][0]) {
        adata[0] = dp[i][j][0];
        adata[1] = i;
        adata[2] = j;
      }
    }
  ch[0] = ch[1] = -1;
  while(adata[1] >= 0 && adata[2] >= 0) {
    int x = adata[1], y = adata[2];
    if(s[x] == t[y] && x != ch[0] && y != ch[1]) {
      ans += s[x];
      ch[0] = x;
      ch[1] = y;
    }
    adata[1] = dp[x][y][1];
    adata[2] = dp[x][y][2];
  }
  reverse(ans.begin(), ans.end());
  return ans;
}

Measured memory_bytes: 105984
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1e12

#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>
#define vll vector<ll>
#define vpl vector<pll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pr_d(x) cout << fixed << setprecision(15) << x << endl
#define ud(c, x) distance(c.begin(), upper_bound(all(c), x))
#define ld(c, x) distance(c.begin(), lower_bound(all(c), x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep3(i, n) for (int i = (n - 1); i >= 0; --i)
#define rep4(i, a, b) for (int i = (a); i > (b); --i)
#define pb push_back
#define out(x) cout << x << "\n"
bool odd(int i) { return i % 2; }

#define all(v) v.begin(), v.end()
#define size(x) int(x.size())

int gcd(int a, int b) { return __gcd(a, b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
void Yes_No(bool f) {
  if (f)
    printf("Yes\n");
  else
    printf("No\n");
}
void YES_NO(bool f) {
  if (f)
    printf("YES\n");
  else
    printf("NO\n");
}

template <typename T>
void deb1(T x) {
  cout << "debug: " << x << "\n";
}

template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
//-------------------ここから回答する-----------------------

void solve(void) {
  int n;
  cin >> n;
  map<int, int> mp;
  rep(i, n) {
    int tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  int ans = 0;
  for (auto i : mp)
    if (odd(i.se)) ans++;
  out(ans);
}
int main(void) { solve(); }

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

int main()
{
    size_t N;
    long long D;
    cin >> N >> D;

    long long X, Y;
    size_t ans = 0;
    for (size_t i = 0; i < N; i++)
    {
        cin >> X >> Y;
        if (X * X + Y * Y <= D * D)
        {
            ans++;
        }
    }
    cout << ans << endl;
}


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

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i]--;
	}
	vector<int> b(n, 0);
	int s = 0;
	bool h = true;
	int count = 0;
	while (true) {
		if (s == 1) {
			break;
		}
		else {
			s = a[s];
			if (b[s] == 1) {
				h = false;
				break;
			}
			else {
				b[s] = 1;
				count++;
			}
		}
	}
	if (h) {
		cout << count << endl;
	}
	else {
		cout << -1 << endl;
	}
	return 0;
}

Measured memory_bytes: 1024
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

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



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;



int main() {
	int a, b, c;
	cin >> a >> b >> c;

	cout << min(b / a, c) << endl;
}


Measured memory_bytes: 3644
#include <stdio.h>

int main(){
  int A,B,T;
  scanf("%d %d %d", &A, &B, &T);
  
  int bisket=0;
  for(int i=1; i<=T; i++){
    if((i%A) == 0) bisket += B;
  }
  printf("%d", bisket);
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#include <numeric>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

using namespace std;

int main(){
	int n;
	cin >> n;
	int A[n];
	int Y[n] = {};
	int sum=0;
	rep(i,0,n){
		cin >> A[i];
		sum += A[i];
	}
	for(int i=1;i<n;i=i+2){
		sum -= 2*A[i];
	} // sum はY[0]の値が入ってる
	Y[0] = sum;
	cout << Y[0] << " ";
	rep(i,1,n){
		Y[i] = 2*A[i-1]-Y[i-1];
		cout << Y[i] << " ";
	}
	cout << endl;

}


Measured memory_bytes: 2048