akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;

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

double const pi = 3.1415926535;
int const mod = 1000000007;
int const inf = 2147483647;

int yesno(bool flag, string yes, string no) {
	if (flag)cout << yes << endl;
	else cout << no << endl;
	return 0;
}

int printint(int n) {
	cout << n << endl;
	return 0;
}

int prints(string s) {
	cout << s << endl;
	return 0;
}

char map[110][110];

int main() {

	for (int i = 1; i <= 100; i++) {
		for (int j = 1; j <= 100; j++) {
			if (i <= 50)map[i][j] = '#';
			else map[i][j] = '.';
		}
	}

	int a, b;
	cin >> a >> b;
	cout << "100 100" << endl;

	a--;
	b--;

	int i = 2;
	while (a >= 1) {
		for (int j = 2; j <= 98; j += 2) {
			if (a == 0)break;
			else {
				map[i][j] = '.';
				a--;
			}
		}
		i += 2;
	}

	i = 52;
	while (b >= 1) {
		for (int j = 2; j <= 98; j += 2) {
			if (b == 0)break;
			else {
				map[i][j] = '#';
				b--;
			}
		}
		i += 2;
	}

	for (int i = 1; i <= 100; i++) {
		for (int j = 1; j <= 100; j++) {
			cout << map[i][j];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long
main(){
  int n,r=0;
  cin>>n;
  vector<int> p(n),q(n);
  for(int i=0;i<n;++i)cin>>p[i],q[i]=i;
  sort(q.begin(),q.end(),[&](int a,int b){return p[a]>p[b];});
  multiset<int> s;
  s.insert(-1);s.insert(-1);
  s.insert(n);s.insert(n);
  for(auto i:q){
    s.insert(i);
    auto c=s.find(i);
    int l1,l2,r1,r2;
    c--;c--;
    l2=*(c++); l1=*(c++);
    r1=*(++c); r2=*(++c);
    r+=((r2-r1)*(i-l1) + (r1-i)*(l1-l2))*p[i];
  }
  cout<<r;
}

Measured memory_bytes: 6528
#include <stdbool.h>
#include <stdio.h>
int com(int n, int k, int* d) {
	while (n > 0) {
		for (int i = 0;i<k;i++) {
			if (n % 10 == d[i]) { 
				return false;
			}
		}
		n /= 10; 
	}
	return true; 
}
int main() {
	int n, k, d[10];
	scanf("%d%d", &n, &k);
	for (int i = 0;i < k;i++) {
		scanf("%d", &d[i]);
	}
	for (int i = n;;i++) {
		if (com(i, k, &d[0])) {
			printf("%d\n", i);
			break;
		}
	}

}

Measured memory_bytes: 128
N, D = map(int, input().split())

count = 0

import numpy as np

for i in range(N):
  X, Y = map(int, input().split())
  
  if np.sqrt(X ** 2 + Y ** 2) <= D:
    count += 1
    
  else:
    count += 0
    
print(count)    

Measured memory_bytes: 27144
#include<stdio.h>

int main(){

int A,B,C,D,E;
int ans=0,min=10;
scanf("%d%d%d%d%d",&A,&B,&C,&D,&E);

if (A%10==0){ans += A;}else{ ans += (A + 10-(A%10)); if (min>A%10){min = A%10;}}
if (B%10==0){ans += B;}else{ ans += (B + 10-(B%10)); if (min>B%10){min = B%10;}}
if (C%10==0){ans += C;}else{ ans += (C + 10-(C%10)); if (min>C%10){min = C%10;}}
if (D%10==0){ans += D;}else{ ans += (D + 10-(D%10)); if (min>D%10){min = D%10;}}
if (E%10==0){ans += E;}else{ ans += (E + 10-(E%10)); if (min>E%10){min = E%10;}}


printf("%d",ans-(10-min));

return 0;

}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
long long s;
int main() {
    cin >> s;
    long long v = 1e9;
    long long x = (v-s%v)%v;
    long long y = (s+x)/v;

    cout << 0 << " " << 0 << " " << 1000000000 << " " << 1 << " " << x << " " << y << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	double N,K;cin>>N>>K;
	double temp,count,sum=0;
	for(int i=1;i<=N;i++){
		temp=i;count=1;
		while(temp<K){
			temp*=2;
			count*=2;
		}sum+=1/count;
        //cout<<count<<endl;
	}cout<<setprecision(20)<<sum/N<<endl;
}

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

using namespace std;

int main(void){

	string ts, a, b, outstr;
	getline(cin, ts);

	a = ts.substr(0, ts.find(' '));
	b = ts.substr(ts.find(' ') + 1, ts.size());

	int ia, ib;
	ia = stoi(a);
	ib = stoi(b);

	if (ia < ib)
	{
		outstr = "a < b";
	}
	else
	if (ia > ib)
	{
		outstr = "a > b";
	}
	else
	{
		outstr = "a == b";
	}

	cout << outstr << endl;

	return 0;
}

Measured memory_bytes: 1192
#include <stdio.h>

int main(void) {
	int i, m, n, s[10001];
	scanf("%d%d", &n, &m);
	for (i = 0; i < m; i++)
	{
		scanf("%d", &s[i]);
		n -= s[i];
		if (n < 0)
		{
			printf("-1");
			break;
		}
	}
	if (n >= 0) printf("%d", n);
	return 0;
}

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

using namespace std;

const int MAX = 105;

int N;
int A[MAX];

int main(int argc, char* argv[]) {
    scanf("%d", &N);

    for (int i = 0; i < N; ++i) {
        scanf("%d", A + i);
    }

    int t = 0;

    for (int i = 0; i < N; ++i) {
        t += A[i];
    }

    if (t % N == 0) {
        int c = 0;
        int m = t / N;

        for (int i = 0; i < N; ++i) {
            c += (A[i] - m) * (A[i] - m);
        }

        printf("%d\n", c);

    } else {
        int c1 = 0;
        int m1 = t / N;

        int c2 = 0;
        int m2 = t / N + 1;

        for (int i = 0; i < N; ++i) {
            c1 += (A[i] - m1) * (A[i] - m1);
            c2 += (A[i] - m2) * (A[i] - m2);
        }

        int c = min(c1, c2);

        printf("%d\n", c);

    }

    return 0;
}


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

using namespace std;

using ll = long long;
using ull = unsigned long long;

int main(int argc, char const *argv[]) {
	ull a,b,c;
	std::cin >> a >> b >> c;
	ull k;
	std::cin >> k;

	std::cout << a+b+c+max(a,max(b,c))*(pow(2,k)-1) << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;

#define Rep(i,l,r) for (int i = (l); i <= (r); ++ i)
#define RepD(i,r,l) for (int i = (r); i >= (l); -- i)
#define RepG(i,x) for (int i = hd[x]; i; i = e[i].nxt)

typedef long long ll;

ll n, k;

int main () {
	ll ans = 0;
	scanf ("%lld%lld", &n, &k);
	ll a = n/k, b = (n+(k>>1))/k;
	ans += a*a*a;
	if ((k&1)^1) ans += b*b*b;
	printf ("%lld\n", ans);
	return 0;
}


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

#define dlog(str) cout << "====" << str << endl;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a, b) ((a < b) ? a : b)
#define _max(a, b) ((a < b) ? b : a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a) ? 1 : -1)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main() {
    int N;
    cin >> N;
    vector<int> a(N + 1), b(N);
    REP(i, N + 1) cin >> a[i]; // モンスターの数
    REP(i, N) cin >> b[i];     // 倒せる数
    LLI sum = 0;
    REP(i, N) {
        sum += min(a[i], b[i]);
        if(a[i] < b[i]) {
            b[i] -= a[i];
            sum += min(a[i + 1], b[i]);
            a[i + 1] -= min(a[i + 1], b[i]);
        }
    }
    cout << sum;
    return 0;
}

Measured memory_bytes: 1024
/*
 * atcoder/abc134/d.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

/*
 * 1の倍数の箱
 * 2
 * 3
 * 4
 * 5の倍数の箱
 * 5のみ: 5thが0の場合) 5th=0 1の場合) 5th=1
 * 4のみ: 4thが0の場合) 4th=0 1の場合) 4th=1
 * 3のみ
 * 2, 4 : 2thと4thが(0, 0)の場合) 
 * 1, 2, 3, 4, 5
 */
int N;
vector<int> A, B, C;
void solve() {
  cin >> N;
  A.assign(N+1, false);
  B.assign(N+1, false);
  loop(n,1,N+1) cin >> A[n];
  B[N] = A[N];
  for (int n=N-1; n>=1; n--) {
    int num1=0;
    for (int m=n; m<=N; m += n) {
      num1 += B[m];
    }
    if (A[n] != num1%2) B[n] = true;
  }

  for (int n=1; n<=N; n++) {
    if (B[n]) C.push_back(n);
  }
  cout << C.size() << endl;
  sort(C.begin(), C.end());
  dump(C);
}
int main() {
  // cout.precision(15); cout << fixed;

  solve();

  return 0;
}


Measured memory_bytes: 3064
n = gets.to_i
a1, a2, *rest = gets.split.map(&:to_i)
x = rest.inject(0, &:^)
ans = -1
if a1 + a2 >= x && (a1 + a2 - x)[0] == 0
	y = (a1 + a2 - x) / 2
	z = a1 + a2 - y * 2
	if y <= a1 && (z & y) == 0
		r = y
		60.downto(0){|i|
			if z[i] == 1 && r + (1 << i) <= a1
				r |= 1 << i
			end
		}
		if r > 0
			ans = a1 - r
		end
	end
end
puts ans


Measured memory_bytes: 14372
#include <bits/stdc++.h>
#define ll          long long int
#define uu          first
#define vv          second
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define INF         1e9
#define fastRead    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;

const int MAX = 1e6 + 6;
double dp[400][400][400];

int ara[4];

int main()
{
    fastRead;
    int n;
    cin>>n;
    for(int i = 0 ; i < n ; i++ ) {
        int tmp;
        cin>>tmp;
        ara[tmp]++;
    }
    
    for(int i = 0 ;i <= ara[3] ; i++ ) {
        for(int j = 0 ; j <= ara[2]+ ara[3] - i ; j++ ) {
            for(int k =0 ; k <= ara[3] + ara[2] + ara[1] - i - j ; k++ ) {
                if(i == 0 && j ==0 && k==0) continue;
                
                if(i) dp[i][j][k] += 1.0*i*dp[i-1][j+1][k];
                if(j) dp[i][j][k] += 1.0*j*dp[i][j-1][k+1];
                if(k) dp[i][j][k] += 1.0*k*dp[i][j][k-1];
                
                dp[i][j][k] += n;
                dp[i][j][k] /= 1.0*(i+j+k);
            }
        }
    }
    cout<<setprecision(12)<<fixed<<dp[ara[3]][ara[2]][ara[1]]<<'\n';
    return 0;
    
}

Measured memory_bytes: 145848
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(v) (v).begin(),(v).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a/gcd(a,b)*b; }
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        ll tmp = n/i;
        ans += (tmp*(tmp+1)/2)*i;
    }
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 3648
import java.util.*;

class Main{
	static Scanner s=new Scanner(System.in);
	static char[][]f=new char[40][99];
	public static void main(String[] $){
		for(int i=0;i<20;++i)
			Arrays.fill(f[i],'#');
		for(int i=20;i<40;++i)
			Arrays.fill(f[i],'.');
		f(0,'.');
		f(21,'#');
		System.out.println("40 99");
		Arrays.stream(f).forEach(System.out::println);
	}
	static void f(int b,char c){
		int a=s.nextInt()-1;
		for(int i=0;i<a;++i)
			f[i/50*2+b][i%50*2]=c;
	}
}


Measured memory_bytes: 29012
N=int(input())
s=[]

for i in range(N):
  s1=input()
  s.append(s1)
M=int(input())
t=[]
for i in range(M):
  t1=input()
  t.append(t1)
s.sort()
t.sort()
u=[0]
for i in range(N):
  x=s.count(s[i])-t.count(s[i])
  u.append(x)
print(max(u))

Measured memory_bytes: 3064
n = input()
x = {'S':[], 'H':[], 'C':[], 'D':[]}
for i in range(n):
    a = raw_input().split()
    x[a[0]].append(int(a[1]))
for key in ['S', 'H', 'C', 'D']:
    for i in range(13):
        for j in x[key]:
            if i+1 == j: break
        else: print key, i+1

Measured memory_bytes: 4220
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

#define MAX 20000
#define true 1
#define false 0

int top, top_P, top_A;
int Puddle[MAX];
int A[MAX];
int Stack[MAX];

int pop(){
  if(top == 0){
    exit(1);
  }
  top--;
  return Stack[top+1];
}

int pop_P(){
  if(top_P == 0){
    exit(1);
  }
  top_P--;
  return Puddle[top_P+1];
}

int pop_A(){
  if(top_A == 0){
    exit(1);
  }
  top_A--;
  return A[top_A+1];
}

void push(int x){
  top++;
  Stack[top] = x;
}

void push_P(int x){
  top_P++;
  Puddle[top_P] = x;
}

void push_A(int x){
  top_A++;
  A[top_A] = x;
}

int main(){
  char ch[MAX];
  int i, sum = 0;

  top = 0; top_P = 0; top_A = 0;
  Stack[top] = 0; Puddle[top_P] = 0; A[top_A] = 0;

  scanf("%s", ch);

  i = 0;
  while(ch[i] == '\\' || ch[i] == '/' || ch[i] == '_'){
    if(ch[i] == '\\'){
      push(i);
    }else if(ch[i] == '/' && top != 0){
      int tmp = pop();
      sum += i - tmp;
      int puddle = i - tmp;
      while(top_A != 0 && A[top_A] > tmp){
        pop_A();
        puddle += pop_P();
      }
      push_A(tmp);
      push_P(puddle);
    }
    i++;
  }

  printf("%d\n", sum);
  printf("%d", top_P);
  for(int i = 1; i <= top_P; i++){
    printf(" %d", Puddle[i]);
  }
  printf("\n");

  return 0;
}



Measured memory_bytes: 2092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define ARRAY_LENGTH(array) sizeof(array)/sizeof(*array)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
    ll s;
    cin >> s;

    ll m = 1;
    vector<bool> has_appeared(1e6 + 5, false);
    has_appeared[s] = true;
    bool flag = false;
    while(!flag) {
        ++m;
        if(s % 2 == 0) {
            s = s / 2;
        } else {
            s = 3*s + 1;
        }

        if(has_appeared[s]) {
            flag = true;
        } else {
            has_appeared[s] = true;
        }
    }

    cout << m << endl;

    return 0;
}

