akhauriyash/Code-Regression huggingface dataset:
/* Preprocess */
#include <bits/stdc++.h>

#define pow(n) (n)*(n)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()


/* Field */
using namespace std;


/* Function */
int main (void) 
{

  /* Variable_Proclamation */
  int a, b;   // input 基本料金
  string ans; // output

  int pro; // product（積）
  int sur; // surplus（剰余）


  /* Variable_Proclamation */
  cin >> a >> b;


  /* Calculation */
  pro = a * b;
  sur = pro % 2;

  if(sur == 1)
  {
    ans = "Odd";
  }
  else if(sur == 0)
  {
    ans = "Even";
  }


  /* Output */
  cout << ans << endl;


  return 0;

}


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

int n,m,q;
vector<int> a,b,c,d;
int ans;

void dfs(vector<int> A) {
	if (A.size() == n+1) {
		int now = 0;
		rep(i,q) {
			if (A[b[i]] - A[a[i]] == c[i]) now += d[i];
		}
		ans = max(ans, now);
		return;
	}

	A.push_back(A.back());
	while (A.back() <= m) {
		dfs(A);
		A.back()++;
	} 
}


int main() {
	cin >> n >> m >> q;
	a = b = c = d = vector<int>(q);
	rep(i,q) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}
	dfs(vector<int>(1,1));
	cout << ans << endl;
	return 0;
}


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

