akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int Y;
  cin >> N >> Y;
  int count=0;
  for(int x=0;x<=N;x++){
    for(int y=0;y<=N-x;y++){
      if(x*10000+y*5000+(N-x-y)*1000==Y){
        count++;
        cout << x << " " << y << " " << N-x-y << endl;
        goto labeled;
      }
    }
  }
  labeled:
  if(count ==0){
  cout << -1 << " " << -1 << " " << -1 << endl;
  }
}
        


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

# Input
from sys import stdin
A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

# Proccess
kawaisou = ""
k = 0

if A == B:
	if A == C:
		k += 0
	else:
		k += 1

if B == C:
	if B == A:
		k += 0
	else:
		k += 1

if C == A:
	if C == B:
		k += 0
	else:
		k += 1

if k == 1:
	kawaisou = "Yes"
else:
	kawaisou = "No"

# Output							
print(kawaisou)

Measured memory_bytes: 3064
#include <cstdio>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

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; }

using ll = long long;

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

ll H, W, K;

mint dp[110][10];

int main()
{
  scanf( "%lld%lld%lld", &H, &W, &K );

  dp[0][0] = 1;

  rep( i, H ) rep( j, W ) rep( k, 1<<(W-1) )
  {
    bool fl = false;

    rep( l, W-2 ) if( (k>>l&1) && (k>>(l+1)&1) )
      fl = true;

    if( fl )
      continue;

    if( k>>j&1 )
      dp[i+1][j+1] += dp[i][j];
    else if( j-1 >= 0 && k>>(j-1)&1 )
      dp[i+1][j-1] += dp[i][j];
    else
      dp[i+1][j] += dp[i][j];
  }

  printf( "%lld\n", dp[H][K-1].x );

  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define mxn 1000010
#define db double
#define LL long long
#define ldb long double
#define ull unsigned long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pul pair<ull,LL> 
#define pii pair<int,int> 
#define mp make_pair
#define fr first
#define sc second
#define x1 faqx1
#define y1 faqy1
#define x2 faqx2
#define y2 faqy2
using namespace std;
const int N=(1<<14)-1,mod=998244353;
const LL inf=1e18;
template<typename T> void chkmin(T &x,T y) {if(y<x) x=y;}
template<typename T> void chkmax(T &x,T y) {if(y>x) x=y;}
template<typename T> void upd(T &x,T y) {if((x+=y)>=mod) x-=mod;}
char s[mxn];
int sl,fh;
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
int main()
{
	ios::sync_with_stdio(false);
	scanf("%s",s+1);
	if(s[3]!=s[4]) return puts("No"),0;
	if(s[5]!=s[6]) return puts("No"),0;
	return puts("Yes"),0;
}

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

using namespace std;

using ll = long long;

const ll MOD = 1000000007;

ll modpow(ll x, ll n, ll mod = MOD) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

ll f[400005], fi[400005];

ll comb(int r, int c) {
    if (r < c) return 0;
    return f[r] * fi[c] % MOD * fi[r - c] % MOD;
}

// ll dp[205][205];

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, K;
    cin >> n >> K;

    f[0] = 1;
    for (int i = 1; i <= 2* n; ++i) {
        f[i] = f[i - 1] * i % MOD;
    }
    fi[2 * n] = modpow(f[n * 2], MOD - 2);
    for (int i = 2 * n; i > 0; --i) {
        fi[i - 1] = fi[i] * i % MOD;
    }

    /*
    {
        dp[0][0] = 1;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j <= n; ++j) {
                for (int k = 0; k <= K; ++k) {
                    if (j < k) break;
                    (dp[i + 1][j] += dp[i][j - k]) %= MOD;
                }
            }
        }
        cerr << dp[n][n] << endl;
    }*/

    ll ans = comb(n + n - 1, n - 1);
    if (K < n) {
        ans = 0;
        for (int i = 0; i <= K; ++i) {
            (ans += comb(i + n - i - 1, i) * comb(n, i) % MOD) %= MOD;
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 6528
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define ARR(array) for(int i=0;i<array.size();i++)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 100000007
#define SIZE 10005
#define PI 	3.14159265358979323846

unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

char input(){
  char a;
  cin >> a;
  return a;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    bool a[200000]={false},b[200000]={false};
    ll n,m;
    cin >> n >> m;
    REP(i,m){
      ll t,tt;
      cin >> t >> tt;
      if(t==1||tt==1)a[t]=a[tt]=true;
      if(t==n||tt==n)b[t]=b[tt]=true;
    }
    REP(i,n)if(a[i]&&b[i]){
      cout << "POSSIBLE" << endl;
      return 0;
    }
    cout << "IMPOSSIBLE" << endl;
}

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

/*struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream & is, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }*/

int main() {
    long double a, b, h, m;
    cin >> a >> b >> h >> m;
    
    int hunsuu = m + h * 60;
    long double a_hari = hunsuu * 0.5;
    long double b_hari = m * 6.0;

    long double diff = min(abs(a_hari - b_hari), abs(360 - (a_hari - b_hari)));
    long double ra = diff / 180 * 3.14159265359;

    printf("%.25Lf", sqrt(a * a + b * b - 2 * a * b * cosl(ra)));
    
    return 0;
}


Measured memory_bytes: 4160
#include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
#include <cmath>

#define rep(i,b,e) for (int (i) = (b); (i) < (e); (i)++)
typedef long long ll;


using namespace std;

int main() {

    int A, B;
    cin >> A >> B;

    cout << (A-1) * (B-1) << endl;


}

Measured memory_bytes: 256
#include <stdio.h>

int main( void ) {
	int a, b, d, tmp;

	while ( scanf( "%d %d", &a, &b ) == 2 ) {
		tmp = a + b;
		for ( d = 1; tmp /= 10; d++ ) ;

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

	return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
#define fi first
#define se second
#define LL long long

using namespace std;
const int maxn = 2e5 + 5;
typedef pair<int, int> P;
int a[maxn];
int n, k, q, ans;
bool check(int o, int p) {
    int ti = 0;
    int x = 0;
    int y = 0;
    for(int i = 0; i <= n; ++i) {
        if(a[i] >= o) {
            if(a[i] <= o + p) {
                x ++;
            } else {
                y ++;
            }
        } else {
            if(y >= k - 1) {
                ti += x;
            } else {
                ti += max(0, x - (k - 1 - y));
            }
            x = 0;
            y = 0;
        }
    }
    return ti >= q;
}
int main() {
#ifdef TT
    freopen("xxx.in", "r", stdin);
#endif // TT
    scanf("%d%d%d", &n, &k, &q);
    for(int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
    }
    a[n] = -1;
    ans = 1e9 + 7;
    for(int i = 0; i < n; ++i) {
        int L = 0, R = 1e9 + 7;
        while(L < R) {
            int mid = (L + R) >> 1;
            if(check(a[i], mid))
                R = mid;
            else
                L = mid + 1;
        }
        ans = min(ans, L);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define ALL(a) a.begin(), a.end()
typedef long long ll;
using namespace std;

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

    vector<int> A(3);
    int K;
    REP(i, 3) cin >> A[i];
    cin >> K;

    int count = 0;
    while (count != K) {
        SORT(A);
        A[2] *= 2;
        count++;
    }

    int ans = 0;
    REP(i, 3) ans += A[i];

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int dice[6]={};
    for(int i=0;i<6;i++){
        scanf("%d",&dice[i]);
    }
    int q=0;
    scanf("%d",&q);
    int top,s;
    int dicepos[6][6]={{1,6,5,3,2,4},{2,5,1,3,6,4},{3,4,5,6,2,1},{4,3,5,1,2,6},{5,2,6,3,1,4},{6,1,5,4,2,3}};
    for(int i=0;i<q;i++){
        scanf("%d %d",&top,&s);
        for(int i=0;i<6;i++){
            if(dice[i]==top){
                top=i+1;
            }else if(dice[i]==s){
                s=i+1;
            }
        }
        for(int i=0;i<4;i++){
            if(dicepos[top-1][4]==s){
                printf("%d\n",dice[dicepos[top-1][3]-1]);
                break;
            }
            int temp=dicepos[top-1][2];
            dicepos[top-1][2]=dicepos[top-1][3];
            dicepos[top-1][3]=dicepos[top-1][4];
            dicepos[top-1][4]=dicepos[top-1][5];
            dicepos[top-1][5]=temp;
        }
    }
}



Measured memory_bytes: 2620
#!/usr/bin/env python3
import sys
import math

def main():
    A, B, N = map(int, input().split())
    d = math.gcd(A,B)
    #if d == 1: # 互いに素
    x = min(N,B-1)
    print(math.floor(A*x/B)-A*math.floor(x/B))

if __name__ == '__main__':
    main()


Measured memory_bytes: 9172
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<=int(b);++i)
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for(int j=0;j<N;++j) {

int main(void) {
  int r;cin>>r;
  pr(r*2*3.1415926535);
  return 0;
}


Measured memory_bytes: 3776
x1, y1, x2, y2 = (int(i) for i in input().split())

x_diff = x2 - x1
y_diff = y2 - y1

print("{} {} {} {}".format((x2 - y_diff), (y2 + x_diff), (x1 - y_diff), (y1 + x_diff)))


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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll N = (ll)5e5 + 2;
const ll MOD = (ll)1e9 + 7;
const ll MOD1 = (ll)998244353;
const ll inf = (ll)1e18 + 6;

template <class T>
bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template <class T>
bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

ll add(ll x, ll y)
{
    x += y;
    if (x >= MOD)
        return x - MOD;
    return x;
}

ll sub(ll x, ll y)
{
    x -= y;
    if (x < 0)
        return x + MOD;
    return x;
}

ll mult(ll x, ll y)
{
    return (x * y) % MOD;
}

ll bin_pow(ll x, ll p)
{
    if (p == 0)
        return 1;
    if (p & 1)
        return mult(x, bin_pow(x, p - 1));
    return bin_pow(mult(x, x), p / 2);
}

ll rev(ll x)
{
    return bin_pow(x, MOD - 2);
}

int main()
{

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(20);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "rt", stdin);
#endif
    ll n;
    cin >> n;
    set<string> sett;
    forn(i, n)
    {
        string s;
        cin >> s;
        sett.insert(s);
    }
    cout << sett.size();
}


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

using namespace std;

//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 10;
//const ll INF = 1e18 + 10LL;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
const double EPS = 1e-10;
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)
ll MOD = 1e9 + 7;

string s;

int pa, gu;
int ans;

int main(void){
	cin>>s;

	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'g') {
			if (pa + 1 <= gu) {
				ans++;
				pa++;
			} else {
				gu++;
			}
		}
		else {
			if (pa + 1 <= gu) pa++;
			else {
				gu++;
				ans--;
			}
		}
	}

	printf("%d\n", ans);
	
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std;

typedef pair<int, int> P;

int main() {
	int n;
	long long m;
	while(cin >> n >> m && (n || m)){
		priority_queue<P> que;
		int d, p;
		for(int i = 0; i < n; ++i){
			cin >> d >> p;
			que.push(P(p, d));
		}
		long long ans = 0;
		while(!que.empty()){
			P p = que.top(); que.pop();
			m -= p.second;
			if(m <= 0){
				ans += p.first * abs(m);
				break;
			}
		}
		while(!que.empty()){
			P p = que.top(); que.pop();
			ans += p.first * p.second;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1332
#include<stdio.h>
#define max 5
int main(void)
{
  int a[max],  k, b = 0;
  int i, j;
  
  for(i = 0 ; i <= 4 ; i++)
    scanf("%d", &a[i]);
  scanf("%d", &k);
  
  for(i = 0 ; i <= 3 ; i++)
  {
    for(j = i+1 ; j <=4 ; j++)
    {
      if(a[j] - a[i] > k)
      {
        b = 1;
      }
    }
  }
  
  if(b == 0)
    printf("Yay!");
  else
    printf(":(");
  
  return 0;
}

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

#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define MAX 2e9
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()
const double PI = acos(-1);

using namespace std;
ll combi[3000][3000];
int main(void) {
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	//	freopen("input.txt", "r", stdin);

	combi[0][0] = combi[1][0] = combi[1][1] = 1;
	for (int i = 2; i < 3000; i++) {
		for (int j = 0; j <= i; j++) {
			if (j == 0 || j == i) combi[i][j] = 1;
			else combi[i][j] = combi[i - 1][j] + combi[i - 1][j - 1];
			combi[i][j] %= MOD;
		}
	}
	int S; cin >> S;
	int cnt = 1;
	ll ans = 0;
	while (1) {
		if (S < cnt * 3) break;
		int temp = S - cnt * 3;
		ans += combi[cnt + temp - 1][temp];
		ans %= MOD;
		cnt++;
	}
	cout << ans;
}


Measured memory_bytes: 49780
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
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; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    if (n % 2 == 1) {
        rep (i, m) {
            cout << i + 1 << " " << n - i - 1 << "\n";
        }
    } else {
        int j = n / 2;
        rep (i, min(n / 4, m)) {
            cout << i + 1 << " " << n / 2 - i << "\n";
        }
        rep (i, m - min(n / 4, m)) {
            cout << i + n / 2 + 1 << " " << n - i - 1 << "\n";
        }
    }
    return 0;
}

Measured memory_bytes: 3652
"use strict";
 
function main(arg) {
    arg = arg.split("\n")[0].split(" ");
    const D = arg[0];
    let N = arg[1];
    let zeros = [];
    
    if(parseInt(N) === 0) {
        console.log(0);
        return;
    }
    
    if(parseInt(N) === 100) {
        N = "101";
    }
    
    for(let i=0; i<D; i++) {
        zeros.push("00");
    }
    
    console.log(N + zeros.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 11468
#include <iostream>
#include <set>
#include <string>
using namespace std;
int main () {
	set <string, greater<string> > s1;
	int n;
	cin >> n;
	string str;
	getline(cin , str);
	for (int i=0;i< n;i++) {
		getline(cin , str);
		s1.insert(str);
	}
	cout <<s1.size();

}

Measured memory_bytes: 19176
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <locale>
#include <iomanip>
#include <math.h>

#define nl '\n'

using namespace std;

int n, d;

int main(){

    cin >> n;

    set<int> s;

    for(int i = 0; i < n; i++){
        cin >> d;
        s.insert(d);
    }

    cout << s.size();






}

//g++ -std=c++14 comp.cpp -o b; ./b.exealso

Measured memory_bytes: 256
S = input()
d = {a: 0 for a in 'abc'}
for x in S:
    d[x] += 1

if len(S) == 1 or (len(S) == 2 and max(d.values()) == 1) or (len(S) >= 3 and max(d.values()) - min(d.values()) <= 1):
    print('YES')
else:
    print('NO')

Measured memory_bytes: 3188
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class ARounding {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int x = Integer.parseInt(in.next());
            int a = Integer.parseInt(in.next());
            int ans = 0;
            if (x >= a) ans = 10;

            // 出力
            out.println(ans);

        }

    }
}



Measured memory_bytes: 35680
#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
#define ll long long
int main(){
	int a,b,c;
    cin >> a >> b >> c;
    int max =a ;
    int min =a;
    if(max<b)max=b;
    if(max<c)max=c;
    if(min>b)min=b;
    if(min>c)min=c;
    cout << max-min <<endl;
}


Measured memory_bytes: 256
#https://atcoder.jp/contests/abc077/tasks/arc084_a
N = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
a.sort()
b.sort()
c.sort()
ai = 0
ci = 0
for bi in b:
    while ai < N and a[ai] < bi:
        ai += 1
    while ci < N and c[ci] <= bi:
        ci += 1
    ans += ai * (N -ci)
print(ans)


Measured memory_bytes: 23248
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

class unionfind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.size = [1 for i in range(n)]
    def find(self,a):
        if a == self.parent[a]: return a
        else: self.parent[a] = find(self,self.parent[a]); return self.parent[a]
    def unite(self,a,b):
        pa,pb = self.find(self,a), self.find(self,b)
        if pa == pb: return
        else: self.parent[pb] = pa; self.size[pa] += self.size[pb]
    def same(self,a,b): return find(self,a) == find(self,b)

n = iinput()
x = iarr()

vals = []
for p in range(1,101):
    val = sum([(xx - p)**2 for xx in x])
    vals.append(val)
    
ans = min(vals)
print(ans)


Measured memory_bytes: 37548
def main():
    S = input()
    T = input()
    N = len(S)
    M = len(T)
    ans = 10**6
    for i in range(N-M+1):
        cur = 0
        for j in range(M):
            if S[i+j] != T[j]:
                cur += 1
        ans = min(ans, cur)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 67472
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) 
{ 
    // Everything divides 0  
    if (a == 0) 
       return b; 
    if (b == 0) 
       return a; 
   
    // base case 
    if (a == b) 
        return a; 
   
    // a is greater 
    if (a > b) 
        return gcd(a-b, b); 
    return gcd(a, b-a); 
} 
int main() {
    int n,sum=0;
    cin >>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int k=1;k<=n;k++){
               sum+=gcd(i,gcd(j,k));
            }
        }
    }
  cout << sum << endl;
   return 0;
}


Measured memory_bytes: 3652
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	defer writer.Flush()
	H, W, K := ReadInt(), ReadInt(), ReadInt()
	grid := make([]string, H)
	for i := 0; i < H; i++ {
		grid[i] = ReadString()
	}

	ans := make([][]int, H)
	for i := 0; i < H; i++ {
		ans[i] = make([]int, W)
	}

	cnt := 0
	for h := 0; h < H; h++ {
		pos := make([]int, 0) // この行のイチゴ位置
		for w := 0; w < W; w++ {
			if grid[h][w] == '#' {
				pos = append(pos, w)
			}
		}
		if len(pos) == 0 {
			// イチゴがなければ次の行へ
			continue
		}
		// イチゴがあれば、この行の左から右まで、番号を付ける。
		left := 0
		for i, right := range pos {
			for w := left; w <= right; w++ {
				ans[h][w] = cnt + i + 1
			}
			left = right + 1
		}
		for w := left; w < W; w++ {
			ans[h][w] = cnt + len(pos)
		}
		cnt += len(pos)

		// 上で0になっている行にも、同じ番号をつける
		for nh := h - 1; nh >= 0 && ans[nh][0] == 0; nh-- {
			ans[nh] = ans[h]
		}
		if cnt == K {
			// イチゴが全部見つかったので下の行にも同じ番号をつけて終了
			for nh := h + 1; nh < H; nh++ {
				ans[nh] = ans[h]
			}
			break
		}
	}

	for h := 0; h < H; h++ {
		for w := 0; w < W; w++ {
			Printf("%d ", ans[h][w])
		}
		Println()
	}
}