Measured memory_bytes: 3708
#include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define PER(i, a, b) for (int i = a; i >= b; --i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
#define mp make_pair
#define pb push_back
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
using namespace std;
 
typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> VI;

const int N = 200005;
int pi[N], n, out[N], on_tree[N], Q[N], sg[N], vis[N], va[N];
VI to[N];

void tok(int x){
	memset(va, 0, sizeof va);
	for (int i = pi[x]; i != x; i = pi[i]){
		RVC(j, to[i]) va[sg[to[i][j]]] = i;
		for (sg[i] = 0; va[sg[i]] == i || vis[sg[i]] == i; ++sg[i]);
	}
	// cerr << x << ' ' << sg[x] << endl;
	RVC(j, to[x]) va[sg[to[x][j]]] = x;
	int tmp = 0;
	for (; va[tmp] == x || vis[tmp] == x; ++tmp);
	if (tmp == sg[x]){
		puts("POSSIBLE");
		exit(0);
	}
}

int main(){
	scanf("%d", &n);
	REP(i, 1, n){
		scanf("%d", &pi[i]);
		to[pi[i]].pb(i);
		++out[pi[i]];
	}
	int hd = 1, tl = 0;
	REP(i, 1, n) if (!out[i]) Q[++tl] = i;
	while (hd <= tl){
		int x = Q[hd++];
		on_tree[x] = 1;
		--out[pi[x]];
		if (!out[pi[x]]) Q[++tl] = pi[x];
	}
	REP(i, 1, tl){
		int x = Q[i];
		RVC(j, to[x]) vis[sg[to[x][j]]] = x;
		for (sg[x] = 0; vis[sg[x]] == x; ++sg[x]);
	}
	REP(i, 1, n) if (!on_tree[i]){
		RVC(j, to[i]) if (on_tree[to[i][j]]) vis[sg[to[i][j]]] = i;
		for (sg[i] = 0; vis[sg[i]] == i; ++sg[i]);
		tok(i);
		for (++sg[i]; vis[sg[i]] == i; ++sg[i]);
		tok(i);
		return puts("IMPOSSIBLE"), 0;
	}
	return 0;
}