int main(){
    int n;
    ll ans=0;
    cin>>n;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    sort(a.begin(),a.end());
    for(int i=0;i<n-1;i++){
        ans+=a[(2*(n-1)-i)/2];
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 4032
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cstdio>
using namespace std;

int getint(){
    int x = 0, c = getchar();
    while(c > 47 && c < 58){
        x = x * 10 + c - 48;
        c = getchar();
    }
    return x;
}

constexpr int MAX = 300001;
int res[MAX * 4];

int main(){
    int H = getint();
    int W = getint();
    int M = getint();

    int h, w, ans;
    int mxr = 0;
    int mxc = 0;
    int ctrow = 0;
    int ctcol = 0;
    for(int i = 0; i < M; ++i){
        h = getint(), w = getint();
        res[i + 2 * MAX] = h, res[i + 3 * MAX] = w;
        int x = ++res[h], y = ++res[w + MAX];

        if(x == mxr) ++ctrow;
        else if(x > mxr) mxr = x, ctrow = 1;

        if(y == mxc) ++ctcol;
        else if(y > mxc) mxc = y, ctcol = 1;
    }
    ans = mxr + mxc;

    long ct = ctrow;
    ct *= ctcol;
    if(ct > M){
        printf("%d\n", ans);
        return 0;
    }

    for(int i = 0; i < M; ++i) if(res[res[i + 2 * MAX]] == mxr && res[res[i + 3 * MAX] + MAX] == mxc) --ct;
    if(ct <= 0) --ans;
    printf("%d\n", ans);
}

Measured memory_bytes: 6260
from decimal import Decimal

for _ in range(1):
    a = list(input().split(' '))
    A = int(a[0])
    B = Decimal(a[1])

ans = str(A * B)
idx = 0
for i in range(len(ans)):
    if ans[i] == '.':
        idx = i
        break
print(ans[:i])


Measured memory_bytes: 10008
/**
 *  Kaiwen Zhou,
 *  CUHK
**/
#include <bits/stdc++.h>
using namespace std;
#define INS ios::sync_with_stdio(false);cin.tie(0);
#define INF 100000000000
typedef long long LINT;

vector<LINT> s, t;

pair<LINT, LINT> dichotomy(LINT x, vector<LINT> &v, LINT l, LINT r) {
    if(x > v[r]) return make_pair(v[r], INF);
    if(x < v[l]) return make_pair(-INF, v[l]);
    if(l == r - 1) return make_pair(v[l], v[r]);
    LINT m = (l + r) / 2;
    if(x > v[m])
        return dichotomy(x, v, m, r);
    else
        return dichotomy(x, v, l, m);
}

int main(void) {
    INS;
    LINT A, B, Q;
    cin >> A >> B >> Q;
    for(int i = 0; i < A; i ++) {
        LINT temp;
        cin >> temp;
        s.push_back(temp);
    }
    for(int i = 0; i < B; i ++) {
        LINT temp;
        cin >> temp;
        t.push_back(temp);
    }
    for(int i = 0; i < Q; i ++) {
        LINT x;
        cin >> x;
        pair<LINT, LINT> poss = dichotomy(x, s, 0, A - 1);
        pair<LINT, LINT> post = dichotomy(x, t, 0, B - 1);
        pair<LINT, LINT> poss1 = dichotomy(poss.first, t, 0, B - 1);
        pair<LINT, LINT> poss2 = dichotomy(poss.second, t, 0, B - 1);
        pair<LINT, LINT> post1 = dichotomy(post.first, s, 0, A - 1);
        pair<LINT, LINT> post2 = dichotomy(post.second, s, 0, A - 1);

        cout << min({abs(x - poss1.first), abs(x - poss.first) + abs(poss1.second - poss.first),
                     abs(poss2.second - x), abs(poss.second - x) + abs(poss.second - poss2.first),
                     abs(x - post1.first), abs(x - post.first) + abs(post1.second - post.first),
                     abs(post2.second - x), abs(post.second - x) + abs(post.second - post2.first)}) << '\n';
    }
    return 0;
}


Measured memory_bytes: 3060
import sys
input = sys.stdin.readline


def divisors(num):
    array = []
    limit = int(num ** 0.5) + 1
    for i in range(1, limit):
        if num % i == 0:
            div1 = i
            div2 = num//i
            array.append(div1)
            if div1 != div2:
                array.append(div2)
    array.sort()
    return array


def main():
    n = int(input())
    ans = 0
    for i in range(1, n+1, 2):
        count = len(divisors(i))
        if count == 8:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()


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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

const int MC = 2e5 + 3;
LL x[MC],y[MC];
LL A[MC];

int main(){
	int N; cin >> N;
	repp(i,0,N) cin >> A[i+1];
	{
		stack<pair<LL,LL>> S;
		S.push(MP(N,1e9+7));
		x[N] = 0;
		repm(i,N-1,0){
			x[i] = x[i+1];
			if(A[i] <= A[i+1]){
				LL B = A[i];
				LL m = 0;
				while(B*4 <= A[i+1]){
					B *= 4;
					++m;
				}
				if(m) S.push(MP(i,m));
			} else {
				LL B = A[i+1];
				LL m = 0;
				while(A[i] > B){
					B *= 4;
					++m;
				}
				int j = i;
				while(m>0){
					x[i] += m * (S.top().first-j);
					j = S.top().first;
					if(S.top().second > m){
						S.top().second -= m;
						m = 0;
					} else {
						m -= S.top().second;
						S.pop();
					}
				}
			}
		}
	}
	{
		stack<pair<LL,LL>> S;
		S.push(MP(1,1e9+7));
		y[1] = 0;
		repp(i,2,N+1){
			y[i] = y[i-1];
			if(A[i] <= A[i-1]){
				LL B = A[i];
				LL m = 0;
				while(B*4 <= A[i-1]){
					B *= 4;
					++m;
				}
				if(m) S.push(MP(i,m));
			} else {
				LL B = A[i-1];
				LL m = 0;
				while(A[i] > B){
					B *= 4;
					++m;
				}
				int j = i;
				while(m>0){
					y[i] += m * (j-S.top().first);
					j = S.top().first;
					if(S.top().second > m){
						S.top().second -= m;
						m = 0;
					} else {
						m -= S.top().second;
						S.pop();
					}
				}
			}
		}
	}
	LL ans = 1e18;
	repp(k,0,N+1){
		ans = min(ans,x[k+1]*2+y[k]*2+k);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<long long>;
using vpii = vector<pair<int,int>>;
using vivi = vector<vector<int>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};



int main(void) {
  int n,d;
  cin >> n >> d;
  cout << (n+(d*2+1)-1)/(d*2+1) << endl;
    
}


Measured memory_bytes: 256
n = int(input())
l = [int(input()) for i in range(n)]
ans = sum(l)

def f():
  if not ans % 10 == 0:
    return ans
  else:
    for i in sorted(l):
      if not i % 10 == 0:
        return ans - i
    return 0
print(f())

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

#define ALL(a) (a).begin(), (a).end()

using namespace std;

int solve() {
	int n; cin >> n;
	vector<int> inp(n);
	for(auto& e: inp) cin >> e;
	stack<int> st;
	vector<bool> inner(1000,false);
	for(size_t i = 0; i < n; i++) {
		auto e = inp[i];
		if( e > 0 ) {
			if( inner[e] ) {
				return  i+1;
			}
			else {
				inner[e] = true;
				st.push(e);
			}
		}
		else {
			e *= -1;
			if(st.size() == 0) {
				return i+1;
			}
			if(st.top() != e ) {
				return i+1;
			} else {
				st.pop();
				inner[e] = false;
			}
		}
	}
	return -1;
}

signed main(){
	auto ans = solve();
	if(ans == -1){
		cout << "OK" << endl;
	} else {
		cout << ans << endl;
	}

	return 0;
}




Measured memory_bytes: 3120
#include <stdio.h>
int main()
{
    int N,a,b;
    scanf("%d",&N);
    if(10<=N&&N<=99)
    {a=N/10;
    b=N%10;
    if (a==9||b==9)
    {printf("Yes");}
    else
    {printf("No");}}
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;


//      DEEP

using namespace std;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define all(v) v.begin(),v.end()
#define pb push_back
//#define endl '\n'
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pi;
typedef pair<long long,long long> pll;
typedef set<int> si;




/*
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
*/
/*
typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_set;
*/

const ll mod = 1e9 + 7;
const ll modl=998244353;
const double pie=3.1415926535;
                                                    //power
ull power(ull x,ull y){
   if(y==0) return 1;
   else{
     if(y%2==0) return power(x*x,y/2);
     else return x*power(x*x,(y-1)/2);
   }
}

                        //                    Modular Exponentiation

ll mod_power(ll x, ll y, ll m)
{
    ll r = 1;     // Initialize result

    x = x % m; // Update x if it is more than or equal to m

    if (x == 0) return 0; // In case x is divisible by m;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            r = (r*x) % m;

        // y must be even now
        y = y/2;
        x = (x*x) % m;
    }
    return r;
}

                                                      //GCD
ll gcd(ll x,ll y){
   if(y==0)return x;
   return gcd(y,x%y);
}
                                              // SIEVE

/*
bool isPrime[100001];
void sieve(int N) {

        for(int i = 0; i <= N;++i) {
            isPrime[i]=true;
        }
        isPrime[0]=false;
        isPrime[1]=false;

        for(int i = 2; i * i <= N; ++i) {
             if(isPrime[i] == true) {
                 for(int j = i * i; j <= N ;j += i)
                     isPrime[j] = false;
            }
        }
    }
*/
/*
const int N=100001;
ll fact_inverse[N];
ll num_inverse[N];
ll fact[N];
void number_inverse(int m){
   num_inverse[0]=1;
   num_inverse[1]=1;
   for(int i=2;i<=N;i++){
     num_inverse[i]=num_inverse[m%i]*(m - m/i)%m;
   }
}

void factorial_inverse(int m){
   fact_inverse[0]=1;
   fact_inverse[1]=1;
   for(int i=2;i<=N;i++){
      fact_inverse[i]=(num_inverse[i]*fact_inverse[i-1])%m;
   }
}

void factorial(int m){
  fact[0]=1;
  for(int i=1;i<=N;i++)fact[i]=(i*fact[i-1])%m;
}

int modular_nCr(int n,int r,int m){
   ll res=((fact[n]*fact_inverse[r])%m *  fact_inverse[n-r])%m;
   return res;
}
*/
 
int main(){
    boost;
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
      int n;
      cin>>n;
      if(n==1)cout<<0<<endl;
      else cout<<1<<endl;
}
}









Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x) cout<<#x<<" = "<<(x)<<endl;
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  int h,w; cin >> h >> w;
  int H,W; cin >> H >> W;
  COUT(h*w - (H*w + W*h - (H*W)));

  return 0;
}

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