var writer = bufio.NewWriter(os.Stdout)

func Printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }
func Println(a ...interface{})               { fmt.Fprintln(writer, a...) }

var scanner = bufio.NewScanner(os.Stdin)

func init() {
	scanner.Buffer(make([]byte, 256), 1e9)
	scanner.Split(bufio.ScanWords)
}
func ReadString() string { scanner.Scan(); return scanner.Text() }
func ReadInt() int {
	a, err := strconv.Atoi(ReadString())
	if err != nil {
		panic(err)
	}
	return a
}


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

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t,n,m,i,j;
	t = 1;
	while(t--) {
	 cin >> n >> m;
	 i = m - n + 1;
	 j = m + n - 1;
	 if(i < -1000000)
	  i = -1000000;
	 if(j > 1000000)
	  j = 1000000;
	 while(i <= j) {
	  cout << i << " ";
	  i++;
     }
     cout << endl;
	}
	return 0;
}



Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	string s; cin >> s;
	s[3] = '8';
	cout << s << endl;
}

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

int main() {
	ll n;

	cin >> n;

	double sum = 0, x;
	for(int i = 0; i < n; ++i) {
		cin >> x;
		sum += 1.0/x;
	}

	printf("%0.7lf\n", 1.0/sum);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
#define ll long long
const int MOD = 1e9+7;
using namespace std;

int main(){
	int n;
	cin >> n;
	cout << n*n*n << endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;

class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(ReadLine());
        int[,] scores = new int[N, 3];
        int[] s = ReadLineParseIntArray();
        for(int i = 0; i < 3; i++)
        {
            scores[0,i] = s[i];
        }
        for(int i = 1; i < N; i++)
        {
            int[] abc = ReadLineParseIntArray();
            for(int j = 0; j < 3; j++)
            {
                scores[i,j] = Max(scores[i - 1, (j + 1) % 3], scores[i - 1, (j + 2) % 3]) + abc[j];
            }
        }
        int max = 0;
        for(int i = 0; i < 3; i++)
        {
            if (max < scores[N - 1, i])
                max = scores[N - 1, i];
        }
        WriteLine(max);
    }

    static int ReadLineParseInt() => int.Parse(ReadLine());
    static int[] ReadLineParseIntArray() => ReadLine().Split(' ').Select(int.Parse).ToArray();
}

