akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Graph= vector<vector<ll>>;
struct edge{ll to ; ll cost ;} ;
using graph =vector<vector<edge>> ;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
#define set20 cout<<fixed<<setprecision(20) ;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
double pi=acos(-1) ;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
 
 int  d[250000]  ;
 int p[250000] ;
 int main(){
  rep(i,250000) {
    d[i]=0 ;
    p[i]=0 ;
  }
  rep2(i,2,249999){
    if(d[i]!=0) continue ;
    int j=2 ;
    while(i*j<=249999){
     d[i*j]++ ;
     j++ ;
    }
  }
  rep2(i,2,249999){
   if(d[i]==0) p[i]=p[i-1]+1 ;
   else p[i]=p[i-1] ;
  }
  while(1){
    int n ; cin>> n ;
    if(n==0) return 0 ;
     cout<< p[2*n]-p[n]<<endl ;
  }
   return 0 ;
 }




Measured memory_bytes: 5020
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
#include <bitset>
#include <string>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define all(x) (x).begin(),(x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){return vector<T>(a);}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));}

ll modpow(ll x, ll n) {
    if (n == 0) {
        return 1;
    } else if (n % 2 == 0) {
        ll h = modpow(x, n / 2);
        return h * h % MOD;
    } else {
        return x * modpow(x, n - 1) % MOD;
    }
}

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

int vector_finder(vector<int> vec, int number) {
  auto itr = find(vec.begin(), vec.end(), number);
  size_t index = distance(vec.begin(), itr);
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
    int N,K; cin >> N >> K;
    // vector<int> A(N);
    // rep(i, N) cin >> A[i];
    // vector<int> f(N), l(N);
    // f[0] = abs(A[0]), l[0] = abs(A[N-1]);
    // reps(i,N-1){ // 累積和を計算
    //   f[i] = abs(A[i] - A[i-1]) + f[i-1];
    //   l[i] = abs(A[N-i-1] - A[N-i]) + l[i-1];
    // }
    // rep(i,N){
    //   if (i == 0) cout << l[N-2] + abs(A[1]) << endl;
    //   else if (i == N-1) cout << f[N-2] + abs(A[N-2]) << endl;
    //   else  cout << f[i-1] + l[N-2-i] + abs(A[i+1]-A[i-1]) << endl;
    // }
    cout << N-K+1<< endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
     
using namespace std;
     
typedef long long ll;
typedef pair<int, int> pii;
     
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
     
mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count());

const int N = 305;
bool ban[N];
int cnt[N];