Measured memory_bytes: 15616
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

for i, p in enumerate(itertools.permutations(range(1, N + 1))):
    if p == P:
        pi = i + 1
    if p == Q:
        qi = i + 1

print(abs(pi - qi))

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

using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;


int32_t main() {
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    
    
    ini(n);
    int tmp = 0;
    FOR(i,1,n+1){
        if(i%3!=0 and i%5 !=0)tmp+=i;
    }
    out(tmp);
    
  
    
    
    
    
    
    
    
    return 0;
}


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

const int mnx = 3e5 + 9;
const int mod = 1e9 + 7;


int main(){

int n;
cin >> n;
double x[n + 5], y[n + 5];

double PI = acos(-1);

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

for(int i = 0; i < n; i++) {
vector<double> angle;
for(int j = 0; j < n; j++){
    if(j != i){
        angle.push_back(atan2(x[j] - x[i], y[j] - y[i]));
    }
}

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

angle.push_back(angle[0] + 2 * PI);

double res = 0;

for(int j = 0; j < n; j++) {
    if(angle[j + 1] - angle[j] > PI) res = angle[j + 1] - angle[j] - PI;
}

cout << fixed;
cout.precision(6);
cout << res / (2 * PI) << endl;

}



return 0;

}



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

namespace at
{
    class Program
    {
        static void Main(string[] args)
        {
            var ab = Console.ReadLine().Split(' ');
            var a = int.Parse(ab[0]);
            var b = int.Parse(ab[1]);
            if (b%a==0)
            {
                Console.WriteLine(a + b);
            }
            else
            {
                Console.WriteLine(b - a);
            }
        }
    }
}