Measured memory_bytes: 18356
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int w, h, n;
  cin >> w >> h >> n;
  int x[2] = {0,w};
  int y[2] = {0,h};
  for(int i=0; i<n; i++){
    int xi, yi, ai;
    cin >> xi >> yi >> ai;
    if(ai==1){
      x[0] = max(xi, x[0]);
    }
    if(ai==2){
      x[1] = min(xi, x[1]);
    }
    if(ai==3){
      y[0] = max(yi, y[0]);
    }
    if(ai==4){
      y[1] = min(yi, y[1]);
    }
  }
  if(x[0]>=x[1] || y[0]>=y[1]){
    cout << 0 << endl;
  }else{ 
    int ans = (x[1]-x[0])*(y[1]-y[0]);
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {
    vector<int> v(5);
    REP(i, 5) cin >> v[i];
    REP(i, 5) if (v[i] != i + 1){
        cout << (i + 1) << endl;
        return 0;
    }

    return 0;
}

Measured memory_bytes: 3108
//
//  main.cpp
//  Practice
//
//  Created by 石川　敬規 on 2017/08/11.
//  Copyright © 2017年 石川　敬規. All rights reserved.
//

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
    int n, a;
    
    cin >> n;
    
    int cnt = 0;
    
    for ( int i = 0; i < n; i++ ) {
        cin >> a;
        if ( a % 4 == 0 ) cnt += 2;
        else if ( a % 2 == 0 ) cnt++;
    }
    
    if ( cnt >= n / 2 * 2 ) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

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

#define ll long long int
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f
#define show(x) cerr<<#x<<" : "<<x<<'\n';
#define yogeshk972() cerr<<"\nTime Taken : "<<(float)(clock()-time_p)/CLOCKS_PER_SEC<<"\n";
clock_t time_p=clock();

using namespace std;
const int N=2e5+1, mod= 1e9+7;


int main(){
	ios_base::sync_with_stdio(0);	cin.tie(0);
	
	string s;  int k;
	cin>>s>>k;
	if(k==1){
		int ct=0;
		for(int i=0;i<(int)s.length()-1; ){
			if(s[i]==s[i+1]) ct++,i+=2;
			else i++;
		}
		cout<<ct;
	}else{

		int st=0,ed=0;
		while(st<(int)s.length() && s[st]==s[0])st++;
		
		if( st==(int)s.length() ){
			cout<<(1LL*k*s.length())/2;
			return 0;
		}
		
		while(ed<(int)s.length() && s[ s.length()-1-ed ]==s[0])ed++;
		ll res= 1LL*(k-1)*((st+ed)/2) + st/2 + ed/2, ct=0;
		for(int i=st;i<(int)s.length()-ed; ){
			if(s[i]==s[i+1])ct++,i+=2;
			else i++;
		}
		cout<<res+1LL*ct*k<<"\n";
	}
	
    yogeshk972();
}


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

using namespace std;
typedef long long ll;

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; }