int main(){
    fastIO;
    int n, m;
    cin >> n >> m;
    int a[n][m];
    for(int i = 0 ; i < n; i ++ ){
        for(int j = 0 ; j < m ; j ++ ){
            cin >> a[i][j];
            a[i][j] -- ;
        }
    }
    int answ = n;
    for(int i = 0 ; i  < m ; i ++ ){
        vector<pii> costl;
        for(int j = 0 ; j < m ; j ++ )
            cnt[j] = 0;
        for(int j = 0 ; j < n; j ++ ){
            for(int t = 0; t < m ; t ++ ){
                if(ban[a[j][t]] == false){
                    cnt[a[j][t]] ++ ;
                    break;
                }
            }
        }
        for(int j = 0 ; j < m ; j ++ )
            if(!ban[j])
                costl.push_back(mp(cnt[j], j));
        sort(costl.begin(), costl.end());
        reverse(costl.begin(), costl.end());
        answ = min(answ, costl[0].fi);
        ban[costl[0].se] = true;
    }
    cout << answ;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

int N;
ll L,T;
vector<ll> X;
vector<int> W;

int main(){
	cin>>N>>L>>T;
	X.resize(N);
	W.resize(N);
	rep(i,N) cin>>X[i]>>W[i];
	vector<ll> tmp(N);
	rep(i,N){
		if(W[i]==1) tmp[i]=(X[i]+T)%L;
		else tmp[i]=((X[i]-T)%L+L)%L;
	}

	sort(all(tmp));
	ll count=0;
	rep(i,N){
		if(W[i]==1) count-=(T-(L-X[i])+L)/L;
		else count+=(T-(X[i]+1)+L)/L;
	}
	count=(count%N+N)%N;
	vector<ll> res(N);
	rep(i,N) res[(i+count)%N]=tmp[i];
	rep(i,N) cout<<res[i]<<endl;
}

Measured memory_bytes: 3968
///not today

#include<bits/stdc++.h>
using namespace std;

#define SZ(x) (int)(x).size()
#define pb push_back
#define ll long long
#define xmax(x, y) (x) = max((x), (y))
#define xmin(x, y) (x) = min((x), (y))
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<long long, long long>
#define int long long
#define pipii pair<int, pair<int, int> >
#define pf push_front

ll x = (ll)1000* 1000* 1000* 1000* 1000* 1000;

int32_t main(){
    int a, b, c, k;
    cin >>a >>b >>c >>k;
    if(k% 2){
        if(b - a > x)
            cout <<"Unfair" <<endl;
        else
            cout <<b - a <<endl;
    }
    else{
        if(a - b > x)
            cout <<"Unfair" <<endl;
        else
            cout <<a - b <<endl;
    }
}


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

using namespace std;

#define rep(loop, N) for (int loop = 0; loop < N; loop++)

struct Node {
	Node* parent = NULL;
	vector<Node*> child;
	long long value = 0;
};
struct Edge {
	int parent = 0;
	int child = 0;
	bool operator <(const Edge& right) const { return parent < right.parent; }
};
struct Tree {
	vector<Node> node;
	Tree(int, vector<Edge>);
};
Tree::Tree(int nodeNum, vector<Edge> edge) {
	node.resize(nodeNum);
	for (Edge& it : edge) {
		node[it.child].parent = &node[it.parent];
		node[it.parent].child.push_back(&node[it.child]);
	}
}

map<long long, int> factorization(long long N) {
	map<long long, int> re;
	while (true) {
		if (N % 2 == 0) {
			N /= 2;
			re[2]++;
			if (N == 1) break;
		}
		else {
			break;
		}
	}
	for (int loop = 3; (long long)loop * (long long)loop <= N; loop += 2) {
		if (N % loop == 0) {
			N /= loop;
			re[loop]++;
			loop -= 2;
			if (N == 1) break;
		}
	}
	if (N > 1) re[N]++;
	return re;
}
long long gcd(long long num1, long long num2) {
	return num2 == 0 ? num1 : gcd(num2, num1 % num2);
}

struct Memo {
	long long fact = 0;
	long long fact_inv = 0;
	long long inv = 0;
};
class Combination1 {
private:
	long long m_module = 1000000007;
	vector<struct Memo> memo;
public:
	long long calculate(int, int);
	Combination1(int, long long);
};
long long Combination1::calculate(int n, int k) {
	return ((memo[n].fact * memo[k].fact_inv) % m_module * memo[n - k].fact_inv) % m_module;
}
Combination1::Combination1(int memo_max, long long module = 1000000007) {
	m_module = module;
	memo.push_back({ 1,1,0 });
	memo.push_back({ 1,1,1 });
	for (int loop = 2; loop <= memo_max; loop++) {
		struct Memo temp;
		temp.fact = (memo[loop - 1].fact * loop) % m_module;
		temp.inv = m_module - (memo[m_module % loop].inv * int(m_module / loop)) % m_module;
		temp.fact_inv = (memo[loop - 1].fact_inv * temp.inv) % m_module;
		memo.push_back(temp);
	}
}

class Combination2 {
private:
	int size = 0;
	bool add(int);
public:
	vector<int> sequence;
	bool next_combination(void);
	Combination2(int, int);
};
bool Combination2::add(int index) {
	if (index == (int)sequence.size() - 1 && sequence[index] == size - 1
		|| index < (int)sequence.size() - 1 && sequence[index] == sequence[index + 1] - 1) {
		if (index == 0) {
			return false;
		}
		else {
			bool re = add(index - 1);
			sequence[index] = sequence[index - 1] + 1;
			return re;
		}
	}
	else {
		sequence[index]++;
		return true;
	}
}
bool Combination2::next_combination(void) {
	return (sequence.size() == 0) ? false : add(sequence.size() - 1);
}
Combination2::Combination2(int n, int r) {
	size = n;
	for (int loop = 0; loop < r; loop++) sequence.push_back(loop);
	return;
}

void A_Dodecagon(void) {

	int r; cin >> r;
	
	cout << 3 * r * r << endl;
	return;
}

void B_Golden_Apple(void) {

	int N, D; cin >> N >> D;

	cout << (int)ceil((double)N / (double)(2 * D + 1)) << endl;
	return;
}

int main(void) {

	cout << fixed << setprecision(15);

	//A_Dodecagon();
	B_Golden_Apple();
	return 0;
}


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

total = 0
m = 0

for j in range(1, N):

    ic = {
        "R": 0,
        "G": 0,
        "B": 0
    }

    kc = {
        "R": 0,
        "G": 0,
        "B": 0
    }

    m = 0

    for i in range(j-1, -1, -1):
        ic[S[i]] += 1
    
    for k in range(j+1, N):
        kc[S[k]] += 1

    for l in range(min(j+1, N-j)):
        if(S[j - l] != S[j + l] and S[j] != S[j + l] and S[j] != S[j - l]):
            m += 1

    if(S[j] == "R"):
        total += ic["G"] * kc["B"] + ic["B"] * kc["G"]
    elif(S[j] == "G"):
        total += ic["R"] * kc["B"] + ic["B"] * kc["R"]
    elif(S[j] == "B"):
        total += ic["R"] * kc["G"] + ic["G"] * kc["R"]

    total -= m

print(total)

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

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

    int sum = 0;
    vector<int> w(n);
    for (int i = 0; i < n; i++){
        cin >> w[i];
        sum += w[i];
    }

    int diff = 5000000;
    int sum2 = 0;
    int sum1;
    for (int i = 0; i<n; i++){
        sum2 += w[i];
        sum1 = sum - sum2;
        diff = min(abs(sum2 - sum1),diff);
    }

    cout << diff << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
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; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  rep(i,n) a[i]--;
  vector<int> s(n+1);
  rep(i,n) {
    s[i+1] = (s[i]+a[i])%k;
  }
  //rep(i,n+1)cout << s[i] << endl;
  map<int,int> mp;
  ll ans = 0;
  rep(i,n+1){
    if(i<k){
      ans += mp[s[i]];
      mp[s[i]]++;
    }else{
      mp[s[i-k]]--;
      ans += mp[s[i]];
      mp[s[i]]++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 11264
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	char a,b,c,d;
	cin>>a>>b>>c>>d;
	if((a==b&&b==c)||(b==c&&c==d))
	{
		cout<<"Yes";
		return 0;
	}
	cout<<"No";
	return 0;
}

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

using namespace std;

int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<vector<long long>> v1(n + 1), v2(n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < n; j += i) {
      v1[i].push_back(a[j]);
    }
    for (int j = n - 1; j >= 0; j -= i) {
      v2[i].push_back(a[j]);
    }
    for (int j = 1; j < v1[i].size(); j++) {
      v1[i][j] += v1[i][j - 1];
    }
    for (int j = 1; j < v2[i].size(); j++) {
      v2[i][j] += v2[i][j - 1];
    }
  }
  vector<vector<int>> pr(n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j += i) {
      pr[j].push_back(i);
    }
  }
  long long ans = 0;
  for (int A = 1; A < n - 1; A++) {
    for (auto z : pr[n - 1 - A]) {
      if (z >= A) continue;
      int B = A - z;
      if (A <= n - 1 - A && A % z == 0) continue;
      long long sum = v1[z][(n - 1 - A) / z] + v2[z][(n - 1 - A) / z];
      ans = max(ans, sum);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 48116
#include <stdio.h>
int main()
{
    int i,j,t,arr[10];
    for (i=0;i<10;i++)
      scanf("%d",&arr[i]);
    for (i=0;i<9;i++)
      for (j=i+1;j<10;j++)
        if (arr[i]<arr[j])
        {
            t=arr[i];
            arr[i]=arr[j];
            arr[j]=t;
        }
    for (i=0;i<3;i++) printf("%d\n",arr[i]);
    return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,a[10000];
	long sum=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i];
		sum+=a[i];
	}
	sort(a,a+n);
	cout << a[0] << " " << a[n-1] << " " << sum << endl;
	return 0;
}

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