#define pow(n) (n)*(n)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

using namespace std;


int main (void) 
{

  /* Variable_Proclamation */
  string S;    // input
  char ans;  // output

  int  i;    // subscript
  char char_cnt;
  int  count;


  /* Input, Array_Proclamation */
  cin >> S;


  /* Initialize */
  ans   = ' ';
  count = 0;


  /* Calculation */
  sort( all(S) );
  for(char_cnt = 'a';  char_cnt <= 'z';  char_cnt++)
  {

    for(i=0; i<S.size(); i++)
    {
      if( S.at(i) == char_cnt )
      {
        break;
      }
      else
      {
        count = i;
      }
    }

    if( count == S.size() -1 )
    {
      ans = char_cnt;
      break;
    }

  }
  

  /* Output */
  if(ans != ' ')
  {
    cout << ans << endl;
  }
  else
  {
    cout << "None" << endl;
  }
  


  return 0;

}


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

using namespace std;

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

void dbg(){ cerr << "\n"; }  
template <typename T1,typename ...T2>
void dbg(const T1& p1, const T2&...pr){ cerr << p1 << ": "; dbg(pr...);}


int main(){
	int n;
	cin >> n;
	VI a(n);
	rep(i,n) cin >>a[i];
	ll ans =0;

	
	rep(i,(int)pow(3, n)){
		vector<int> vi(n);
		for(int j=0, wki=i; j<n; j++, wki/=3){
			vi[n-1-j] = wki%3;
		}
		ll  w=1;
		rep(j,n){
			int z = a[j] - 1 + vi[j];
			//if(z <=0) w=0;
			w *=z;
			
			if(j==n-1){
				if( w%2==0) ans++;
				//printf("%d:%d ",j,w);
				w=1;
			}
		}
	}
	cout<<ans <<"\n";
	
	return 0;
}


Measured memory_bytes: 256
mod = 1000000007
N,M = list(map(int,input().split()))

b = [0]*(N+2)
b[0]=1

for i in range(M):
    b[int(input())] = -1

for i in range(N):
    if b[i] != -1:
        if b[i+1] != -1:
            b[i+1] += b[i]
        if b[i+2] != -1:
            b[i+2] += b[i]
print(b[N]%mod)

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

using namespace std;


#ifdef zxc

#include <sys/resource.h>
#include "debug.h"
#include "profile.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define profile(X) LOG_DURATION(X)
#else
#define debug(...) 42
#define profile(...) 42
#endif

using ll = int64_t;
using ld = long double;
const ld EPS = 1e-9;
//const ll MOD = 924844033;
const ld PI = 3.141592653589793;
const int maxn = 600001;
const ll MOD = 1e9 + 7;
using cd = complex<double>;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

struct basis {
    ll pivot[60];
    bool empty = false;

    void add(ll val) {
        for (int i = 0; i < 60; ++i) {
            if (val & (1ll << i)) {
                val ^= (pivot[i]);
            }
        }
        for (int i = 0; i < 60; ++i) {
            if (val & (1ll << i)) {
                pivot[i] = val;
                for (int e = 0; e < 60; ++e) {
                    if (e == i) {
                        continue;
                    }
                    if (pivot[e] & (1ll << i)) {
                        pivot[e] ^= pivot[i];
                    }
                }
                break;
            }
        }
    }

    bool has(ll val) {
        for (int i = 0; i < 60; ++i) {
            if (val & (1ll << i)) {
                val ^= pivot[i];
            }
        }
        return val == 0;
    }
};