#define rep(i, N) for(ll i=0; i<(N); ++i)

//sqrtN -> 最大値のみに対応できればいいので，それを使う
const int sqrtN = 512;
struct SqrtDecomposition {
  int N, K;
  vector<int> data;
  vector<int> bucketData;
  const int INIT_VALUE = 0;
  
  SqrtDecomposition(int n) : N(n) {
    //分割数
    K = (N + sqrtN - 1) / sqrtN;
    data.assign(K * sqrtN, 2147483647);
    bucketData.assign(K, -1);
  }
  
  //ここまで共通
  
  void update(int x, int y, int v) {
    for(int k = 0; k < K; ++k) {
      int l = k * sqrtN;
      int r = (k + 1) * sqrtN;
      if(y <= l || x >= r) continue;  //完全に区間外
      if(l >= x && y >= r) {  //完全に区間内をUPDATE（遅延bucketのみ）
        bucketData[k] = v;
      } else {
        //一部区間内
        if(bucketData[k] != -1) {
          //まず，bucketを伝搬
          for(int i = l; i < r; ++i) {
            data[i] = bucketData[k];
          }
          bucketData[k] = -1;
        }
        
        for(int i = max(x, l); i < min(y, r); ++i) {
          data[i] = v;
        }
      }
    }
  }
  