Measured memory_bytes: 11092
package main

import "fmt"

func main() {
	var h, w int
	for {
		fmt.Scan(&h, &w)
		if h == 0 && w == 0 {
			break
		}
		for i := 0; i < h; i++ {
			if i == 0 || i == h - 1 {
				for j := 0; j < w; j++ {
					fmt.Print("#")
				}
				fmt.Print("\n")
				continue
			}
			fmt.Print("#")
			for l := 1; l < w - 1; l++ {
				fmt.Print(".")
			}
			fmt.Print("#")
			fmt.Print("\n")
		}
		fmt.Print("\n")
	}
}


Measured memory_bytes: 1096
#include<bits/stdtr1c++.h>
using namespace std;
int main(){
    int N;
    cin>>N;
    vector<int>L(N);
    for(int i=0;i<N;++i){
        cin>>L[i];
    }
    sort(L.begin(),L.end());
    reverse(L.begin(),L.end());
    int sum=0;
    for(int i=1;i<N;++i){
        sum+=L[i];
    }
    if(sum>L[0])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef std::int_fast64_t i64;
typedef std::uint_fast64_t u64;
typedef std::int_fast32_t i32;
typedef std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(std::vector<T>& vector, const typename std::vector<T>::size_type size) {
    vector.reserve(size);
    std::copy_n(std::istream_iterator<T>(std::cin), size, std::back_inserter(vector));
  }

  template <typename T, std::size_t N>
  void read(std::array<T, N>& array) {
    std::copy_n(std::istream_iterator<T>(std::cin), N, array.begin());
  }
}

#endif

// main.cpp

class clue {
public:
  i64 x, y, h;
  clue(const i64 x, const i64 y, const i64 h) :
    x(x), y(y), h(h) {
  }
  clue() :
    clue(0, 0, 0) {
  }
  i64 possible_H(const i64 C_X, const i64 C_Y) const {
    return this->h + std::abs(this->x - C_X) + std::abs(this->y - C_Y);
  }
  bool validate(const i64 C_X, const i64 C_Y, const i64 H) const {
    if (this->h > 0) {
      return H == this->possible_H(C_X, C_Y);
    } else {
      return H <= std::abs(this->x - C_X) + std::abs(this->y - C_Y);
    }
  }
  friend std::istream& operator>>(std::istream& is, clue& self) {
    return is >> self.x >> self.y >> self.h;
  }
};

int main() {
  i64 N;
  std::cin >> N;
  std::vector<clue> clues;
  tools::read(clues, N);

  const clue& representative = *std::find_if(clues.begin(), clues.end(), [](const clue& clue) { return clue.h > 0; });
  for (i64 C_X = 0; C_X <= 100; ++C_X) {
    for (i64 C_Y = 0; C_Y <= 100; ++C_Y) {
      const i64 H = representative.possible_H(C_X, C_Y);
      if (std::all_of(clues.begin(), clues.end(), [&C_X, &C_Y, &H](const clue& clue) { return clue.validate(C_X, C_Y, H); })) {
        std::cout << C_X << ' ' << C_Y << ' ' << H << std::endl;
        return 0;
      }
    }
  }

  return EXIT_FAILURE;
}

Measured memory_bytes: 256
#include <stdio.h>

int N;
double P[2999];
double dp[3000][3000];

int main() {
    scanf("%d", &N);
    dp[0][0] = 1;
    for (int i = 0; i < N; i++) {
        double p;
        scanf("%lf", &p);
        for (int j = 0; j <= i; j++) {
            dp[i + 1][j + 1] += dp[i][j] * p;
            dp[i + 1][j] += dp[i][j] * (1 - p);
        }
    }
    double ans = 0;
    for (int i = 0; i <= N; i++) {
        int j = N - i;
        if (i > j) {
            ans += dp[N][i];
        }
    }
    printf("%.15f\n", ans);
    return 0;
}


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