signed main() {
#ifdef zxc
    struct rlimit rl;
    const rlim_t kStackSize = 512L * 1024L * 1024L;
    assert(!getrlimit(RLIMIT_STACK, &rl));
    rl.rlim_cur = kStackSize;
    assert(!setrlimit(RLIMIT_STACK, &rl));
    freopen("../input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    //    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    //            freopen("", "r", stdin);
    //        freopen("hack.out", "w", stdout);
#endif

    auto solve = [&](int _) {
        int n;
        cin >> n;
        int t;
        cin >> t;

        vector<int> x(n);
        for (int &el:x) {
            cin >> el;
        }

        int last = 0;
        int ans = 0;
        for (int el:x) {
            if (last + t < el) {
                ans += t;
            } else {
                ans += el - last;
            }
            last = el;
        }
        cout << ans + t;
    };

    fast_io();
    cout.precision(9);
    cout << fixed;
    auto start = chrono::steady_clock::now();

    for (int i = 1; i <= 1; ++i) solve(i);
    auto end = chrono::steady_clock::now();

    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}


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

int R,G,B,N;
string S;
vector<ll> vec(100000);

int main(){
  int count=0;
	cin>>R>>G>>B>>N;
	for(int i=0;i<=N/R;i++){
      for(int j=0;j<=N/G;j++){
        if((N-(i*R+j*G))>=0&&(N-(i*R+j*G))%B==0){
          //cout<<i<<" "<<j<<endl;
          count++;
        }
      }
    }
  cout<<count<<endl;
}

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

typedef long long ll;

/* メモリ食い過ぎ注意 */
#define int ll
#define ALL(v) v.begin(), v.end()
#define _REP(i, n) for (int i = 0; i < n; i++)
#define REP(n) _REP(i, n)

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    ll n, T;
    ll t[200000];
    cin >> n >> T;
    for (int i = 0; i < n; i++)
        cin >> t[i];

    ll sub[200000];
    for (int i = 1; i < n; i++)
    {
        sub[i] = t[i] - t[i - 1];
    }
    int sum = 0;
    for (int i = 1; i < n; i++)
        sum += min(sub[i], T);

    cout << sum + T << endl;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    int ans = 0;
    rep(i, 0, n) {
        int a;
        cin >> a;
        while (a % 2 == 0) {
            a /= 2;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


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

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;
typedef vector<int> vi;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

constexpr auto MAX = 100010;

// ────────────────────────────────────────────────────

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

	vi d(n);
	In(d);
	
	sort(ASC(d));

	cout << d[n / 2] - d[n / 2 - 1] << endl;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		new Main().run();
	}

	private void run() {
		Scanner scanner = new Scanner(System.in);
		loop: while (true) {
			w = scanner.nextInt();
			h = scanner.nextInt();
			if ((w | h) == 0)
				break;
			count = 0;
			visited = new boolean[h][w];
			sx = -1;
			sy = -1;
			boolean isworstpatt = (w == 7 && h == 7);
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					int now = scanner.nextInt();
					if (now == 0) {
						count++;
						if (sx == -1) {
							sy = i;
							sx = j;
						}
					} else {
						isworstpatt = false;
						visited[i][j] = true;
					}
				}
			}
			if (isworstpatt) {
				System.out.println("No");
				continue;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					if (visited[i][j])
						continue;
					int count = 0;
					for (int k = 0; k < 4; k++) {
						int x = j + vx[k];
						int y = i + vy[k];
						if (!isOK(x, y))
							continue;
						if (!visited[y][x])
							count++;
					}
					if (count < 2) {
						System.out.println("No");
						continue loop;
					}
				}
			}

			System.out.println(dfs(sx, sy, 0) ? "Yes" : "No");
		}

	}

	private boolean dfs(int x, int y, int deep) {
		if (count - deep < Math.abs(x - sx) + Math.abs(y - sy))
			return false;

		for (int i = 0; i < 4; i++) {
			int nx = x + vx[i];
			int ny = y + vy[i];
			if (!isOK(nx, ny))
				continue;
			if (ny == sy && nx == sx && deep + 1 == count)
				return true;
			if (visited[ny][nx])
				continue;
			boolean res = check(nx, ny);
			if (!res)
				continue;
			visited[ny][nx] = true;
			if (dfs(nx, ny, deep + 1))
				return true;
			visited[ny][nx] = false;
		}
		return false;

	}

	private boolean check(int x, int y) {
		loop: for (int i = 4; i < vx.length; i++) {
			int nx = x + vx[i];
			int ny = y + vy[i];
			if (!isOK(nx, ny))
				continue;
			if (nx == sx && ny == sy)
				continue;
			if (visited[ny][nx])
				continue;
			int count = 0;
			for (int j = 0; j < 4; j++) {
				int nnx = nx + vx[j];
				int nny = ny + vy[j];
				if (!isOK(nnx, nny))
					continue;
				if (visited[nny][nnx])
					continue;
				count++;
				if (count == 2)
					continue loop;
			}
			return false;
		}
		return true;
	}

	private boolean isOK(int x, int y) {
		if (0 <= x && x < w && 0 <= y && y < h)
			return true;
		return false;
	}

	boolean[][] visited;
	boolean ans;
	int count, w, h, sx, sy;
	int[] vx = { 0, 1, 0, -1, 1, 1, -1, -1 };
	int[] vy = { -1, 0, 1, 0, -1, 1, 1, -1 };
}

Measured memory_bytes: 50628
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;

const int N = 100;
char a[N][N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", a[i]);
  }
  bool found = false;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (i + j > 0) {
        int cnt = 0;
        if (i > 0) cnt += (a[i - 1][j] == '#');
        if (j > 0) cnt += (a[i][j - 1] == '#');
        if (cnt > 1) found = true;
      }
    }
  }
  puts(found ? "Impossible" : "Possible");
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {
    
    public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      PrintWriter w = new PrintWriter(System.out);
      
      int M = ((int)1e9) + 7;
      int r = sc.nextInt();
      int c = sc.nextInt();
      char arr[][]=new char[r][c];
      for(int i=0;i<r;i++)
      {
          arr[i] = sc.next().toCharArray();
      }
      int dp[][] = new int[r][c];
      dp[0][0]=1;
      for(int i=1;i<r;i++)
      {
          if(arr[i][0] == '#')
          {
              dp[i][0] = 0;
          }
          else
          {
              dp[i][0] = dp[i-1][0];
          }
      }
      for(int j=1;j<c;j++)
      {
          if(arr[0][j] == '#')
          {
              dp[0][j] = 0;
          }
          else
          {
              dp[0][j] = dp[0][j-1];
          }
      }
      for(int i=1;i<r;i++)
      {
          for(int j=1;j<c;j++)
          {
              if(arr[i][j]=='#')
              {
                  dp[i][j]=0;
              }
              else
              {
                  dp[i][j]=(dp[i-1][j]%M+dp[i][j-1]%M)%M;
              }
          }
      }
      w.println(dp[r-1][c-1]);
      w.close();
    }
}

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

class Main {

    public static void main(String[] args) {

	final Scanner stdin = new Scanner(System.in);
	final HashMap<String, String> encoder = new HashMap<String, String>();
	initializeEncode( encoder );
	final HashMap<String, String> decoder = new HashMap<String, String>();
	initializeDecode( decoder );

	
	while ( stdin.hasNext() ) {
	    String input = stdin.nextLine();
	    
	    // encode
	    for ( String str : encoder.keySet() ){
		input = input.replace( str, encoder.get( str ) );
	    }

	    // decode
	    final StringBuilder answer = new StringBuilder();
	    final StringBuilder cache = new StringBuilder(input);
	    boolean flag;
	    do {
		flag = false;
		for ( String key : decoder.keySet() ) {
		    if ( startWith( cache, key ) ) {
			answer.append( decoder.get( key ) );
			cache.delete( 0, key.length() );
			flag = true;
			break;
		    }
		}		
	    } while( flag );
	    System.out.println( answer.toString() );		    
	}
	
    }