  // [x, y)
  int find(int x) {
    int k = x / sqrtN;
    
    //伝搬
    if(bucketData[k] != -1) {
      for(int i = k * sqrtN; i < (k + 1) * sqrtN; ++i) {
        data[i] = bucketData[k];
      }
      bucketData[k] = -1;
    }
    
    return data[x];
  }
};

int main() {
  //range sum query
  int n, q;
  cin >> n >> q;
  
  SqrtDecomposition dec(n);
  vector<string> res;
  rep(_, q) {
    int c;
    cin >> c;
    if(c == 0) {
      int s, t, x;
      cin >> s >> t >> x;
      ++t;
      dec.update(s, t, x);
    } else {
      int i;
      cin >> i;
      cout << dec.find(i) << endl;
    }
  }
}



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

#define FOR(i,k,n)  for(int i = (k);i < (n);++i)
#define REP(i,n)    FOR(i,0,n)
#define ALL(x)      begin(x),end(x)

using namespace std;

using vecint = vector<int>;
using ll = int64_t;

int main()
{
  int n;
  cin>>n;
  vecint v(n);
  REP(i,n){
    cin>>v[i];
    --v[i];
  }
  int cnt = 0;
  REP(i,n) {
    if (v[i] > i) {
      if (v[v[i]] == i) ++cnt;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

int main() {
  int n,m;
  cin >> n;
  vector<long long int> d(n,0); for(int i = 0;i < n;i++) { cin >> d[i]; }
  cin >> m;
  vector<long long int> t(m,0); for(int i = 0;i < m;i++) { cin >> t[i]; }

  map<long long int,int> M;
  for(int i = 0;i < n;i++) { M[d[i]]++; }
  for(int i = 0;i < m;i++) {
    if(M[t[i]] <= 0) {
      cout << "NO\n";
      return 0;
    } else {
      M[t[i]]--;
    }
  }

  cout << "YES\n";
  return 0;
}

Measured memory_bytes: 15872
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int n, k, s, i, j;

    for(;;){
      n = sc.nextInt(); k = sc.nextInt(); s = sc.nextInt();
      if(n == 0 && k == 0 && s == 0)break;
      out.println(solve(n, k, s));
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
  private static int solve(int n, int k, int s){
    if(k == 0 && s == 0)return 1;
    if(n == 0)return 0;
    return solve(n - 1, k - 1, s - n) + solve(n - 1, k, s);
  }
}

Measured memory_bytes: 20028
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int maxn = 1e6 + 7;
const int INF = 0x3f3f3f3f;

int a[maxn];

int main() {
    int n,r;
    while(cin >> n >> r) {
        if(n < 10) cout << r + 100 * (10 - n) << endl;
        else cout << r << endl;
    }
    return 0;
}


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

int main() {
 string X;
 cin >> X;
 
 int countA = 0;

  
 for(int i = 0; i < X.size(); i++){
   if ( X.at(i) == 'A' ) break;
   else countA++;
 }
  
  int countB = 0; 
  
   for(int i = X.size()-1 ; i >= 0 ; i--){
   if ( X.at(i) == 'Z' ) break;
   else countB++;
 }
  
 cout << X.size() - countA - countB << endl; 
}

Measured memory_bytes: 640
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        int n = scan.nextInt();
        if(n / 1.08 % 1 == 0){
            System.out.println((int)(n / 1.08));
            return;
        }
        for(int i =(int) (n / 1.08); i <= n; i++){
            if((int) (i * 1.08) == n){
                System.out.println((int) i);
                return;
            }
        }
        System.out.println(":(");
        scan.close();
    }
}

Measured memory_bytes: 21972
/**
 * agc039a
 * A - Connection and Disconnection
 *
 * with "kotlin ver.1.3.41"
 */

fun main(args: Array<String>){
	val s: String = readLine()!!.toString()
	val k = readLine()!!.toInt()
	println(agc039a(s, k))
}

fun agc039a(s: String, k: Int): Long{
	val s1 = f(s)
	val s2 = f(s+s)
	val s3 = f(s+s+s)
	val d1 = s2 - s1
	val d2 = s3 - s2
	val d = d1 + d2

	var ans: Long
	if(k < 2) ans = s1;
	else if(k < 3) ans = s2;
	else if(k < 4) ans = s3;
	else{
		if(d1 == d2) ans = s1 + d1 * (k-1);
		else
			if(k%2 != 0) ans = s1 + d * ((k+2-1)/2-1);//(k/2):roundup
			else ans = s2 + d * (k/2-1);
	}
	return ans;
}

fun f(s: String): Long{
	var c = 0L
	var i = 1
	while(i<s.length){
		if(s[i-1] == s[i]){ c++; i++ }
		i++
	}
	return c;
}

Measured memory_bytes: 33720
n,k = map(int,input().split())
s = [int(input()) for i in range(n)]
s.sort()
c = s[k-1] - s[0]
for i in range(1,n-k+1):
    t = s[i+k-1] - s[i] 
    if t < c:
        c = t

print(c)

Measured memory_bytes: 7384
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ull = unsigned long long;
using vl = vector<ll>;
using vi = vector<int>;
using vchar = vector<char>;
using vstr = vector<string>;
using pll =  pair<ll,ll>;

const ll mod = 1000000007;
const ll inf = 1000000000000000;

#define pi acos(-1)
#define pb push_back
#define test int TEST;cin>>TEST;while(TEST--)
#define vsort(xx) sort(xx.begin(),xx.end())
#define vrevsort(xx) sort(xx.rbegin(),xx.rend())


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll a,h;
    cin>>a;
    h=(a/500)*1000 + ((a%500)/5)*5;
    cout<<h;
    
    
   
    return 0;
}