int main() {
	string s; cin >> s;
	char now = s[0];
	int ans = 0;
	for (int i = 1; i < s.size(); i++) {
		if (now != s[i])ans++, now = s[i];
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1<<30;
int main(){
	int n;
	while(cin>>n,n){
		int a;
		cin>>a;
		vp in;
		in.pb(pii(a,1));
		rep(i,n-1){
			cin>>a;
			int s=in.size();
			if(i%2||in[s-1].first==a){
				if(in[s-1].first==a)in[s-1].second++;
				else in.pb(pii(a,1));
			}else{
				in[s-1].first^=1;
				in[s-1].second++;
				if(s>1){
					in[s-2].second+=in[s-1].second;
					in.erase(in.begin()+s-1);
				}
			}
		}
		int co=0;
		rep(i,in.size())if(!in[i].first)co+=in[i].second;
		cout<<co<<endl;
	}
}

Measured memory_bytes: 1196
#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;

typedef long long LL;

// a b c -> a-b
// b+c a+c a+b -> b-a
// 2a+b+c 2b+a+c 2c+a+b -> a-b
// 2a+3b+3c 2b+3a+3c 2c+3a+3b -> b-a
// 

int main()
{
	LL a,b,c,k;
	cin>>a>>b>>c>>k;
	cout<<((k&1)?b-a:a-b)<<endl;
	return 0;
}

Measured memory_bytes: 256
from sys import stdin
input = stdin.readline
def BFS(K,path,N):
  """リストのリスト道順path,頂点の個数Nが与えられたとき, 頂点Kから各頂点までの距離をlistで返す"""
  from collections import deque
  dist=[-1]*N
  dist[K]=0
  que=deque()
  que.append(K)
  while len(que):
    label=que.popleft()
    for i,c in path[label]:
      if dist[i]==-1:
        dist[i]=dist[label]+c
        que+=[i]
  return dist
 
N=int(input())
path=[ [] for i in range(N)]
for i in range(N-1):
  a,b,c=map(int,input().split())
  path[a-1]+=[(b-1,c)]
  path[b-1]+=[(a-1,c)]
Q,K=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(Q)]
distance=BFS(K-1,path,N)
for i in range(Q):
  print(distance[xy[i][0]-1]+distance[xy[i][1]-1])

Measured memory_bytes: 68024
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()

print(n + n**2 + n** 3)

Measured memory_bytes: 65120
import java.util.*;

class Main{
  static int mod=1000000007;
  static Map<Integer,Integer> pFacMap(int x){
    Map<Integer,Integer> res=new HashMap<>();
    for(int i=2;i*i<=x;i++){
      if(x%i==0){
        int p=0;
        while(x%i==0){
          x/=i;
          p++;
        }
        res.put(i,p);
      }
    }
    if(x!=1){
      res.put(x,1);
    }
    return res;
  }
  static long repow(int b,int p){
    long res=1;
    long a=b;
    while(p>0){
      if((p&1)==1){
        res=(res*a)%mod;
      }
      p=p>>1;
      a=(a*a)%mod;
    }
    return res;
  }
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int[] a=new int[n];
    for(int i=0;i<n;i++){
      a[i]=sc.nextInt();
    }
    M[] ma=new M[n];
    for(int i=0;i<n;i++){
      ma[i]=new M();
      ma[i].m=pFacMap(a[i]);
    }
//    System.err.println(Arrays.deepToString(ma));
    Map<Integer,Integer> mp=new HashMap<>();
    for(int i=0;i<n;i++){
      for(Map.Entry<Integer,Integer> me:ma[i].m.entrySet()){
        if(mp.getOrDefault(me.getKey(),0)<me.getValue()){
          mp.put(me.getKey(),me.getValue());
        }
      }
    }
//    System.err.println(mp);
    long[] inv=new long[1000001];
    inv[1]=1;
    for(int i=2;i<=1000000;i++){
      inv[i]=mod-inv[(int)(mod%i)]*(mod/i)%mod;
    }
//    System.err.println(Arrays.toString(inv));
    long flat=1;
    for(Map.Entry<Integer,Integer> me:mp.entrySet()){
      flat=(flat*repow(me.getKey(),me.getValue()))%mod;
    }
    long ans=0;
    for(int i=0;i<n;i++){
      long kk=(flat*inv[a[i]])%mod;
      ans=(ans+kk)%mod;
    }
    System.out.println(ans);
  }
  static class M{
    Map<Integer,Integer> m;
    public String toString(){
      return m.toString();
    }
  }
}

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

#define MOD 1000000007

using namespace std;

int qmul(int x, int k) {
	if (k == 0) return 1;
	int t = qmul(x, k / 2);
	t = 1LL * t * t % MOD;
	if (k & 1) t = 1LL * t * x % MOD;
	return t;
}

int get(int n, int x) {
	int u = 1, d = 1;
	for (int i = 0; i < x; i++) {
		u = 1LL * u * (n - i) % MOD;
		d = 1LL * d * (i + 1) % MOD;
	}
	d = qmul(d, MOD - 2);
	return 1LL * u * d % MOD;
}

int main() {
	int n, k;
	cin >> n >> k;
	vector<int> cn(n + 1), cn1(n + 1);
	int u1 = 1, u2 = 1;
	int d = 1, id;
	for (int i = 0; i <= n - 1; i++) {
		u1 = 1LL * u1 * (n - 1 - i) % MOD;
		u2 = 1LL * u2 * (n - i) % MOD;
		d = 1LL * d * (i + 1) % MOD;
		id = qmul(d, MOD - 2);
		cn[i + 1] = 1LL * u2 * id % MOD;
		cn1[i + 1] = 1LL * u1 * id % MOD;
	}
	// for (int i = 1; i < n; i++) {
	// 	cout << cn1[i] << " ";
	// }
	// cout << endl;
	// for (int i = 1; i < n; i++) {
	// 	cout << cn[i] << " ";
	// }
	// cout << endl;
	vector<int> c(n + 1);
	c[0] = 1;
	for (int i = 1; i < n; i++) {
		c[i] = 1LL * cn1[i] * cn[i] % MOD;
		c[i] = (c[i] + c[i - 1]) % MOD;
	}
	cout << c[min(n - 1, k)] << endl;
	return 0;
}

Measured memory_bytes: 2688
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <map>
using namespace std;

int main() {
    int a, b, x;
    cin >> a >> b >> x;
    if (x - a > b || x - a < 0) {
        cout << "NO" << endl;
    }
    else cout << "YES" << endl;
}

Measured memory_bytes: 256
import itertools
import os
import sys
from collections import defaultdict

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
# MOD = 10 ** 9 + 7
MOD = 998244353

# 解説
# 大きい方から貪欲に取るのの見方を変えるとゲームになる