    static boolean startWith( StringBuilder sb, String val ) {
	if ( sb.length() < val.length() ) {
	    return false;
	}
	for ( int i = 0; i < val.length(); i++ ) {
	    if ( sb.charAt( i ) != val.charAt( i ) ) {
		return false;
	    } 
	}
	return true;
    }

    static void initializeEncode( HashMap<String, String> map ) {
	map.put("A", "00000");
	map.put("B", "00001");
	map.put("C", "00010");
	map.put("D", "00011");
	map.put("E", "00100");
	map.put("F", "00101");
	map.put("G", "00110");
	map.put("H", "00111");
	map.put("I", "01000");
	map.put("J", "01001");
	map.put("K", "01010");
	map.put("L", "01011");
	map.put("M", "01100");
	map.put("N", "01101");
	map.put("O", "01110");
	map.put("P", "01111");
	map.put("Q", "10000");
	map.put("R", "10001");
	map.put("S", "10010");
	map.put("T", "10011");
	map.put("U", "10100");
	map.put("V", "10101");
	map.put("W", "10110");
	map.put("X", "10111");
	map.put("Y", "11000");
	map.put("Z", "11001");
	map.put(" ", "11010");
	map.put(".", "11011");
	map.put(",", "11100");
	map.put("-", "11101");
	map.put("'", "11110");
	map.put("?", "11111");
    }

    static void initializeDecode( HashMap<String, String> map ) {
	map.put("101", " ");
	map.put("000000", "'");
	map.put("000011", ",");
	map.put("10010001", "-");
	map.put("010001", ".");
	map.put("000001", "?");
	map.put("100101", "A");
	map.put("10011010", "B");
	map.put("0101", "C");
	map.put("0001", "D");
	map.put("110", "E");
	map.put("01001", "F");
	map.put("10011011", "G");
	map.put("010000", "H");
	map.put("0111", "I");
	map.put("10011000", "J");
	map.put("0110", "K");
	map.put("00100", "L");
	map.put("10011001", "M");
	map.put("10011110", "N");
	map.put("00101", "O");
	map.put("111", "P");
	map.put("10011111", "Q");
	map.put("1000", "R");
	map.put("00110", "S");
	map.put("00111", "T");
	map.put("10011100", "U");
	map.put("10011101", "V");
	map.put("000010", "W");
	map.put("10010010", "X");
	map.put("10010011", "Y");
	map.put("10010000", "Z");
    }
    
}

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

using namespace std;

typedef long long int ll;
typedef pair<int,int> P;

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

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

	ll ans=0;
	ll r=0,g=0,b=0;
	rep(i,n){
		if(s[i]=='R')r++;
		else if(s[i]=='G')g++;
		else b++;
	}
	ans = r*g*b;

	rep(i,n){
		repi(k,i+1,n){
			if((k-i)%2!=0)continue;
			int j = i + (k-i)/2;
			if(j-i==k-j&&s[i]!=s[j]&&s[j]!=s[k]&&s[k]!=s[i])ans--;
		}
	}
	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 3560
#include <bits/stdc++.h>
using namespace std;
int main(){
    int cnt,min;
    min=10;
    cnt=0;
 vector <int>a(5);
  for (int i=0;i<5;i++){
  cin >> a.at(i);
  if(a.at(i)%10==0)
  cnt+=a.at(i);
  else
  cnt+=a.at(i)+(10-a.at(i)%10);

  }
  for (int i=0;i<5;i++){
      if(a.at(i)%10<min && a.at(i)%10>0)
      min=a.at(i)%10;
  }


  cnt+=min-10;
cout << cnt << endl;
}

Measured memory_bytes: 256
lines = []
for i in range(2):
  inp = input()
  lines.append(inp)
searchList = []  
for i in range(int(lines[0])):
  split = lines[1].split()
  if int(split[i]) % 2 == 0:
    searchList.append(int(split[i]))
out = "APPROVED"
for s in searchList:
  if s % 3 != 0 and s % 5 != 0:
    out = "DENIED"
    print(out)
    break
if out == "APPROVED":
    print(out)
    



Measured memory_bytes: 3060
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long lint;

int main() {
  int n;
  scanf("%d", &n);
  vector<int> values(n);
  for (int i = 0; i < n; ++i)
    scanf("%d", &values[i]);
  vector<int> acc_xor(n + 1, 0);
  vector<lint> acc_sum(n + 1, 0LL);
  for (int i = 0; i < n; ++i) {
    acc_xor[i + 1] = acc_xor[i] ^ values[i];
    acc_sum[i + 1] = acc_sum[i] + values[i];
  }
  lint result = 0;
  for (int start = 0; start < n; ++start) {
    int l = start, r = n - 1;
    while (l < r) {
      int m = l + (r - l + 1) / 2;
      lint sum = acc_sum[m + 1] - acc_sum[start];
      int xor_v = acc_xor[m + 1] ^ acc_xor[start];
      if (sum == xor_v) l = m;
      else r = m - 1;
    }
    result += l - start + 1;
  }
  printf("%lld\n", result);
  return 0;
}


Measured memory_bytes: 3456
#include <iostream>
using namespace std;
int x[12][12];
bool integer(int a){
	int b=0;
	while(b*b<a){
		b++;
		if(b*b==a) return true;
	}
	return false;
}
int main(){
	int n,d;
	cin>>n>>d;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=d;j++){
			cin>>x[i][j];
		}
	}
	int ans=0,sum=0;
	for(int i=1;i<n;i++){
		for(int j=i+1;j<=n;j++){
			for(int k=1;k<=d;k++){
				sum+=((x[i][k]-x[j][k])*(x[i][k]-x[j][k]));
			}
			//cout<<sum<<endl;
			if(integer(sum)){
				ans++;
			}
			sum=0;
		}
	}
	cout<<ans<<endl;
	return 0;
} 