Measured memory_bytes: 256
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

n = int(input())

ans = 0

for i in range(1,n+1,2):
  if len(make_divisor_list(i))==8:
    ans +=1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
using namespace std;
 
int main() {
  int flag = 0;
  string s, t;
  cin >> s >> t;
  s = s+s;
  r(i,s.length()){
    if(s.substr(i,t.length())==t) flag = 1;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>
#include<functional>
#include<deque>

using namespace std;
typedef long long int ll;

#define C cout<<
#define E <<endl
#define CE cout<<endl

ll n,m,a,b,c,x,y,z,aa[200010],ab[200010],ac[1010][1010];
bool r,ra,rb,rc;
string s,sa,sb,sc;
char ca,cb,cc,cd[1010][1010];
vector<ll> va,vb,vc,vd,ve;


int main(){
    cin>>n>>a>>b;
    C min(b,a*n) E;
}


Measured memory_bytes: 764
# -*- coding: utf-8 -*-
 
# t, s = map(str,input().split())

s = input()
t = input()

min_change = len(t)
for i in range(len(s) - (len(t) - 1)):
    change = 0
    for j in range(len(t)):
        if t[j] != s[i + j]:
            change += 1

    min_change = min(min_change, change)

print(min_change)

Measured memory_bytes: 8876
# coding: utf-8
n,m,x,y=map(int,input().split())
a=max(map(int,input().split()))
b=min(map(int,input().split()))
a=max(a,x)
b=min(b,y)
if a<b:
    print('No War')
else:
    print('War')
    

Measured memory_bytes: 3060
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(true){
		int H=sc.nextInt();
		int W=sc.nextInt();
		if( H==0&& W==0) {
			break;
		}
		for(int a=0;a<H;a++) {
			for(int b=0;b<W;b++) {
				System.out.print("#");
			}
			System.out.println("");
		}
		System.out.println("");
		}
	}
}