int main(){
	string s; int w; cin>>s>>w;
	int k=s.size();
	rep(i,k){
		if(i%w==0) cout<<s[i];
	}
	cout<<endl;
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+100;
const int inf=0x3f3f3f3f;
typedef pair<ll,int>P;

ll a[maxn];
int main(){
    ll x;
    ll sum=0;
    cin>>x;
    ll k=x/500;
    x-=k*500;
    sum+=k*1000;
    k=x/5;
    sum+=k*5;
    cout<<sum;

}


Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import accumulate, permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    s = [input() for i in range(n)]
    ac = s.count('AC')
    wa = s.count('WA')
    tle = s.count('TLE')
    re = s.count('RE')
    print('AC x %s' % ac)
    print('WA x %s' % wa)
    print('TLE x %s' % tle)
    print('RE x %s' % re)
    return


if __name__ == "__main__":
    solve()


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

int main() {
	// your code goes here
    char s[5];
    cin >> s;
    if(s[0]=='S'&&s[1]=='U'&&s[2]=='N') cout << "7" << endl;
    if(s[0]=='M'&&s[1]=='O'&&s[2]=='N') cout << "6" << endl;
    if(s[0]=='T'&&s[1]=='U'&&s[2]=='E') cout << "5" << endl;
    if(s[0]=='W'&&s[1]=='E'&&s[2]=='D') cout << "4" << endl;
    if(s[0]=='T'&&s[1]=='H'&&s[2]=='U') cout << "3" << endl;
    if(s[0]=='F'&&s[1]=='R'&&s[2]=='I') cout << "2" << endl;
    if(s[0]=='S'&&s[1]=='A'&&s[2]=='T') cout << "1" << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

    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();
        }
        int count = 0;
        for (int i = 0 ; i < n ; i++) {
            while (a[i] % 2 == 0) {
                count++;
                a[i] /= 2;
            }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 32200
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

void solve(){
	int x;
	string s;
	cin>>x>>s;
	int y=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');
	x=x*y;
	x/=100;
	cout<<x<<endl;
}

int32_t main(){
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		solve();	
	}
}

Measured memory_bytes: 3640
#include <stdio.h>
int main()
{
  int a,b,c,k,temp,r;
    int a1,b1;
  int sum=0;
  scanf("%d",&k);
  for(a=1;a<=k;a++){
    for(b=1;b<=k;b++){
      for(c=1;c<=k;c++){
          a1=a;
          b1=b;
          if(a1<b1) {
              temp=a1;
              a1=b1;
              b1=temp;
          }
          while((r=a1%b1)!=0){
              a1=b1;
              b1=r;
          }
          a1=b1;
          b1=c;
          if(a1<b1) {
              temp=a1;
              a1=b1;
              b1=temp;
          }
          while((r=a1%b1)!=0){
              a1=b1;
              b1=r;
          }
        sum=sum+b1;
      }
    }
  }
  printf("%d",sum);
  return 0;
}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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

const long long INF = 1LL << 60;

int main(){
  ll a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;

  if(v-w <= 0){
    cout << "NO" << endl;
    return 0;
  }

  if(t * (v-w) >= abs(a-b)){
    cout << "YES" << endl;
  }

  else cout << "NO" << endl;

  return 0;
}


Measured memory_bytes: 3652
#include<stdio.h>
#include<math.h>

int main()
{
	int n,a,b,c,d ,i, cnt, k = 0;
	int num[50] = { 0 };

	while (scanf("%d", &n) != EOF)
	{
		if ((n > 0 && n <= 50))
		{
			cnt = 0;
			for (a = 0; a <10; a++)
			{
				for (b = 0; b <10; b++)
				{
					for (c = 0; c < 10; c++)
					{
						for (d = 0; d < 10; d++)
						{
							if (a + b + c + d == n)
							{
								++cnt;
							}
						}
					}
				}
			}
			num[k] = cnt;
			++k;
		}
	}

	for (i = 0; i < k;i++)
	{
		printf("%d\n", num[i]);
	}

	return 0;
}


Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

const long long MAX = 2e6+100;
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;
}