Measured memory_bytes: 256
/* -------------------------------- */
/* Name: MD. Khairul Basar          */
/* Institute: HSTU                  */
/* Dept: CSE                        */
/* Email: khairul.basar93@gmail.com */
/* -------------------------------- */

#include <bits/stdc++.h>
/* all header files */

#define fs            first
#define sc            second
#define sp            printf(" ")
#define nl            printf("\n")
#define pb(a)         push_back(a)

#define setzero(a)    memset(a,0,sizeof(a))
#define setneg(a)     memset(a,-1,sizeof(a))
#define setinf(a)     memset(a,126,sizeof(a))

#define tc1(x)        printf("Case %d: ",x)
#define tc2(x)        printf("Case #%d: ",x)
#define tc3(x)        printf("Case %d:\n",x)
#define tc4(x)        printf("Case #%d:\n",x)

#define iin(x)        scanf("%d",&x)
#define din(x)        scanf("%lf",&x)
#define lin(x)        scanf("%lld",&x)
#define clin(x)       scanf("%I64d",&x)

#define pr1(x)        cout<<x<<"\n"
#define pr2(x,y)      cout<<x<<" "<<y<<"\n"
#define pr3(x,y,z)    cout<<x<<" "<<y<<" "<<z<<"\n"
#define pr4(w,x,y,z)  cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define fast          ios::sync_with_stdio(0)
#define read          freopen("input.txt","r",stdin)
#define write         freopen("output.txt","w",stdout)
#define prflag1(flag) printf("%s\n",(flag)?"YES":"NO")
#define prflag2(flag) printf("%s\n",(flag)?"Yes":"No")
#define prflag3(flag) printf("%s\n",(flag)?"yes":"no")
/* macro definitions */

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int>pii;
typedef pair<LL, LL>pll;
typedef vector<int>vi;
typedef vector<LL>vll;
typedef vector<pii>vpii;
typedef vector<pll>vpll;
/* type definitions */

LL MOD_EXPO(LL b, LL p, LL m)
{
    if(p==0) return 1;
    LL ret=MOD_EXPO(b,p/2,m)%m;
    ret=(ret*ret)%m;
    return ((p&1) ? (ret*b)%m : ret%m);
}
LL POWER(LL N, LL K)
{
    LL i,ans=1;
    for(i=1; i<=K; i++) ans*=N;
    return ans;
}
int SET(int N, int pos)
{
    return (N | (1<<pos));
}
int RESET(int N, int pos)
{
    return (N & !(1<<pos));
}
bool CHECK(int N, int pos)
{
    return (N & (1<<pos));
}
/* necessary functions */

int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx6[]= {0,0,1,-1,0,0};
int dy6[]= {1,-1,0,0,0,0};
int dz6[]= {0,0,0,0,1,-1};
int dx8[]= {1,-1,0,0,-1,1,-1,1};
int dy8[]= {0,0,1,-1,1,1,-1,-1};
int dkx8[]= {-1,1,-1,1,-2,-2,2,2};
int dky8[]= {2,2,-2,-2,1,-1,1,-1};
/* direction arrays */

int tc=1;
const double eps=1e-9;
const double pi=acos(-1.0);
const long long int mx=1e5;
const long long int mod=1e9+7;
/* global declarations */

LL a[mx+5];