Measured memory_bytes: 32652
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define double long double
#define ll long long
#define INF LLONG_MAX/3
#define P pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
#define ggr getchar();getchar();return 0
using namespace std;
signed main(){
	int n,k;
	string s;
	cin>>n>>s>>k;
	char c=s[k-1];
	for(char a:s){
		if(a!=c)a='*';
		cout<<a;
	}
	cout<<endl;
	ggr;
}

Measured memory_bytes: 256
/*
    Author: Alam Khan
    AUST CSE 40th Batch

*/

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

typedef double ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef deque<ll> dl;
typedef stack<ll> stl;
typedef set<ll> sl;
typedef map<string, ll> msl;
typedef map<ll,ll> mll;
#define sf(n)     scanf("%lld",&n)
#define sff(n,m)     scanf("%lld %lld",&n,&m)
#define sfff(n,m,r)     scanf("%lld %lld %lld",&n,&m,&r)
#define sfs(n)     scanf("%s",n)
#define pf(n)     printf("%lld\n",n)
#define pff(n,m)     printf("%lld %lld\n",n,m)
#define pfff(n,m,r)     printf("%lld %lld %lld\n",n,m,r)
#define pfs(n)     printf("%s\n",n)
#define pfcs(i,n)     printf("Case %lld: %lld\n",i,n)
#define pb     push_back
#define prf     printf
#define inf     2e18
#define low     -1000000000000
#define PI        acos(-1.0)
#define rep1(i,n) for(i=1;i<n;i++)
#define rep0(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define repe1(i,n) for(i=1;i<=n;i++)
#define repe0(i,n) for(i=0;i<=n;i++)
#define repe(i,a,n) for(i=a;i<=n;i++)