N = int(sys.stdin.buffer.readline())
M = []
m = int(sys.stdin.buffer.readline())
M.append(m)
XVU = [list(map(int, sys.stdin.buffer.readline().split())) for _ in range(m)]
m = int(sys.stdin.buffer.readline())
M.append(m)
YVU = [list(map(int, sys.stdin.buffer.readline().split())) for _ in range(m)]
m = int(sys.stdin.buffer.readline())
M.append(m)
ZVU = [list(map(int, sys.stdin.buffer.readline().split())) for _ in range(m)]

X = [[] for _ in range(N)]
Y = [[] for _ in range(N)]
Z = [[] for _ in range(N)]
for G, VU in zip([X, Y, Z], (XVU, YVU, ZVU)):
    for v, u in VU:
        v -= 1
        u -= 1
        if v > u:
            v, u = u, v
        G[v].append(u)


def grundy(graph):
    ret = [-1] * N
    for v in reversed(range(N)):
        gs = set()
        for u in graph[v]:
            gs.add(ret[u])
        g = 0
        while g in gs:
            g += 1
        ret[v] = g
    return ret


grundy_x = defaultdict(list)
grundy_y = defaultdict(list)
grundy_z = defaultdict(list)
for x, g in enumerate(grundy(X), 1):
    grundy_x[g].append(x)
for y, g in enumerate(grundy(Y), 1):
    grundy_y[g].append(y)
for z, g in enumerate(grundy(Z), 1):
    grundy_z[g].append(z)

# base[i]: (10^18)^i
base = [1]
for _ in range(N * 3 + 10):
    base.append(base[-1] * pow(10, 18, MOD) % MOD)

ans = 0
for xg, yg in itertools.product(grundy_x.keys(), grundy_y.keys()):
    zg = xg ^ yg
    # 10^(x1+y1+z1) + 10^(x1+y1+z2) + ... + 10^(x1+y2+z1) + ...
    # = (10^x1 + 10^x2 + ...) * (10^y1 + ...) * (10^z1 + ...)
    xs = 0
    ys = 0
    zs = 0
    for x in grundy_x[xg]:
        xs += base[x]
    for y in grundy_y[yg]:
        ys += base[y]
    for z in grundy_z[zg]:
        zs += base[z]
    ans += xs % MOD * ys % MOD * zs % MOD
    ans %= MOD
print(ans)


Measured memory_bytes: 130056
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define pr(num) printf("%lld\n", num)
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 1000000000000000000
#define MOD 1000000007LL
#define MAX 100010
#define BLACK 0
#define WHITE 1
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef map<ll, ll> Map;

int main(void) {
    ll N, K;
    cin >> N >> K;
    ll i;
    ll h[100100];
    ll ans=INF;
    
    for(i=0; i<N; i++) {
        cin >> h[i];
    }
    sort(h, h+N);
    
    for(i=0; i<=N-K; i++) {
        ans=min(ans, h[i+K-1]-h[i]);
    }
    
    pr(ans);
    
}



Measured memory_bytes: 1024
module.exports=function(r){var e={};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},t.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,e){if(1&e&&(r=t(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var o in r)t.d(n,o,function(e){return r[e]}.bind(null,o));return n},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},t.p="",t(t.s=0)}([function(r,e,t){t(1)(t(2).readFileSync("/dev/stdin","UTF-8"))},function(r,e){function t(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=[],n=!0,o=!1,u=void 0;try{for(var i,f=r[Symbol.iterator]();!(n=(i=f.next()).done)&&(t.push(i.value),!e||t.length!==e);n=!0);}catch(r){o=!0,u=r}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return t}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r.exports=function(r){for(var e=r.split("\n"),n=t(e[0].split(" ").map(function(r){return Number(r)}),2),o=n[0],u=n[1],i=e[1],f=0,l=0;l<o;l++){var a=!1;"L"==i[l]?l>0&&"L"==i[l-1]&&(a=!0):l<o-1&&"R"==i[l+1]&&(a=!0),a&&(f+=1)}var c=Math.min(o-1,2*u+f);console.log(c)}},function(r,e){r.exports=require("fs")}]);

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

using namespace std;

using ll = long long;

ll a[105];
bool b[105];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    ll ans = 0;
    int m = 0;
    while (true) {
        if (m * m > n) {
            break;
        }
        m++;
    }
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        ans += a[i];
    }
    for (int x = n + 1; x > 0; x--) {
        for (int i = n; i > 0; i--) {
            b[i] = (i % x == 0);
        }
        for (int i = n; i > 0; i--) {
            ll tmp = 0;
            for (int j = i; j <= n; j += i) {
                if (!b[j]) tmp += a[j];
            }
            if (tmp <= 0) {
                for (int j = i; j <= n; j += i) {
                    b[j] = true;
                }
            }
        }
        ll tmp = 0;
        for (int i = 1; i <= n; i++) {
            if (!b[i]) tmp += a[i];
        }
        ans = max(ans, tmp);
    }
    for (int s = 0; s < (1 << m); s++) {
        for (int i = n; i > 0; i--) {
            b[i] = false;
            for (int j = 0; j < m; j++) {
                if (s & (1 << j)) {
                    if (i % (j + 1) == 0) b[i] = true;
                }
            }
        }
        for (int i = n; i > 0; i--) {
            ll tmp = 0;
            for (int j = i; j <= n; j += i) {
                if (!b[j]) tmp += a[j];
            }
            if (tmp <= 0) {
                for (int j = i; j <= n; j += i) {
                    b[j] = true;
                }
            }
        }
        ll tmp = 0;
        for (int i = 1; i <= n; i++) {
            if (!b[i]) tmp += a[i];
        }
        ans = max(ans, tmp);
    }

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  int p[n];
  for(int i=0;i<n;i++)
    cin>>p[i];
  int c=1;
  int min=p[0];
  for(int i=1;i<n;i++)
  {
       if(min>=p[i])
       {
         min=p[i];
         c++;
       }
  }
  cout<<c;
       
}