int main()
{
    LL n,i,sum,k;
    while(cin>>n)
    {
        sum=0;
        for(i=1; i<=n; i++)
        {
            lin(a[i]);
        }
        i=1;
        while(i<=n)
        {
            k=0;
            while(i<=n && a[i]) k+=a[i++];
            sum+=k/2;
            i++;
        }
        pr1(sum);
    }
    return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>

int jou(unsigned int k,int i){
	unsigned int b=k;
	for(int m=1;m<i;m++){
		k*=(unsigned int)b;
	}
	return k;
}

int main(void){
	unsigned int n,k;
	int i=1,a=0;
	scanf("%u%u",&n,&k);
	while(a==0){
		if(n<jou(k,i)){
			a=i;
		}
		i++;
	}
	printf("%u", a);
}


Measured memory_bytes: 128
n,m,c = map(int,input().split())
b = [int(_) for _ in input().split()]
ans = 0
for _ in range(n):
    a = [int(_) for _ in input().split()]
    sum = 0
    for j in range(m):
        sum += a[j] * b[j]
    if sum + c > 0:
        ans += 1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>

int main() {
	long long int t1, t2, a1, a2, b1, b2; std::cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
	if (a1 * t1 + a2 * t2 == b1 * t1 + b2 * t2) {
		std::cout << "infinity\n";
	}
	else if (a1 > b1 && a2 > b2) {
		std::cout << "0\n";
	}
	else if (a1 < b1 && a2 < b2) {
		std::cout << "0\n";
	}
	else {
		auto succ1 = (a1 - b1) * t1;
		auto succ2 = (a2 - b2) * t2;
		auto diff = succ1 + succ2;
		if ((diff >= 0 && succ1 >= 0) || (diff <= 0 && succ1 <= 0)) {
			std::cout << "0\n";
		}
		else {
			diff = std::abs(diff);
			auto def = std::abs(succ1) / diff * 2 + 1;
			if (std::abs(succ1) % diff == 0) {
				--def;
			}
			std::cout << def << '\n';
		}
	}
}

Measured memory_bytes: 888
#include <iostream>
#include <cmath>
#include <numeric>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <algorithm>
using namespace std;

using ll = long long;

#define MOD 1000000007

#define FOR(i, m, n) for (ll i = m; i <= n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)

ll gcd(ll a, ll b) { if (a < b) { a ^= b; b ^= a; a ^= b; } return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

int main() {
    string S;
    cin >> S;
    
    ll ans = S[0] + S[1] + S[2] - 'A' * 3;

    cout << (ans == 1 || ans == 2 ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 256
ss = gets.chomp.split('')
pos = {}
ss.length.times do |i|
    c = ss[i]
    if pos[c] &&  i - pos[c] <= 2 
        print pos[c]+1, ' ', i+1, "\n"
        exit
    end
    pos[c] = i
end

puts '-1 -1'

Measured memory_bytes: 6908
#include <stdio.h>
 
int main(void) {
    int i,max;
    double x1,y1,x2,y2,x3,y3;
    double _x1,_x2,_y1,_y2;
    double houteisiki[6];
    double cx,cy;
    double x,y;
    double r;
    double keisuu;
    int ht;
    scanf("%d",&max);
    for(i=0;i<max;i++) {
        scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
        ht=0;
        _x1=x1;_x2=x2;_y1=y1;_y2=y2;
        cx=(_x1+_x2)/2;
        cy=(_y1+_y2)/2;
        if(_x1-_x2!=0 && _y1-_y2!=0) {
            keisuu=-1.0/((_y1-_y2)/(_x1-_x2));
            houteisiki[ht]=keisuu;
            houteisiki[ht+1]=-1;
            houteisiki[ht+2]=cx*keisuu-cy;
            ht+=3;
        } else {
            if(_x1-_x2==0 && _y1-_y2!=0) {
                houteisiki[ht]=0;
                houteisiki[ht+1]=1;
                houteisiki[ht+2]=cy;
                ht+=3;
            } else if(_x1-_x2!=0 && _y1-_y2==0) {
                houteisiki[ht]=1;
                houteisiki[ht+1]=0;
                houteisiki[ht+2]=cx;
                ht+=3;
            }
        }
        _x1=x2;_x2=x3;_y1=y2;_y2=y3;
        cx=(_x1+_x2)/2;
        cy=(_y1+_y2)/2;
        if(_x1-_x2!=0 && _y1-_y2!=0) {
            keisuu=-1.0/((_y1-_y2)/(_x1-_x2));
            houteisiki[ht]=keisuu;
            houteisiki[ht+1]=-1;
            houteisiki[ht+2]=cx*keisuu-cy;
            ht+=3;
        } else {
            if(_x1-_x2==0 && _y1-_y2!=0) {
                houteisiki[ht]=0;
                houteisiki[ht+1]=1;
                houteisiki[ht+2]=cy;
                ht+=3;
            } else if(_x1-_x2!=0 && _y1-_y2==0) {
                houteisiki[ht]=1;
                houteisiki[ht+1]=0;
                houteisiki[ht+2]=cx;
                ht+=3;
            }
        }
        if(ht<6) {
            _x1=x3;_x2=x1;_y1=y3;_y2=y1;
            cx=(_x1+_x2)/2;
            cy=(_y1+_y2)/2;
            if(_x1-_x2!=0 && _y1-_y2!=0) {
                keisuu=-1.0/((_y1-_y2)/(_x1-_x2));
                houteisiki[ht]=keisuu;
                houteisiki[ht+1]=-1;
                houteisiki[ht+2]=cx*keisuu-cy;
                ht+=3;
            } else {
                if(_x1-_x2==0 && _y1-_y2!=0) {
                    houteisiki[ht]=0;
                    houteisiki[ht+1]=1;
                    houteisiki[ht+2]=cy;
                    ht+=3;
                } else if(_x1-_x2!=0 && _y1-_y2==0) {
                    houteisiki[ht]=1;
                    houteisiki[ht+1]=0;
                    houteisiki[ht+2]=cx;
                    ht+=3;
                }
            }
        }
        x=(houteisiki[2]*houteisiki[4]-houteisiki[5]*houteisiki[1])/
            (houteisiki[0]*houteisiki[4]-houteisiki[3]*houteisiki[1]);
        y=(houteisiki[2]*houteisiki[3]-houteisiki[5]*houteisiki[0])/
            (houteisiki[1]*houteisiki[3]-houteisiki[4]*houteisiki[0]);
        if(x>-0.001 && x<0.001)x=0;
        if(y>-0.001 && y<0.001)y=0;
        r=sqrt((x-x1)*(x-x1)+(y-y1)*(y-y1));
        if(r>-0.001 && r<0.001)r=0;
        printf("%1.3f %1.3f %1.3f\n",x,y,r);
    }
    return 0;
}

Measured memory_bytes: 664
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
INF = float('inf')
dp = [-INF]*(N + 5)
needs = [2, 5, 5, 4, 5, 6, 3, 7, 6]
can_use = {k: needs[k-1] for k in A}
dp[0] = 0
for i in range(2, N+1):
    for v in can_use.values():
        if i - v < 0:
            continue
        dp[i] = max(dp[i], dp[i-v]+1)
ans = ''
i = N
while i != 0:
    for k, v in can_use.items():
        if i - v < 0:
            continue
        while dp[i] == dp[i-v] + 1:
            ans += str(k)
            i -= v
print(ans)


Measured memory_bytes: 9292
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[]str = Console.ReadLine().Split();
		int N = int.Parse(str[0]);
		int M = int.Parse(str[1]);
		int K = int.Parse(str[2]);
		long[]D = new long[K+2];
		D[0] = M;
		long mod = 998244353;
		long[]DA = new long[200010];
		long[]DB = new long[200010];
		DA[0] = 1;
		DB[0] = 1;
		for(var i=1;i<200010;i++){
			DA[i] = DA[i-1]*i%mod;
			DB[i] = DB[i-1]*Mpow(i,mod-2,mod)%mod;
		}
		long ans = 0;
		for(var i=0;i<=K;i++){
          	//Console.Error.WriteLine(Mpow(M-1,N-1-i,mod)+" "+DA[N]+" "+DB[N-i]+" "+DB[i]);
			ans += M * Mpow(M-1,N-1-i,mod) % mod * DA[N-1] % mod * DB[N-1-i] % mod * DB[i] % mod;
			ans %= mod;
		}
		Console.WriteLine(ans%mod);
	}
	
	public static long Mpow(long x,long n,long m)
	{
		long ans = 1;
		while(n > 0){
			if(n % 2 == 1){
				ans = ans * x % m;
				n -= 1;
			}
			x = x * x % m;
			n /= 2;
		}
		return ans;
	}
}

Measured memory_bytes: 21148
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define P pair<int , int>
#define V vector<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>
int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
	int W, H, N;  cin >> W >> H >> N;
	int top = H, bottom = 0, right = W, left = 0;
	for(int i = 0 ; i < N ; i++){
	 	int x, y, a;  cin >> x >> y >> a;
		switch(a){
		 case 1:  left = max(x, left);  break;
		 case 2:  right = min(x, right);  break;
		 case 3:  bottom = max(y, bottom);  break;
		 case 4:  top = min(y, top);  break;
        }
	}

	int ans = 0;
	if(left < right && bottom < top)
	 ans = (right - left) * (top - bottom);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <math.h>
#include <deque>
using ll = long long;
using namespace std;


int main(){
    int x, a, b;
    cin >> x >> a >> b;
    if(a-b>=0) cout << "delicious" << endl;
    else if(a-b >= -x) cout << "safe" << endl;
    else cout << "dangerous" << endl;
    return 0;
}


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

int main() {
	string T;
	cin >> T;

	int len = T.length();

	for (int i = len; i >= 0; i--) {
		if (T[i] == '?') {
			if (i == len) {
				T[i] = 'D';
			} else {
				if (T[i + 1] == 'D') {
					if (i > 0) {
						if (T[i - 1] == 'P') {
							T[i] = 'D';
							continue;
						}
					}
					T[i] = 'P';
				} else {
					T[i] = 'D';
				}
			}
		}
	}

	cout << T << endl;

	return 0;
}

Measured memory_bytes: 3484
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#define mod 1000000007
#define maxt 200005
using namespace std;
typedef long long ll;
inline int getint(){
  int res = 0; char c;
  for(c = getchar();c < '0' || c > '9';c = getchar());
  for(;c >= '0' && c <= '9';c = getchar()) res = res * 10 + (c - '0');
  return res;
}
int B,W,tot;
int modpow(int x,int y){
  int res = 1;
  while(y){
    if(y & 1) res = (ll)res * x % mod;
    y >>= 1;
    x = (ll)x * x % mod;
  }
  return res;
}
int pow2[maxt],fct[maxt],inv_fct[maxt];
int c(int x,int y){
  return (ll)fct[x] * inv_fct[y] % mod * inv_fct[x - y] % mod;
}
int ansb[maxt],answ[maxt];
int main(){
  B = getint(), W = getint();
  tot = B + W;
  pow2[0] = 1;
  for(int i = 1;i <= tot;i++) pow2[i] = (ll)pow2[i - 1] * 2 % mod;
  fct[0] = 1;
  for(int i = 1;i <= tot;i++) fct[i] = (ll)fct[i - 1] * i % mod;
  inv_fct[tot] = modpow(fct[tot],mod - 2);
  for(int i = tot - 1;i >= 0;i--){
    inv_fct[i] = (ll)inv_fct[i + 1] * (i + 1) % mod;
  }
  answ[1] = 0;
  for(int i = 2;i <= W + 1;i++){
    if(i == 2){
      answ[i] = (ll)c(tot - i,B - 1) * pow2[1] % mod;
    }else{
      answ[i] = (answ[i - 1] - (ll)c(tot - i + 1,B - 1) * pow2[i - 2] + mod) % mod;
      answ[i] = (answ[i] + (ll)c(tot - i,B - 2) * pow2[i - 2]) % mod;
      answ[i] = (answ[i] + (ll)c(tot - i,B - 1) * pow2[i - 1]) % mod;
    }
  }
  for(int i = W + 2;i <= tot;i++) answ[i] = answ[i - 1];
  for(int i = 1;i <= B;i++){
    ansb[1] = (ansb[1] + (ll)c(tot - i - 1,W - 1) * pow2[i]) % mod;
  }
  for(int i = 2;i <= B + 1;i++){
    if(i == 2){
      ansb[i] = (ansb[1] - (ll)c(tot - i,W - 1) * pow2[i - 1] % mod + mod) % mod;
    }else{
      ansb[i] = (ansb[i - 1] + (ll)c(tot - i,W - 1) * pow2[i - 2]) % mod;
      ansb[i] = (ansb[i] - (ll)c(tot - i,W - 1) * pow2[i - 1] % mod + mod) % mod;
    }
  }
  for(int i = B + 2;i <= tot;i++) ansb[i] = ansb[i - 1];
  for(int i = tot;i >= 1;i--){
    printf("%lld\n",ll(ansb[i] + answ[i]) * modpow(pow2[tot],mod - 2) % mod);
  }
  return 0;
}

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

using namespace std;
int main()
{
    int a,b,x,d1,d2;
    cin >> x >> a >> b;
    d1=abs(x-a);
    d2=abs(x-b);
    if(d1>d2)
    {
        cout << "B";
    }
    else
    {
        cout << "A";
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
	int N;
	cin >> N;
	int T[N],A[N];
	long long Takahashi,Aoki;
	long long n;
	for(int i=0;i<N;i++)cin >> T[i] >> A[i];
	Takahashi = T[0];
	Aoki = A[0];
	for(int i=1;i<N;i++){
		n = std::max((Takahashi+T[i]-1)/T[i],(Aoki+A[i]-1)/A[i]);
		Takahashi = n*T[i];
		Aoki = n*A[i];
	}
	cout << Takahashi+Aoki;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define FINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

int A,B,C;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> A >> B >> C;
  cout << (A <= C && C <= B ? "Yes" : "No") << endl;

  return 0;
}

Measured memory_bytes: 256