int main()
{

   double n,i,j,k,l,b,c,d,e,f,s;
    int a;
     scanf("%d",&a);
     double a1[a];

     for(int i=0;i<a;i++)
     {
         scanf("%lf",&a1[i]);
     }

     sort(a1,a1+a);
      s=(a1[0]+a1[1])/2;
     /// printf("%lf\n",s);
      if(a==3)
      {   s=s+a1[2];
      s=s/2;
          printf("%0.3lf\n",s);
          return 0;
      }

     for(int i=2;i+1<=a;i++)
     {
        /// printf("%lf\n",s);
         l=a1[i];
        s=s+l;
        s=s/2;
     }
     printf("%0.3lf\n",s);


}


Measured memory_bytes: 256
def multival(): return map(int,input().split())
def data(N=1): return [list(map(int,input().split())) for _ in range(N)]
mod = 10**9 + 7
inf = float("inf")

N,M = multival()
nemat = [[0]*N for _ in range(N)]
ans = 0
for _ in range(M):
    a,b = multival()
    a -= 1; b-= 1
    nemat[a][b] = 1
    nemat[b][a] = 1

def dfs(now=0,visited=[False]*N):
    visited[now] = True
    if all(visited) is True:
        global ans
        ans += 1
    for ne in range(N):
        if nemat[now][ne] == 1 and visited[ne] is False:
            dfs(ne,visited[:])

dfs()
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int x(int p,long q){long long s=1;for(long i=0;i<q;i++)
{s*=p;s%=1000000007;}return s;}
int main(){long N;cin>>N;long long a;
           a=x(10,N)-(x(9,N)*2)+x(8,N);
           a%=1000000007;
           if(a<0)a+=1000000007;cout<<a<<endl;}
           

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

int main() {
  int n;
  cin>>n;
  vector<int> a(n);
  rep(i,n) cin>>a.at(i-1);
  int x=1000000;
  int c=0;
  rep(i,100){
    rep(j,n){
      c+=(i-a.at(j-1))*(i-a.at(j-1));
    }
    x=min(c,x);
      c=0;
  }
  cout<<x<<endl;
}

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")
int table[365][26];
int main()
{	int D;
	cin >> D;
	vec(C);
	vec(Las);
	fx(26) {
		vecp(C);
		Las.push_back(0);
	}

	fx(D) {
		fy(26) {
			cin >> table[x][y];
		}
	}

	vec(T);
	srand((time(NULL)));
	fx(D) {
		pb(T, rand() % 26 + 1);
	}
	ll sum = 0,preSum=0;
	vector<int> S(D,0);

	int preDay = 0;
	fx(7500) {
		int d;
		 
		 int dif = INT_MAX, ind = 0;
		 fw(D-1) {
			 if (S[w+1]-S[w]<dif) {
				 ind = w + 1;
				 dif = S[w + 1] - S[w];
			 }
		 }
		 d = ind;
		 if (d==preDay || sum==preSum) {
			 int d1 = d;
			 while (d1==d) {
				 d1 = rand() % D + 1;
			 }
			 T[d - 1] ^= T[d1 - 1];
			 T[d1 - 1] ^= T[d - 1];
			 T[d - 1] ^= T[d1 - 1];
			 fy(26) {
				 Las[y] = 0;
			 }
			 sum = 0;
			 fw(D) {

				 sum += table[w][T[w] - 1];
				 Las[T[w] - 1] = w + 1;
				 fz(26) {
					 sum -= C[z] * (w + 1 - Las[z]);
				 }
				 S[w] = sum;
			 }
			 continue;
		 }
		 preSum = sum;

		 for (int q = 1; q <= 26; q++) {
			 int pre = T[d - 1];
			 if (q == pre) { continue;}
			 T[d - 1] = q;
			 ll ans = 0;
			 vector<int> G(S);
			 fy(26) {
				 Las[y] = 0;
			 }
			 fw(D) {

				 ans += table[w][T[w] - 1];
				 Las[T[w] - 1] = w + 1;
				 fz(26) {
					 ans -= C[z] * (w + 1 - Las[z]);
				 }
				 S[w] = ans;
			 }
			 if (ans > sum) {
				 sum = ans;
				 S = G;
			 }
			 else {
				 T[d - 1] = pre;
			 }
		 }
	
	}

	fx(D) {
		ce(T[x])
	}
    return 0;
}



Measured memory_bytes: 3672
#include <iostream>

using namespace std;

int main(){
	int N, M, P;
	int x[100];
	while(cin >> N >> M >> P, N){
		int winner = 0;
		int sum = 0;
		for(int i=0;i<N;i++){
			cin >> x[i];
			if(i+1 == M) winner = x[i];
			sum += x[i] * (100-P);
		}
		cout << (winner ? sum/winner : 0) << endl;
	}
}

Measured memory_bytes: 1160