Measured memory_bytes: 1024
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
a_li = na()
ans = -1
for i in range(n):
    for j in range(i+1, n):
        ans = max(ans, abs(a_li[i] - a_li[j]))
print(ans)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define int 		  long long
#define	pb 			  push_back
#define all(a)		  (a).begin(),(a).end()
#define sz(x)		  (int)x.size()
#define endl	 	  "\n"
#define inf 		  1000000007
#define FOR(i, a, b)  for(int i=a; i<b; i++)
int dp[1000001] = {inf};

void solve(){
	string w[7] = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
	string s;
	cin>>s;
	FOR(i, 0, 7){
		if(w[i]=="SUN"){
			cout<<'7';
			return;
		}
		if(w[i]==s){
			cout<<7-i-1;
			return;
		}
	}
}
signed main(){
	#ifdef _DEBUG
		freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
	#endif
	
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
	return 0;
 
}

Measured memory_bytes: 256
ope1,ope2,ope3,ope4,concent,capacity = map(int,input().split())
ope1 *= 100
ope2 *= 100
noudo = 0
check = 0
check_capacity = 0
result =str(ope1)+" "+"0"

for i in range(int(capacity / ope1)+1):
    for x in range(int( (capacity -(i*ope1)) /ope2 )+1):
        if i+x == 0:
            continue
        for y in range(int( (capacity -(i*ope1 +x*ope2)) /ope3)+1):
            for z in range( int( (capacity -(i*ope1 +x*ope2 +y*ope3) ) /ope4)+1):
                if y+z ==0:
                    continue
                check = (100 *(y*ope3 + z*ope4)) / ( i*ope1 + x*ope2 + y*ope3 + z*ope4)

                if check > noudo and ((i*ope1+x*ope2)/100)*concent>= y*ope3+z*ope4:
                    noudo = check
                    result = (str(i*ope1+x*ope2+y*ope3+z*ope4)+" "+str(y*ope3+z*ope4))
print(result)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define INF 100000000
typedef long long ll;

int main(){
    string S;
    cin>>S;
    ll ans=0;
    if(S[0]=='o')ans++;
    if(S[1]=='o')ans++;
    if(S[2]=='o')ans++;
    cout<<700+ans*100;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static String Y = "Yes";
	public static String N = "No";
	public static String I = "IMPOSSIBLE";
	public static String B = "Bad";
	public static String G = "Good";
	public static long MOD = (long) (Math.pow(10, 9) + 7);
	public static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int k = ni();

		int a = ni();
		int b = ni();

		boolean f = false;

		for (int i = a; i <= b; i++) {
			if (i % k == 0) {
				f = true;
				break;
			}
		}
		if (f) {
			out("OK");
		} else {
			out("NG");
		}

	}

	public static int count(String search, String text) {
		int nsearch = search.length();
		int ntext = text.length();
		int count = 0;

		for (int i = 0; i <= ntext - nsearch + 1; i++) {
			for (int j = i + nsearch - 1; j < ntext; j++) {
				if (search.equals(text.substring(i, j + 1))) {
					count++;
				}
			}
		}

		return count;
	}

	/*
	 * 以下メソッド集
	 */
	static int ni() {
		return sc.nextInt();
	}

	static long nl() {
		return sc.nextLong();
	}

	static String n() {
		return sc.next();
	}

	static char[] nc() {
		return sc.next().toCharArray();
	}

	static int kaijo(int n) {
		if (n == 0 || n == 1) {
			return 1;
		} else {
			return n * kaijo(n - 1);
		}
	}

	static int fib(int n) {
		return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);
	}

	static long lcm(long m, long n) {

		return m * n / gcd(m, n);
	}

	static int lcm(int m, int n) {

		return m * n / gcd(m, n);
	}

	static long gcd(long a, long b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

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

	static void out(String info) {
		System.out.println(info);
	}

	static void out(int info) {
		System.out.println(info);
	}

	static void out(double info) {
		System.out.println(info);
	}

	static void out(long info) {
		System.out.println(info);
	}

	static void out(char info) {
		System.out.println(info);
	}

	static void outn(String info) {
		System.out.print(info);
	}

	static void outn(int info) {
		System.out.print(info);
	}

	static void outn(double info) {
		System.out.print(info);
	}

	static void outn(long info) {
		System.out.print(info);
	}

	static void outn(char info) {
		System.out.print(info);
	}

	static int max(int a, int b) {
		return Math.max(a, b);
	}

	static long max(long a, long b) {
		return Math.max(a, b);
	}

	static int min(int a, int b) {
		return Math.min(a, b);
	}

	static long min(long a, long b) {
		return Math.min(a, b);
	}
}


Measured memory_bytes: 35748
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5+1;
int n,a[N],cnt[N*2];
int main()
{
	cin>>n;
	for(int i=1;i<=n;++i)cin>>a[i];
	for(int i=1;i<=n;++i)cnt[a[i]+1]++;
	int ans=0;
	for(int i=0;i<=100001;++i)
	ans=max(ans,cnt[i]+cnt[i+1]+cnt[i+2]);
	cout<<ans;
}

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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;

int main(){
  ll N; cin>>N;
  ll K; cin>>K;
  vector<ll> A(N+1);
  rep1(i,N+1)cin>>A.at(i);
  vector<ll> C;
  vector<int> seen(N+1,false);
  ll now = 1;
  while(1){
    if(seen.at(now))break;
    else{
      C.push_back(now);
      seen.at(now)=1;
      now = A.at(now);
    }
  }
  ll loop = C.size();
  ll pre = 0;
  rep(i,loop)if(C.at(i)==now){
    pre = i;
    break;
  }
  loop = loop-pre;
  if(K<(ll)C.size()){
    cout<<C.at(K)<<endl;
    return 0;
  }
  K-=pre;
  cout<<C.at(pre+K%loop)<<endl;
  
}


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