long long powmod(long long a, long long x){
    if(x == 0)return 1;
    long long r = powmod(a, x / 2);
    return (x%2)? (r * r % MOD) * a % MOD : r * r % MOD;
}

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	COMinit();
	ll k; cin >> k;
	string s; cin >> s;
	ll n = s.size();
	
	ll ans = 0;
	rep(i, 0, k){
		ans += COM(n - 1 + k - i, k - i) * powmod(25, k - i) % MOD * powmod(26, i) % MOD;
		ans %= MOD;
	}
	print(ans)
	
	return 0;
}

Measured memory_bytes: 51140
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll pow2[1000];

int main(){
  pow2[0]=1;
  for(int i=0;i<60;i++)pow2[i+1]=2*pow2[i];
   int n,p;
  cin >> n >> p;
  ll odd=0;
  rep(i,n){
    int tempx;
    cin >> tempx;
    if(tempx%2==1)odd++;
  }
  ll all=pow2[n];
  ll O;
  if(odd>=1)O=pow2[odd-1];
  else O=0;
  O*=pow2[n-odd];
  if(p==1)cout << O << endl;
  else cout << all-O << endl;
return 0;}

Measured memory_bytes: 256
#include <stdio.h>
 
int main()
{
    int n,i=1,x;
    scanf("%d",&n);
    while(i<=n){
        if(i%3==0){
            printf(" %d",i);
        }
        else{
            if(i%10==3){
                printf(" %d",i);
            }
            else{
                x=i;
                while(x){
                    if(x%10!=3){
                    x/=10;
                    }
                    else{
                        printf(" %d",i);
                        break;
                    }
                }
            }
        }
        i++;
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 2036
#include <iostream>
#include <cmath>

using namespace std;


#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define IN_LL(v) LL v;cin>>v;
#define IN(v) int v;cin>>v;
#define OUT(v) cout<<v<<endl
#define MOD 1000000007


int main() {
  IN(N);

  int ans = 0;
  FOR(i, 1, N + 1) {
    if ((int)floor(log10(i)) % 2 == 0)
      ++ans;
  }
  OUT(ans);
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const double PI  = acos(-1.0);
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const LL INF  = 0x3f3f3f3f3f3f3f3f;
const int N=3e5+10;
const int M=1e6+10;
const int mod=1e9+7;
inline LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
inline LL lcm(LL a, LL b) { return a * b / gcd(a, b); }
inline LL read(){LL x=0,f=1;char c=getchar();while(c<'0'||c>'9') {if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9') {x=x*10+c-'0';c=getchar();}return x*f;}
inline LL qpow(LL x,LL k=mod-2,LL m=mod){LL res=1;while(k){if(k&1) res=res*x%m;x=x*x%m;k>>=1;}return res;}
/*=================================================================================================================*/


int main(){
    int n=read();
    for(int i=1;i<=n;i++) printf("ACL");
    return 0;
}


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

w, h, n = map(int, input().split())

w1 = int(w)
h1 = int(h)

a = [list(map(int, input().split())) for i in range(n)]

ar = [[0]*w for i in range(h)]

for x, y, aa in a:
    x -= 1
    y -= 1
    if aa == 1:
        for i in range(h):
            for j in range(w):
                if j <= x:
                    ar[i][j] += 1
    if aa == 2:
        for i in range(h):
            for j in range(w):
                if j > x:
                    ar[i][j] += 1
    if aa == 3:
        for i in range(h):
            for j in range(w):
                if i <= y:
                    ar[i][j] += 1
    if aa == 4:
        for i in range(h):
            for j in range(w):
                if i > y:
                    ar[i][j] += 1

print(sum(ar, []).count(0))


Measured memory_bytes: 3408
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define divup(a,b) ( ( (a) + ( (b) - 1u) ) / (b) ) // a/b の余り切り上げ
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

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

int main(){
    ll a,b,i;
    scanf("%lld%lld", &a, &b);
    ll c=gcd(a,b);
    ll s=1;
    for(i=2;i*i<=c;i++){
        if(c%i==0){
            while(c%i==0){
                c /= i;
            }
            s++;
        }
    }
    if(c>1) s++;
    printf("%lld\n", s);
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
  int t;
  cin >> t;
  string s;
  cin >> s;
  if(s.size()==1 || s.size()%2==1){
    cout << "No" <<endl;
    return 0;
  }
  int i=0;
  for(i=0;i<s.size()/2;i++){
    if(s[i]!=s[i+s.size()/2])
      break;
  }
  if(i==s.size()/2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
	string s,t;
	cin>>s>>t;
	int flag=0;
	for(int i=0;i<s.size();i++){
		if(s[i]!=t[i]) flag=1;
	}
	if(flag==0) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
} 

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int n;
long long a[100005],s[100005],cc[100005],ans;
int main()
{
	cin>>n>>a[1];s[1]=cc[1]=a[1];
	for(int i=2;i<=n;i++)
	{
		char c;
		cin>>c>>a[i];
		cc[i]=cc[i-1]+a[i];
		if(c=='-')a[i]*=-1;
		s[i]=s[i-1]+a[i];
	}
	ans=s[n];
	for(int i=2;i<=n;i++)if(a[i]<0)
	{
		long long tt=a[i]*2;
		for(int j=i+1;j<=n&&a[j]>0;j++)tt-=a[j]*2;
		ans=max(ans,s[i-1]+tt+cc[n]-cc[i-1]);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}
ll LCM(ll a,ll b){return (a*b)/GCD(a,b);}
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main()
{
	string s;
	cin >> s;
	int n = s.size();
	for (int i = 0; i < n; i++){
		if (i % 2){
			if (s[i] == 'R') {
				cout << "No" << endl;
				return 0;
			}
		} else {
			if (s[i] == 'L'){
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;

}


Measured memory_bytes: 256
/*
 * atcoder/abc089/b.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; }
void solve();
int main() { solve(); return 0; }

#define ull unsigned long long
void solve() {
  string s, t;
  cin >> s >> t;
  s += s;
  int n = t.size();
  
  ull b = 1000000007;
  ull sh = 0, th = 0;
  loop(i,0,n) sh = sh*b + s[i];
  loop(i,0,n) th = th*b + t[i];
  ull b_n = 1;
  loop(i,0,n) b_n *= b;
  
  loop(i,0,n) {
    if (sh == th) {
      cout << "Yes" << endl;
      return;
    }
    sh = sh * b + s[i+n] - s[i] * b_n;
  }
  cout << "No" << endl;
}


Measured memory_bytes: 3604
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <iomanip>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define x first
#define y second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define SZ(x) (int)x.size()
#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 pi acos(-1)
#define mod 1000000007
#define inf 1000000007
#define ll long long
#define ull unsigned long long
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
#define N 100010
#define _DEBUG
template <class U,class T> void Max(U &x, T y){if(x<y)x=y;}
template <class U,class T> void Min(U &x, T y){if(x>y)x=y;}
template <class T> void add(int &a,T b){a=(a+b)%mod;}
inline int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
inline ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}

int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=1LL*ans*a%mod;
        a=1LL*a*a%mod;b>>=1;
    }
    return ans;
}
int pow(int a,int b,int c){
    int ans=1;
    while(b){
        if(b&1)ans=1LL*ans*a%c;
        a=1LL*a*a%c;b>>=1;
    }
    return ans;
}

double p[3001],dp[3001],ndp[3001];
int main(){
    //srand(time(NULL)+clock());
    int ca=0,T,k,i,j,m=0,K,n;
    double start=clock();
    scanf("%d",&n);
    rep(i,0,n){
        scanf("%lf",&p[i]);
    }
    dp[0]=1;
    rep(i,0,n){
        k=min(i,n/2)+1;
        rep(j,0,n/2+1)ndp[j]=0;
        per(j,0,k){
            if(j+1<=n/2)ndp[j+1]+=dp[j]*(1-p[i]);
            ndp[j]+=dp[j]*p[i];
        }
        swap(dp,ndp);
    }
    double ans=0;
    rep(i,0,n/2+1)ans+=dp[i];
    printf("%.9lf\n",ans);
    cerr<<(1.*clock()-start)/CLOCKS_PER_SEC<<"\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
typedef vector<vector<ll> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e9;

//Sugoroku
//入力
ll n,m;
string s;

int main(){
    cin >> n >> m;
    cin >> s;
    vector<ll>ans;
    ll l = s.size();
    int i=l-1;
    while(i>0){
        for(int j=m;j>=0;j--){
            if(j==0){
                cout << -1 << endl;
                return 0;
            }
            ll now = i-j;
            if(now<0)continue;
            if(s[now]=='1')continue;
            ans.push_back(j);
            i=now;
            break;
        }
    }
    reverse(ans.begin(),ans.end());
    rep(i,ans.size()){
        cout << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 4452
#include <stdio.h>
int main(){
	int s=0,n,x,i,e[8]={};
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&x);
		printf("Case %d:\n",i);
		for(int j=0;j<10;j++){
			for(int q=0;q<8;q++){
				e[q]=0;
			}
			int g=7;
			int y=x*x;
			while(y){
				e[g]=y%10;
				y/=10;
				g--;
			}
			for(int k=2;k<6;k++){
				if(e[k]==0 & s==0){
				}else{
					printf("%d",e[k]);
				s=1;}
			}if(s==0){printf("0");}s=0;
			printf("\n");
			x=e[2]*1000+e[3]*100+e[4]*10+e[5];
		}
	}
return 0;
}

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

#define deb(x) cerr<<"["#x<<" : "<<x<<" ]\n";

int main()
{
	using ll = long long;
	int n, m;
	cin >> n >> m;
	ll ans = 0, sum = 0;
	unordered_map<ll, ll> mp;
	
	mp[sum] = 1;
	for(int i = 0; i < n; i++) {
		ll x;
		cin >> x;
		sum = (sum + x) % m;
		ans += mp[sum];
		mp[sum]++;
	}
	cout << ans;
}


Measured memory_bytes: 6588
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 998244353
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())

int main(){	
	int n,a,b; cin>>n>>a>>b;
	cout << min(a*n,b) << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void){
  int a,b,c,cnt=0;
  int i,j;
  cin>>a>>b>>c;
  for(i=a;i<=b;i++){
    if(c%i==0)cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 1164
#include <cstdio>

using namespace std;

typedef long long int ll;
#define REP(i, I, N) for (int i = I; i < N; ++i)
#define rep(i, N) REP(i, 0, N)

int main() {
    int H, W, h, w;
    scanf("%d %d", &H, &W);
    scanf("%d %d", &h, &w);

    printf("%d\n", (H - h) * (W - w));
    return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
int main()
{
    double w,h,x,y;
    double s;
    int acm;
    while(~scanf("%lf%lf%lf%lf",&w,&h,&x,&y))
    {
        acm=0;
        s=w*h/2;
        if(x==w/2&&y==h/2)
            acm=1;
        printf("%8.6lf %d\n",s,acm);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
#define double long double
const int INF = (int)1e18 + 18;
const int maxn = (int) 1e6 + 6; 
using namespace std;

int n, d, x;

signed main() {

	cin >> n >> d;

	x = (d * 2) + 1;

	int ans = (n + x - 1)/x;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
// Aizu 1159: Next Mayor
// 2017.9.15 bal4u@uu
// 2017.12.8

#include <stdio.h>
#include <string.h>

int x[53];

int main()
{
	int n, p, k, m;

	while (scanf("%d%d", &n, &p) && n) {
		m = p, k = 0;
		memset(x, 0, sizeof(x));
		while (1) {
			if (m-- > 0) { if (++x[k] == p) { printf("%d\n", k); break; }}
			else m = x[k], x[k] = 0;
			if (++k == n) k = 0;
		}
	}
	return 0;
}

Measured memory_bytes: 1692
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define DIVCEIL(A,B) ((A+(B-1))/B)
#define LL long long
#define INF (LL)(1LL<<60)
using namespace std;


void solve(long long N, long long W, std::vector<long long> w, std::vector<long long> v){
    vector<vector<LL>> vs(4);
    auto w1 = w[0];
    for(LL i=0; i<N; i++)vs[w[i]-w1].emplace_back(v[i]);
    for(LL i=0; i<4; i++)sort(vs[i].begin(), vs[i].end(), greater<LL>());
    for(LL i=0; i<4; i++){
        if(vs[i].empty()){
            vs[i].emplace_back(0);
            continue;
        }
        LL acc=0;
        for(LL j=0; j<vs[i].size(); j++){
            auto tmp = vs[i][j];
            vs[i][j] = acc;
            acc += tmp;
        }
        vs[i].emplace_back(acc);
    }
    LL ans=0;
    for(LL i=0; i<vs[0].size(); i++){
        for(LL j=0; j<vs[1].size(); j++){
            for(LL k=0; k<vs[2].size(); k++){
                for(LL l=0; l<vs[3].size(); l++){
                    if(w1*(i+j+k+l)+j+2*k+3*l > W)break;
                    ans = max(ans, vs[0][i]+vs[1][j]+vs[2][k]+vs[3][l]);
                }
            }
        }
    }

    cout << ans << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long W;
    scanf("%lld",&W);
    std::vector<long long> w(N);
    std::vector<long long> v(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&w[i]);
        scanf("%lld",&v[i]);
    }
    solve(N, W, std::move(w), std::move(v));
    return 0;
}


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

int main() {
  string s;
  cin >> s;
  
  bool answer = false;
  
  if ((s.at(2) == s.at(3))&&(s.at(4) == s.at(5))) answer = true;
  
  if (answer) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#define min(x, y) x > y ? y : x
int main() {
    int ans = 1;
    int n, k;
    scanf("%d%d", &n, &k);
    while (n--) ans = min(ans * 2, ans + k);
    return printf("%d\n", ans) & 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdlib>
#include <list>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
 
int main(void)
{
    string S, T;
    cin >> S;
    cin >> T;

    int ans = 0;
    for (int i = 0; i < S.size(); ++i)
    {
        if (S[i] != T[i]) ++ans;
    }

    cout << ans;
    
    return 0;
}


Measured memory_bytes: 3416
from collections import defaultdict
N,K=map(int,input().split())
alist=list(map(int,input().split()))
#print(alist)

slist=[0]
for i in range(N):
  slist.append(slist[-1]+alist[i])
#print(slist)

sslist=[]
for i in range(N+1):
  sslist.append((slist[i]-i)%K)
#print(sslist)

answer=0
si_dic=defaultdict(int)
for i in range(N+1):
  if i-K>=0:
    si_dic[sslist[i-K]]-=1
    
  answer+=si_dic[sslist[i]]
  si_dic[sslist[i]]+=1
  
print(answer)

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

int dp[110][11000] = {-1} ;
int N = 0 , W = 0 ;
int w[110] = {} , v[110] = {} ; 

int rec(int i , int j ){
  if(dp[i][j] >= 0 ) {
    return dp[i][j] ;
  }
  
  int res = 0 ;
  if(i==N){
    res = 0 ;
  } else if ( j < w[i]) {
    res = rec(i+1,j) ;
  } else {
    res = max(rec(i+1,j),rec(i+1,j-w[i])+v[i]) ;
  }
  return dp[i][j] = res ;
}

int main () {
  cin >> N >> W ;
  for(int i = 0 ; i < N ; i++ ){
    cin >> v[i] >> w[i] ;
  }
  
  memset(dp,-1,sizeof(dp)) ;
  cout << rec(0,W) << endl ;
  
}


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

int main(){
    int n;
    int a[100];
    cin >> n;
    for(int i=0;i<n;++i) cin >> a[i];

    for(int i=0;i<n;++i){
        if(a[i] % 2 == 0 && a[i] % 3 != 0 && a[i] % 5 != 0){
            cout << "DENIED" << endl;
            return 0;
        }
    }
    cout << "APPROVED" << endl;
        
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
#define REP(i, d, n) for(int i=(d); i<(n); i++)
typedef long long ll;
const int mod = 1e9 + 7;
int main() {

    string s, t;
    cin >> s >> t;

    vector<string> vs;
    rep(i, s.length()-t.length()+1){
        bool ok = true;
        rep(j, t.length()){
            if(s[i+j] == t[j] || s[i+j] == '?'){
                
            }
            else{
                ok = false;
                break;
            }
        }   
        if(ok){
            int idx = 0;
            string str = s;
            rep(k, s.length()){
                if(k >= i && k < i+t.length()){
                    str[k] = t[idx++];
                }
                if(str[k] == '?'){
                    str[k] = 'a';
                }
            }
            vs.push_back(str);
        }
    }
    if(vs.empty())
        cout << "UNRESTORABLE" << endl;
    else{
        sort(vs.begin(), vs.end());
        cout << vs[0] << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000009;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

using Float = double;
using Point = complex<Float>;
struct Line{
	Point a,b;
	Line(Point a,Point b) : a(a),b(b){}
};
struct Segment : Line{ Segment(Point a,Point b) : Line(a,b){} };
struct Circle{
	Point p; Float r;
	Circle(Point p,Float r) : p(p),r(r){}
};

inline bool eq(Float a,Float b) { return abs(a - b) < EPS; }
inline Float dot(const Point &a,const Point &b){ return real(conj(a) * b); }
inline Float cross(const Point &a,const Point &b){ return imag(conj(a) * b); }

Float distance(Point &p1,Point &p2){
    return abs(p1 - p2);
}

bool contain(Circle &c,Point &p){
    return (distance(c.p,p) <= c.r + EPS);
}

vector<Point> crosspoint(const Circle &c1,const Circle &c2){
	vector<Point> ret;
	Point d = c2.p - c1.p;
	Float rcosa = (c1.r * c1.r + norm(d) - c2.r * c2.r) / (abs(d) * 2);
	if(eq(0,abs(d)) || abs(rcosa) > c1.r) return ret;
	Float rsina = sqrt(c1.r * c1.r - rcosa * rcosa);
	ret.push_back(c1.p + d / abs(d) * Point(rcosa,rsina));
	if(!eq(rcosa,c1.r)) ret.push_back(c1.p + d / abs(d) * Point(rcosa,-rsina));
	return ret;
}

int n;
double x[15],y[15],l[15];

bool isOK(double h){
	vector<Circle> cs;
	for(int i = 0;i < n;i++){
		if(l[i] < h) return false;
		cs.emplace_back(Point(x[i],y[i]),sqrt(l[i] * l[i] - h * h));
	}
	vector<Point> ps;
	for(int i = 0;i < n;i++){
		ps.push_back(cs[i].p);
		for(int j = i + 1;j < n;j++){
			auto cp = crosspoint(cs[i],cs[j]);
			ps.insert(ps.end(),all(cp));
		}
	}
	for(auto p : ps){
		bool flag = true;
		for(int i = 0;i < n;i++){
			if(!contain(cs[i],p)) flag = false;
		}
		if(flag) return true;
	}
	return false;
}

void solve(){
	for(int i = 0;i < n;i++){
		cin >> x[i] >> y[i] >> l[i];
	}
	double ok = 0,ng = INF;
	for(int i = 0;i < 100;i++){
		double mid = (ok + ng) / 2;
		if(isOK(mid)) ok = mid;
		else ng = mid;
	}
	printf("%.15lf\n",ok);
}

signed main(){
	while(cin >> n,n) solve();
}


Measured memory_bytes: 3256
#include<bits/stdc++.h>
#define pb emplace_back
#define ll long long
#define mp make_pair
#define PI acos(-1)
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,x,y,z,m,t,n,b,a,c,d,l,r;
    cin>>a>>b>>c;
    a=abs(a);
    x=min(a/c,b);
    b-=x;
    a-=x*c;
    if(b & 1)
        cout<<c-a<<'\n';
    else
        cout<<a<<'\n';
}









Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll N,A,B;
int main()
{
    scanf("%lld%lld%lld",&N,&A,&B);
    if(A>B) swap(A,B);
    if((B-A)%2==0) printf("%lld\n",(B-A)/2);
    else printf("%lld\n",(B-A+1)/2+min(A-1,N-B));
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
  int d, g;
  cin >> d >> g;
  g /= 100;
  vector<int> p(d), c(d);
  for (int i = 0; i < d; i++) {
    cin >> p[i] >> c[i];
    c[i] /= 100;
  }
  int ans = 1e9;
  for (int i = 0; i < 1 << d; i++) {
    int cnt = 0;
    int score = 0;
    for (int j = 0; j < d; j++) {
      if (i >> j & 1) {
        cnt += p[j];
        score += p[j] * (j + 1);
        score += c[j];
      }
    }
    for (int j = d - 1; j >= 0; j--) {
      if (~i >> j & 1) {
        for (int k = 0; k < p[j] && score < g; k++) {
          score += j + 1;
          cnt++;
        }
      }
    }
    if (score >= g) {
      ans = min(ans, cnt);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
N = input()

a = N[0]

def judge(N,a):
    pt = 0
    while pt < len(N):
        if int(N[pt]) < a:
            return False
        elif int(N[pt]) > a:
            return True
        else:
            pt += 1
    return False

ans = ""
if judge(N,int(a)):
    a = str(int(a)+1)
for i in range(len(N)):
    ans += a
print(ans)


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define PI 3.14159265358979
#define MOD 1000000007 // = 10^9 + 7

using namespace std;
using ll = long long;

class UnionFind{
public:
	vector<int> p;  // 親
	vector<int> rank; // 深さ・サイズ
	UnionFind(int n){
		p.resize(n, -1);
		rank.resize(n, 1);
	}

	int root(int x){ // rank を 1 にしている
		if(p[x] == -1)return x;
		else return p[x] = root(p[x]);
	}

	void unite(int x, int y){
		x = root(x);
		y = root(y);
		if(x == y)return;
		if(rank[x] > rank[y]) swap(x, y);
		rank[y] += rank[x];
		p[x] = y;
	}

	int size(int x){ //xが属すグループのサイズ
		return rank[root(x)];
	}
	bool same(int x, int y){
		return (root(x) == root(y));
	}
};

void solve()
{
	int n, m, k;
	cin >> n >> m >> k;
	
	UnionFind ab(n);
	vector<int> fr(n, 0);
	vector< vector<int> > cd(n);

	for(int i = 0; i < m; ++i)
	{
		int a, b;
		cin >> a >> b;
		--a;
		--b;
		++fr[a];
		++fr[b];
		ab.unite(a, b);
	}

	for(int i = 0; i < k; ++i)
	{
		int c, d;
		cin >> c >> d;
		--c;
		--d;

		cd[c].push_back(d);
		cd[d].push_back(c);
	}


	for(int i = 0; i < n; ++i)
	{
		int ans = ab.size(i) - fr[i] - 1;
		for(int c : cd[i])
		{
			if (ab.same(i, c))--ans;
		}
		cout << ans << " ";
	}

}

int main()
{
	fastio;
	solve();

	return 0;
}

Measured memory_bytes: 7168
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <fstream>
#include <map>
#include <cstring>
#include <vector>

using namespace std;

int n,m;
string bits[1001];
const int INF=1000000000;


//bitset<int> nums[1<<11];
map<set<int>,int> sets;
int id;
map<int,int> dp[1<<11];
//map<set<int>,int > dp[1<<11];

// »ÝgÁ½¿âA»Ì¿âÉæÁÄ¾çê½ªÌ¤¿AÇÌªð©Ä¢é©AÅ»
int dfs(int s,int pos,set<int> &si,int sel){
	// WÌTCYª1Èº
	if(si.size()<=1)return 0;
	if(s==(1<<m)-1)return INF;
	if(sets.find(si)==sets.end())
		sets[si]=id++;
	if(dp[s].find(sets[si])!=dp[s].end())return dp[s][sets[si]];
	int res=INF;
	// ÇÌ¿âðg¤©
	for(int i=0;i<m;i++){
		// ·ÅÉgpÏÝ
		if((s>>i)&1)continue;
		// ªðs¤
		set<int> si1,si2;
		for(set<int>::iterator it=si.begin();it!=si.end();it++){
			int idx=*it;
			if(bits[idx][i]=='1')si1.insert(idx);
			else si2.insert(idx);
		}
		res=min(res,max(dfs(s|(1<<i),i,si1,0),dfs(s|(1<<i),i,si2,1))+1);
	}
	return dp[s][sets[si]]=res;
}

int main(){
	while(cin>>m>>n&&!(m==0&&n==0)){
		//memset(dp,-1,sizeof(dp));
		for(int i=0;i<(1<<11);i++)dp[i].clear();
		sets.clear();
		id=0;
		//for(int i=0;i<(1<<11);i++)
			//nums[i]=i;
		for(int i=0;i<n;i++)cin>>bits[i];
		set<int> init;
		for(int i=0;i<n;i++)init.insert(i);
		int res=INF;
		res=dfs(0,0,init,0);
		cout<<res<<endl;
	}
	return 0;
}

Measured memory_bytes: 6360
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N = int(input())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

A, B = map(int, input().split())
ans = [B]

for i in range(1, A):
    ans.append(B + i)
    ans.append(B - i)


ans = sorted(ans)
print(*ans)






# def main():
# if __name__ == '__main__':
#     main()


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
#define rng(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define pb push_back
#define eb emplace_back
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
 
int main() {
  int n, a, b, ans = 0;
  string s, t;
  cin >> s >> t;
  //vector<int> v(n), c(n);
  //if(1) {}
  //for(int i = 0; i < n; i++){}
  cout << ((s + t.at(t.size()-1) == t)? "Yes" : "No") << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

constexpr ll MOD = 1000000007;

ll pmod(ll base, ll index) {
  if (index == 0) return 1;
  else if (index % 2 == 1) return base * pmod(base, index-1) % MOD;
  else {
    ll h = pmod(base, index/2);
    return h * h % MOD;
  }
}

// a^-1 mod p
ll inv(ll a,ll p){
  return ( a == 1 ? 1 : (1 - p*inv(p%a,a)) / a + p );
}

int main()
{
  ll n;
  cin>>n;
  vecll a(n);
  for(auto&& e:a)cin>>e;
  std::map<ll,ll> cnt;
  for(auto&& e:a) {
    ll m = e;
    for(size_t i = 2; i*i <= m; ++i) {
      ll j = 0;
      while (m % i == 0) {
        m /= i;
        ++j;
      }
      if (j > 0) cnt[i] = max(cnt[i], j);
    }
    if (m > 1) {
      cnt[m] = max(cnt[m], 1l);
    }
  }
  ll pall = 1;
  for(auto&& t:cnt) {
    ll p,c;
    tie(p,c) = t;
    pall *= pmod(p, c);
    pall %= MOD;
  }
  cerr<<pall<<endl;
  ll ans = 0;
  for(auto&& e:a) {
    ll m = e;
    ll tmp = pall;
    for(size_t i = 2; i*i <= m; ++i) {
      ll j = 0;
      while (m % i == 0) {
        m /= i;
        ++j;
      }
      if (j > 0) {
        ll iv = inv(i, MOD);
        tmp *= pmod(iv, j);
        tmp %= MOD;
      }
    }
    if (m > 1) {
      ll iv = inv(m, MOD);
      tmp *= iv;
      tmp %= MOD;
    }
    ans += tmp;
    ans %= MOD;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 896