#define ll long long int
//#define PI acos(1.0)

#define Bit_off(val,pos)       (val & (~(1<<pos)))
#define Bit_on(val,pos)        (val | (1<<pos))
#define Bit_toggle(val,pos)    (val ^ (1<<pos))
#define Bit_check(val,pos)     (bool)(val & (1<<pos))
#define odd_even(val)          (bool)(val & 1)
#define koita_1_ase(val)       (__builtin_popcount(val))

ll ar[500009],br[500009],cr[500009];
map<ll,ll>mp,mp1;
vector<ll>v;
string s,d;

int main()
{
    ll a,b,c,i,j,k,x,y,z,f,g,h;
    cin>>b;
    x=0;
    for(i=2;i<=b;i++)
    {
        cin>>c;
       ar[c]++;
    }
    for(i=1;i<=b;i++)
    {
        cout<<ar[i]<<endl;
    }
}



Measured memory_bytes: 5192
#include <bits/stdc++.h>
#define int long long
using namespace std;
//string sort (s.begin(),s.end());

main() {
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);


      string s;
      cin>>s;
       map<char,int>mp;

       for(int i=0;i<s.size();i++)
       {




          mp[s[i]]++;
       }

         map<char, int>::iterator itr;
         int k=0;
          for (itr = mp.begin(); itr != mp.end(); ++itr) {
                if((itr->second)&1)
                {
                    k=1;
                    break;
                }


          }
          if(k)
          {
              cout<<"No"<<endl;
          }
          else
          {
              cout<<"Yes"<<endl;
          }


}



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

const int N=1e5+30;
typedef long long ll;
int n,m,arr[300];
int sum;
int main()
{
    cin>>n>>m;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum+=arr[i];
    }
    int ans=0;

    for(int i=0;i<n;i++){
        if(arr[i]*(4*m)>=sum)ans++;
    }
    if(ans>=m)puts("Yes");
    else puts("No");
}


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

#define ll long long
#define pb push_back
#define mp make_pair

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

	/*#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r+", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w+", stdout);
	#endif*/

    int a,b,c;
    cin >> a >> b >> c;
    swap(a,b);
    swap(a,c);
    cout << a << " " << b << " " << c << '\n';
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef long long int lli;

int main(){
    int flag1;
    lli N, *H, cnt, i;
    scanf("%lld", &N);
    H = (lli *)malloc(sizeof(lli) * N);
    for(i=0; i<N; i++)scanf("%lld", &H[i]);
    cnt = 0;
    for(i = 0; i<N; i++)
    {
        if(H[i]!=i+1)cnt += 1;
        if(cnt==3)break;
    }
    if(cnt==3)fprintf(stdout, "NO\n");
    else     fprintf(stdout, "YES\n");
    free(H);
}

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

using namespace std;

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

  long long n;
  int ans = 0;

  cin >> n;
  for (int x = 1; x <= 9; ++x) {
    if (x > n) {
      break;
    }

    long long m = x;
    int sum = x;
    while (m * 10 + 9 <= n) {
      m = m * 10 + 9;
      sum += 9;
    }
    
    ans = max(ans, sum);
  }

  cout << ans << '\n';
}


Measured memory_bytes: 256
#if defined(__GNUC__)
#include <bits/stdc++.h>
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#if defined(__GNUC__)
#define __int32 __int32_t
#endif // __GNUC__

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))
#define ACM(x, y) std::accumulate(ALL(x), y)

#define INT_POW(x, y) [](int a, int b) -> int {if(b == 0){return 1;} int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {if(b == 0){return 1;} int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)

itn main() {
	std::ios::sync_with_stdio(false);

	int kMod = 1'000'000'007;

	int n;

	cin >> n;

	vector<int> a(n);

	REP(i, n) {
		cin >> a[i];
	}

	//if (n == 1) {
	//	if (a[0]) {
	//		cout << 0;
	//	}
	//	else {
	//		cout << 1;
	//	}
	//}

	SORT(a);

	int check = (n + 1) % 2;

	REP(i, n) {
		if (a[i] != check) {
			cout << 0;
			return 0;
		}
		if (n % 2 != i % 2) {
			check += 2;
		}
	}

	n /= 2;

	int res = INT_POWM(2, n, kMod);

	cout << res;

	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long 
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define pb push_back

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
 
// debug templates 
#define debug(x)       cerr<< #x <<" : "<< x << endl;
#define debuga(A,N)    cerr<< #A <<" : [";for(int i = 0; i<N;i++) cerr<<A[i]<<" "; cerr<<"]\n";
#define debuga2(A,N,M) cerr<< #A << " : \n"; for(int i=0;i<N;i++){cerr<<"[";for(int j=0;j<M;++j) cerr<<A[i][j]<<" ";cerr<<"]\n";}
#define debugp(p)      cerr<< #p <<" : "<<"("<<(p).first<<","<<(p).second<<")\n";
#define debugv(v)      cerr<< #v <<" : "<<"[";for(int i = 0; i< (v).size(); i++) cerr<<v[i]<<" "; cerr<<"]\n";
#define debugv2(v)     cerr<< #v << " : \n"; for(int i=0;i<v.size();i++){cerr<<"[";for(int j=0;j<(v[0].size());++j) cerr<<v[i][j]<<" ";cerr<<"]\n";}
#define debugs(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin(); itr!=m.end();itr++) cerr<<*itr<<" "; cerr<<"]\n";
#define debugm(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin();itr!=m.end(); itr++) cerr<<"("<<itr->first<<","<<itr->second<<") ";cerr<<"]\n";
 

void solve(){
	int a,b; cin >> a >> b;
	if(a<=5) cout << 0;
	else if(a<=12) cout << b/2;
	else cout << b;
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	solve();
	return 0;
}
 


Measured memory_bytes: 3652