akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const int lmod = 1e9 + 7.5;
const int SZ = 2e6 + 5;
ll mp25[SZ];
ll mp26[SZ];
ll fac[SZ];
ll ifac[SZ];
template <typename T> T ExtendedEuclidean(T a, T b, T &x, T &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  T x1, y1;
  T d = ExtendedEuclidean(b, a % b, x1, y1);
  x = y1;
  y = x1 - y1 * (a / b);
  return d;
}
template <typename T> T invmod(T a, T b) {
  T x = 0, y = 0;
  ExtendedEuclidean(a, b, x, y);
  if (x < 0)
    x = (x % b) + b;
  return x;
}
ll ncr(ll n, ll r) {
  if (r > n)
    return 0;
  ll f = fac[n];
  f = (f * ifac[r]) % lmod;
  f = (f * ifac[n - r]) % lmod;
  return f;
}
inline ll mult(initializer_list<ll> il) {
  ll ret = 1;
  for (auto &x : il) {
    ret = (ret * (x % lmod)) % lmod;
  }
  return ret;
}
inline ll add(initializer_list<ll> il) {
  ll ret = 0;
  for (auto &x : il) {
    ret = (ret + (x % lmod)) % lmod;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  mp25[0] = mp26[0] = fac[0] = ifac[0] = 1;
  for (int i = 1; i < SZ; i++) {
    mp25[i] = (25LL * mp25[i - 1]) % lmod;
    mp26[i] = (26LL * mp26[i - 1]) % lmod;
    fac[i] = (i * fac[i - 1]) % lmod;
    ifac[i] = invmod<ll>(fac[i], lmod);
  }
  string s;
  int k, n;
  cin >> k >> s;
  n = s.length();
  ll ans = 0;
  for (ll last = 0; last <= k; last++) {
    ll rem = k - last;
    ll term = mult({ncr(n + rem - 1, rem), mp25[rem], mp26[last]});
    ans = add({ans, term});
  }
  cout << ans << "\n";
}

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

using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define ll long long
#define li long int
#define ld long double
#define lld long long double

#define pb push_back
#define mk make_pair
#define F first
#define S second

#define all(v) (v).begin(),(v).end()
#define fill(a) memset(a, 0, sizeof(a))

const int MX = 1e6;
const int MI = -1e6;
const int MOD = 1e9 + 7;
const string ALPHA = "abcdefghijklmnopqrstuvwxyz";
const double PI = 3.1415926535;

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

const int mod=1e9+7;
inline int add(int x,int y)
{
  x+=y;
  if (x>=mod)
    return x-mod;
  return x;
}
inline int sub(int x,int y)
{
  x-=y;
  if (x<0)
    return x+mod;
  return x;
}
inline int mul(int x,int y)
{
  return (x*1ll*y)%mod;
}
inline int power(int x,int y)
{
  int ans=1;
  while(y)
    {
      if (y&1) ans=mul(ans,x);
      x=mul(x,x);
      y>>=1;
    }
  return ans;
}
inline int inv(int x)
{
  return power(x,mod-2);
}
inline int gcd(int x, int y)
{
  return(y!=0)?gcd(y, x%y):x;
}
inline ll nPr(int n, int r)
{
  ll i,result=1;
  rep(i,r)
    {
      result*=(ll)(n-i);
    }
  return result;
}
inline ll nCr(int n,int r)
{
  ll i,result=1;
  rep(i,min(r,n-r))
    {
      result*=(ll)(n-i);
      result/=(ll)(i+1);
    }
  return result;
}
bool prime(int n)
{
  for (int i=2; i<n/2; i++)
    {
      if(n%i==0)
	return false;
    }
  return true;
}

/*------------CODE-----------*/

int main()
{
  IOS;
  ll a, b, n;
  cin >> a >> b >> n;
  ll q=min(n, b-1);
  cout << (a*q)/b-a*(q/b) << endl;
  return 0;
}


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

char S[ 5100 ];
char T[ 10 ];
set<string> A;
set<string> X;

int main()
{
int i;
int j;
int K;

	ios::sync_with_stdio( false );
	cin.tie( 0 );

	cin >> S;
	cin >> K;

	i = strlen( S ) - 1;
	if( i < 0 ) return 0;

	for(; i >= 0; i-- )
	{
		A.insert( S + i );
		S[ i + K ] = '\0';
	}

	for( auto S: A )
	{
		j = 0;
		while( S[ j ] != '\0' )
		{
			j++;
			strcpy( T, S.c_str() );
			T[ j ] = '\0';
			X.insert( T );
			if( X.size() == K )
			{
				cout << T << endl;

				return 0;
			}
		}
	}

	return 0;
}






Measured memory_bytes: 768
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define M (998244353)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll>Q;
 
ll a[55];
ll b[55];
ll c[55];
ll d[55];
 
ll ans = 0;
ll n,m,q;
 
void dfs(ll len,ll now,vector<ll> &S){
  if(len==n){
    ll tmp = 0;
    for(ll j=0;j<q;j++){
      if(S[b[j]]-S[a[j]]==c[j])tmp+=d[j];
    }
    //cout<<endl;
    ans = max(ans,tmp);
    return;
  }
  for(ll j=now;j<=m;j++){
    vector<ll> T;
    T =S;
    T.push_back(j);
    dfs(len+1,j,T);
  }
}
 
int main(void){
  cin>>n>>m>>q;
  for(ll i=0;i<q;i++){
    cin>>a[i]>>b[i]>>c[i]>>d[i];
    a[i]--;
    b[i]--;
  }
  vector<ll> seq;
  dfs(0,1,seq);
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h> // {{{
// clang-format off
#define ARG4(_1, _2, _3, _4, ...) _4
#define rep(...) ARG4(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define REP(i, a) FOR(i, 0, a)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(...) ARG4(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define RREP(i, a) RFOR(i, 0, a)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (int)(a); --i)
#define ALL(c) (c).begin(), (c).end()
#define pb emplace_back
#define em emplace
#define fi first
#define se second
#define USE1(...) template <typename __VA_ARGS__> inline
#define USE2(T, ...) USE1(T, typename __VA_ARGS__)
#define mygc(c) (c) = getchar_unlocked()
#define mypc(c) putchar_unlocked(c)

using ll = long long;
template<typename T> using vec = std::vector<T>;
USE2(T,U)bool chmax(T&x,U a){return x<a&&(x=a,1);}
USE2(T,U)bool chmin(T&x,U a){return a<x&&(x=a,1);}
USE1(T=int)T in(){T x;std::cin>>x;return x;}
USE2(T=int,V=vec<T>)V reserved(int n){V v;v.reserve(n);return v;}
USE1(T=int)vec<T>in(int n){auto v=reserved<T>(n);rep(i,n)v.pb(in<T>());return v;}
USE2(T,U=std::pair<T,int>)vec<U>enume(const vec<T>&x,int s=0){int N=x.size();auto v=reserved<U>(N);rep(i,N)v.pb(x[i],s+i);return v;}
USE1(T)vec<T>ndvec(T v,int n){return vec<T>(n,v);}
USE2(T,...Ts)auto ndvec(T v,int n,Ts...ns)->vec<decltype(ndvec(v,ns...))>{return ndvec(ndvec(v,ns...),n);}
USE1(T)void pr(T x){std::cout<<x<<'\n';}
USE2(T,...Ts)void pr(T x,Ts...xs){std::cout<<x<<' ';pr(xs...);}
USE2(T,U)void prif(bool b,T t,U f){if(b)pr(t);else pr(f);}
USE1(T=int)T rd(){T x=0,m=0,k;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||'9'<k)break;x=x*10+k-'0';}return x;}
USE1(T=int)void wr(T x,char c='\n'){int s=0,m=0;char b[32];if(x<0)m=1,x=-x;for(;x;x/=10)b[s++]=x%10;if(!s)b[s++]=0;if(m)mypc('-');for(;s--;)mypc(b[s]+'0');mypc(c);}
// clang-format on
// }}}
struct IoSetup { // {{{
  IoSetup() {
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.precision(20);
    std::cout.setf(std::ios::fixed);
  }
} iosetup; //}}}
using namespace std;
const int inf = 1001001001;
const ll infl = 1001001001001001001ll;
const int dd[] = {0, 1, 0, -1, 0};

signed main() {
  int N = in(), K = in();
  auto A = in(N);

  int p = min_element(ALL(A)) - begin(A);

  int k = K - 1;
  int mini = inf;

  rep(i, K) {
    int l = i;
    int r = k - i;

    int x = p;
    int y = N - p - 1;

    int a = max(0, x - l);
    int b = max(0, y - r);

    chmin(mini, (a + k - 1) / k + (b + k - 1) / k + 1);
  }
  pr(mini);
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    rep(i, n) cin >> s[i];

    vec p(n), m(n, INF);

    rep(i, n) {
        rep(j, s[i].size()) {
            char c = s[i][j];

            if (c == '(') p[i]++;
            else p[i]--;

            m[i] = min(m[i], p[i]);
        }
    }

    if (accumulate(all(p), 0) != 0) {
        cout << "No" << endl;
        exit(0);
    }

    vec ord1(n);
    rep(i, n) ord1[i] = i;

    sort(all(ord1), [&](const int& i, const int& j) { return m[i] > m[j]; });

    vector<bool> used(n, false);

    int cur = 0;

    rep(i, n) {
        if (p[ord1[i]] >= 0) {
            if (cur + m[ord1[i]] < 0) {
                cout << "No" << endl;
                exit(0);
            }

            cur += p[ord1[i]];
            used[ord1[i]] = true;
        }
    }

    rep(i, n) ord1[i] = i;

    sort(all(ord1), [&](const int& i, const int& j) { return (p[i] - m[i]) > (p[j] - m[j]); });

    rep(i, n) {
        if (!used[ord1[i]]) {
            if (cur + m[ord1[i]] < 0) {
                cout << "No" << endl;
                exit(0);
            }

            cur += p[ord1[i]];
        }
    }

    cout << "Yes" << endl;
    return 0;
}

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


def solve(N: int, A: int, B: int):
    print(min(N*A,B))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(N, A, B)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
N, M, Q, *ABCD = map(int, open(0).read().split())

def solve(A):
    if len(A) == N:
        return sum(d for a, b, c, d in zip(*[iter(ABCD)] * 4) if A[b - 1] - A[a - 1] == c)

    return max(solve(A + [i]) for i in range(A[-1], M + 1))

print(solve([1]))

Measured memory_bytes: 9124
num = int(input())

cards = list()

for i in range(num):
    cards.append(input())

pics = ['S', 'H', 'C', 'D']
nums = [str(i) for i in range(1, 14)]

for p in pics:
    for n in nums:
        c = p+' '+n
        if not c in cards:
            print(c)

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

using namespace std;
#define sync   freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);freopen("error.txt","w",stderr);
#define ll long long
const int mod = int(1e9+7);
const int MN = int(2e6+7);
#define rep(i,a,b) for(int i=a;i<=n;i++)
		   
int main(){
	// sync;
	int n; 
	cin>>n; 
	vector<int>aa(n+1,0),bb(n+1,0),cc(n+1,0);
	rep(i,1,n)cin>>aa[i]>>bb[i]>>cc[i];
	vector<int>da(n+1,0),db(n+1,0),dc(n+1,0);
	da[1]=aa[1];db[1]=bb[1];dc[1]=cc[1];
	for(int i=2;i<=n;i++){
			da[i]=aa[i]+max(db[i-1],dc[i-1]);
			dc[i]=cc[i]+max(db[i-1],da[i-1]);
			db[i]=bb[i]+max(da[i-1],dc[i-1]);
	}	
	int ans=max(da[n],max(db[n],dc[n]));
	cout<<ans<<endl;
}

Measured memory_bytes: 5568
#include <bits/stdc++.h>
#define x real()
#define y imag()
#define EPS (1e-8)
using namespace std;
typedef complex <double> point;

namespace std {
  bool operator < (const point& a, const point& b){
    return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b); //x->y
  }
}
double dot(point a,point b){return a.x*b.x+a.y*b.y;}
double cross(point a,point b){return a.x*b.y-a.y*b.x;}

int ccw(point a,point b,point c){
  point d = b-a;
  point e = c-a;
  if(cross(d,e)>0) return 1;//"COUNTER_CLOCKWISE"
  if(cross(d,e)<0) return -1;//"CLOCKWISE"
  if(dot(d,e)<0) return 2;//"ONLINE_BACK"
  if(abs(d) < abs(e)) return -2;//"ONLINE_FRONT"
  return 0;//"ON_SEGMENT"
}

//????¨?????????????????????????
vector <point> Convex_Hull(vector <point> a){
  vector<point> b,c;
  if(a.size()<3) return a;
  sort(a.begin(),a.end());  
  
  b.push_back(a[0]);
  b.push_back(a[1]);
  for(int i=2;i<a.size();i++){
    //CLOCKWISE or ONLINE_FRONT
    for(int j=b.size();j>=2&&ccw(b[j-2],b[j-1],a[i])>=0;j--)b.pop_back();
    b.push_back(a[i]);
  }

  c.push_back(a.back());
  c.push_back(a[a.size()-2]);
  for(int i=a.size()-3;i>=0;i--){
    //CLOCKWISE or ONLINE_FRONT
    for(int j=c.size();j>=2&&ccw(c[j-2],c[j-1],a[i])>=0;j--) c.pop_back();
    c.push_back(a[i]);
  }
  reverse(c.begin(),c.end());
  for(int i=b.size()-2;i>=1;i--) c.push_back(b[i]);
  return c;
}

int main(){
  int n;
  cin>>n;
  vector<point> v;
  v.resize(n);
  for(int i=0,a,b;i<n;i++)cin>>a>>b,v[i]=point(a,b);
  v=Convex_Hull(v);
  
  for(int i=0;i<v.size();i++) swap(v[i].x,v[i].y);
  int idx=0;
  for(int i=1;i<v.size();i++) if(v[i]<v[idx]) idx=i;

  cout <<v.size()<<endl;
  for(int i=idx;i<v.size()+idx;i++) cout << v[i%v.size()].y<<" "<<v[i%v.size()].x<<endl;
  return 0;
}

Measured memory_bytes: 6756
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define si(n) scanf("%d",&n);
#define PI acos(-1.0)
#define sl(n) scanf("%lld",&n);
#define sf(n) scanf("%lf",&n);
#define ss(n) scanf("%s",n);
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define forc(i,j,n) for(ll i=j;i<n;i++)
#define pb push_back
#define sor(n) sort(n.begin(),n.end())
#define sorcmp(n) sort(n.begin(),n.end(),cmp)
#define rev(n) reverse(n.begin(),n.end())
#define pi(x)  prllf("%d",x);
#define pl(x)  prllf("%lld",x);
#define pf(x)  prllf("%.10lf",x);
#define ps(x)  prllf("%s",x);
#define en() prllf("\n");
#define random_shuffle(r...)random_shuffle(r,[](int _){return rand()%_;})
#define SQR(a) (a)*(a)
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
template <typename T> T POW(T B,T P){ if(P==0) return 1; if(P&1) return B*POW(B,P-1);  else return SQR(POW(B,P/2));}


int main ()
{
    ll n;
    cin>>n;
    ll temp=log2(n)+1;
    //cout<<temp<<endl;
    ll res=POW((ll)2,temp)-1;
    cout<<res<<endl;
}

















Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

int cmpfunc(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}

int main(void){
    char a[11],b[11],c[11];
    scanf("%s %s %s",a,b,c);
    int alen=strlen(a);
    int blen=strlen(b);
    int clen=strlen(c);
    if(a[alen-1]==b[0] && b[blen-1]==c[0]) printf("YES\n");
    else printf("NO\n");
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>

using namespace std;
typedef long long int ll;
void sayYes() { cout << "Yes" << endl; };
void sayNo() { cout << "No" << endl; };
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }                   // 最大公約数
ll lcm(ll a, ll b) { return a * b / gcd(a, b); };                      // 最小公倍数
ll getDigit(ll num) { return log10(num) + 1; }                         // 桁数
ll digitSum(ll n) { return (n < 10) ? n : digitSum(n / 10) + n % 10; } // 各桁の和
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repn(i, n) for (ll i = 1; i <= n; i++)

void Main()
{
    int n, l;
    cin >> n >> l;
    vector<string> str(n);
    rep(i, n) cin >> str[i];

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

    rep(i, n) cout << str[i];
    cout << endl;

    return;
}

signed main(void)
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


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

#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    string S; cin >> S;
    int N = S.size();

    string A, B;
    A += '1';
    B+= '0';
    FOR(i, 1, N) {
        if(A[i-1] == '0') {
        A += '1';
        B+= '0';
        }
        if(A[i-1] == '1') {
        A += '0';
        B+= '1';
        }
    }

    int a=0, b=0;
    FOR(i,0, N) {
        if(A[i] != S[i]) {
            a ++;
        }
        if(B[i] != S[i] ) {
            b ++;
        }
    }

    if(a > b) printf("%d\n",b);
    if(a <= b) printf("%d\n",a);

}

Measured memory_bytes: 768
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef long long ll;

const int MAX_SIZE = 10000;

struct edge{
	int to;
	int cost;
    int speedLimit;
};

class Situation{
public:
	double cost;
	int idx;
    int prvIdx;
    int speed;

	Situation(double cost_,int idx_,int prvIdx_,int speed_){
        cost=cost_;
		idx=idx_;
        speed=speed_;
        prvIdx=prvIdx_;
	}
	Situation();
	bool operator<(const Situation &s)const{
		return s.cost < this->cost;
	}
};

//typedef pair<int,int> P;
int V;

const int MAX_V = 100;
const int MAX_SPEED=50;

vector<edge> G[MAX_V];
double d[MAX_V][MAX_V][MAX_SPEED];
const int INF = 1000000000;

void dijkstra(int s){
	priority_queue<Situation> que;
    for(int i = 0; i < MAX_V; i++)
        for(int k = 0; k < MAX_V; k++)
            for(int j = 0; j < MAX_SPEED; j++)
                d[i][k][j]=INF;
    d[0][s][1] = 0;
	que.push(Situation(0,s,0,1));
	while(!que.empty()){
		Situation p = que.top();
		que.pop();
        int idx=p.idx;
        int pidx=p.prvIdx;
        double ccost=p.cost;
        int cspeed=p.speed;
		if(d[pidx][idx][cspeed] < p.cost)
			continue;
		for(int i = 0; i < G[idx].size(); i++){
			edge e = G[idx][i];
            if(pidx==e.to)
                continue;
            for(int j = -1; j <= 1; j++){
                if(pidx==0)
                    if(cspeed+j!=1)
                        continue;
                if(cspeed+j>=1&&e.speedLimit>=cspeed+j
                    &&(d[idx][e.to][cspeed+j]>d[pidx][idx][cspeed]+(double)e.cost/(cspeed+j)
                    &&!EQ(d[idx][e.to][cspeed+j],d[pidx][idx][cspeed]+(double)e.cost/(cspeed+j)))){
                        d[idx][e.to][cspeed+j] = d[pidx][idx][cspeed] + (double)e.cost/(cspeed+j);
                        que.push(Situation(d[idx][e.to][cspeed+j],e.to,idx,cspeed+j));
                }
            }
		}
	}
}

int main(){

    int n,m,s,g;
    while(cin>>n>>m&&!(n==0&&m==0)){
        for(int i = 0; i < MAX_V; i++)
            G[i].clear();
        cin>>s>>g;
        for(int i = 0; i < m; i++){
            int from,to,dist,lim;
            cin>>from>>to>>dist>>lim;
            edge e;
            e.cost=dist;
            e.to=to;
            e.speedLimit=lim;
            G[from].push_back(e);
            e.to=from;
            G[to].push_back(e);
        }
        dijkstra(s);
        double minTime=INF;
        for(int i = 0; i <= n; i++)
            minTime=min(minTime,d[i][g][1]);
        if(EQ(minTime,INF))
            cout<<"unreachable"<<endl;
        else
            printf("%.6f\n",minTime);
    }

    return 0;
}

Measured memory_bytes: 5396
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


int N, K;
long long x[110], y[110];



int main() {
    while (cin >> N >> K) {
        for (int i = 0; i < N; ++i) cin >> x[i] >> y[i];
        
        long long res = -1;
        vector<long long> xalt, yalt;
        for (int i = 0; i < N; ++i) {
            xalt.push_back(x[i]);
            yalt.push_back(y[i]);
        }
        sort(xalt.begin(), xalt.end());
        sort(yalt.begin(), yalt.end());
        
        for (int i1 = 0; i1 < N; ++i1) {
            for (int i2 = i1+1; i2 < N; ++i2) {
                for (int j1 = 0; j1 < N; ++j1) {
                    for (int j2 = j1+1; j2 < N; ++j2) {
                        long long tmp = (xalt[i2] - xalt[i1]) * (yalt[j2] - yalt[j1]);
                        int num = 0;
                        for (int i = 0; i < N; ++i) {
                            if (xalt[i1] <= x[i] && x[i] <= xalt[i2] && yalt[j1] <= y[i] && y[i] <= yalt[j2])
                                ++num;
                        }
                        if (num >= K) {
                            //cout << xalt[i1] << ", " << xalt[i2] << ", " << yalt[j1] << ", " << yalt[j2] << endl;
                            //cout << tmp << "; " << num << endl;
                            if (res == -1) res = tmp;
                            else chmin(res, tmp);
                        }
                    }
                }
            }
        }
        cout << res <<endl;
    }
}















Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("0"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}

const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;


int main() {
  int l, r;
  scanf("%d%d",&l,&r);
  if (l <= 0 && 0 <= r) puts("Zero");
  else if (l > 0) puts("Positive");
  else {
    l = -l;
    r = -r;
    if ((r-l)%2 == 0) puts("Negative");
    else puts("Positive");
  }
  return 0;
}










Measured memory_bytes: 256
import java.util.*;

// ABC 62-D
// http://abc062.contest.atcoder.jp/tasks/arc074_b
 
public class Main {

	public static void main (String[] args) throws java.lang.Exception {
		Scanner in = new Scanner(System.in);
		
		int N = in.nextInt();
		int[] nums = new int[3 * N];
		for (int i = 0; i < 3 * N; i++) {
			nums[i] = in.nextInt();
		}
		
		// Do left 
		PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
		long sum = 0;
		for (int i = 0; i < N; i++) {
			pq.add(nums[i]);
			sum += nums[i];
		}
		
		long[] maxInLeft = new long[N + 1];
		maxInLeft[0] = sum;
		
		for (int i = N; i < 2 * N; i++) {
			pq.add(nums[i]);
			sum += nums[i];
			sum -= pq.poll();
			maxInLeft[i - N + 1] = sum;
		}
		
		
		// Do right
		long[] minInRight = new long[N + 1];
		sum = 0;
		pq = new PriorityQueue<Integer>(Collections.reverseOrder());
		for (int i = 3 * N - 1; i >= 2 * N; i--) {
			sum += nums[i];
			pq.add(nums[i]);
		}
		
		minInRight[N] = sum;
		
		for (int i = 2 * N - 1; i >= N; i--) {
			pq.add(nums[i]);
			sum += nums[i];
			sum -= pq.poll();
			minInRight[i - N] = sum;
		}
		
		
		// Calculate max in left and min in right
		long answer = Long.MIN_VALUE;
		for (int i = 0; i < N + 1; i++) {
			answer = Math.max(answer, maxInLeft[i] - minInRight[i]);
		}
		System.out.println(answer);
	}
}

Measured memory_bytes: 92840
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
const ll INF = 1LL<<60;
const ll mod=1e9+7;
using namespace std;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
 
const ll MAX=210000;
ll fac[MAX], finv[MAX], inv[MAX];

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

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

int main(){
    ll n,a,b,k,ans=1;
    cin>>n>>k;
    COMinit();
    if(k==1)ans--;
    rep(i,1,min(n-1,k)+1){
        ans=(ans+COM(n,i)*COM(i+n-i-1,n-i-1))%mod;
    }
    cout<<ans;
}

Measured memory_bytes: 5120
using System;
using System.Linq;
class aoj
{
    static void Main()
    {
        int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int []b= Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int c = a[0] + a[1] + a[2] + a[3];
        int d = b[0] + b[1] + b[2] + b[3];
        if (c < d)
            Console.WriteLine(d);
        else
            Console.WriteLine(c);
    }
}

Measured memory_bytes: 9592
#include<stdio.h>
int main()
{
    int A1,A2,A3;
    scanf("%d%d%d",&A1,&A2,&A3);
    if(A1+A2+A3>=22)
      {
          printf("bust\n");
      }
      else
      {
          printf("win\n");
      }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

class Stack {
public:
    Stack() {
        top_ = 0;
    }

    void push(int x) {
        stack_[top_] = x;
        top_++;
    }

    int pop() {
        top_--;
        return stack_[top_];
    }

private:
    int top_;
    int stack_[1000];
};

int main() {
    char str[100];
    int a;
    int b;
    Stack stack;
    string line;
    getline(cin, line);
    istringstream stream(line);
    while (stream >> str) {
        if (str[0] == '+') {
            a = stack.pop();
            b = stack.pop();
            stack.push(b + a);
        } else if (str[0] == '-') {
            a = stack.pop();
            b = stack.pop();
            stack.push(b - a);
        } else if (str[0] == '*') {
            a = stack.pop();
            b = stack.pop();
            stack.push(b * a);
        } else {
            stack.push(atoi(str));
        }
    }
    cout << stack.pop() << endl;
    return 0;
}

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


int main(){
    ll N, M;
    cin >> N >> M;
    vector<ll> H(N);
    for (ll i = 0; i < N; i++)
    {
        cin >> H.at(i);
    }
    
    vector<ll> low(N, 0);
    //vector<ll> A(M), B(M);
    for (ll i = 0; i < M; i++)
    {
        ll A, B;
        cin >> A >> B;
        --A;--B;


        if (H.at(A) == H.at(B))
        {
            low.at(A)++;
            low.at(B)++;
        } else if (H.at(A) > H.at(B))
        {
            low.at(B)++;
            
        } else
        {
            low.at(A)++;
        }        
    }
    
    int tower = 0;
    for (ll i = 0; i < N; i++)
    {
        if (low[i] == 0)
        {
            tower++;
        } 
        
    }

    
    cout << tower << endl;

    return 0;

}

Measured memory_bytes: 4848
#include <cstdio>
#include <cmath>

int main (){
    int N,D;
    scanf("%d %d",&N,&D);
    int x[D][N];
    for (int i = 0; i < N; i++){
    for (int j = 0; j < D; j++){
        scanf("%d",&x[j][i]);
    }
    }
    int distance;
    int distance2;
    int count=0;
    for (int i = 0; i < N; i++){
    for (int j = 0; j < N; j++){
        distance2=0;
        if(i!=j){
            for (int k = 0; k < D; k++){
                distance2+=(x[k][i]-x[k][j])*(x[k][i]-x[k][j]);
            }
            distance=std::sqrt(distance2);
            distance=std::floor(distance);
            if(distance2==distance*distance) count++;
        }
    }
    }
    printf("%d",count/2);
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int N = 0,k = 0,i = 0,v = 0,j = 0,A[1000],l = 0;
  scanf("%d",&N);
  if(0 <= N && N <= 100){
    for(k = 0;k < N;k++){
      scanf("%d",&A[k]);
      printf("%d",A[k]);
      if(k < N-1){
	printf(" ");
      }
    }
    printf("\n");
    for(i = 1;i <= N-1;i++){
      v = A[i];
      j = i - 1;
      while(j >= 0 && A[j] > v){
	A[j+1] = A[j];
	j--;
      }
      A[j+1] = v;
      for(l = 0;l < N;l++){
	printf("%d",A[l]);
	if(l < N-1){
	  printf(" ");
	}
      }
      printf("\n");
    }
  }
  return 0;
}



Measured memory_bytes: 2140
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        String[] tr = new String[count];
        String[] hnk = new String[count];

        int trScore = 0;
        int hnkScore = 0;

        for(int i=0; i<count; i++){
        	tr[i] = sc.next();
        	hnk[i] = sc.next();
        }
        for(int i=0; i<count; i++){
        	if(tr[i].compareTo(hnk[i]) > 0){
        		trScore = trScore + 3;
        	}
        	if(hnk[i].compareTo(tr[i]) > 0){
        		hnkScore = hnkScore + 3;
        	}
        	if(tr[i].compareTo(hnk[i]) == 0){
        		trScore++;
        		hnkScore++;
        	}
        }
        System.out.println(trScore+" "+hnkScore);
    }
}



Measured memory_bytes: 29888
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(a, 1, 10) rep(b, 1, 10) if (a * b == N) {
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;
}







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

int main(){
 int a,b,c,t,ans;
  cin>>a>>b;
  ans=100000000;
  for(int i=0;i<a;i++){
    cin>>c>>t;
    if(b>=t){
      ans=min(ans,c);
    }
  }
  if(ans==100000000){
  cout<<"TLE"<<endl;
  }
  else{
    cout<<ans<<endl;
  }

}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int a,b,c,d,e,f,g,h,s,t;
	scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f,&g,&h);
	s=a+b+c+d;
	t=e+f+g+h;
	if(s>t){
		printf("%d\n",s);
	}else{
		printf("%d\n",t);
	}
	return 0;
}

Measured memory_bytes: 2692
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] tokens = in.readLine().split(" ");
		int n = Integer.parseInt(tokens[0]);
		int m = Integer.parseInt(tokens[1]);
		ArrayList<Integer>[] adj = new ArrayList[n+1];
		for (int i = 1; i <= n; i++)
			adj[i] = new ArrayList<Integer>();
		int a, b;
		for (int i = 0; i < m; i++) {
			tokens = in.readLine().split(" ");
			a = Integer.parseInt(tokens[0]);
			b = Integer.parseInt(tokens[1]);
			adj[a].add(b);
			adj[b].add(a);
		}
		boolean[] v = new boolean[n+1];
		int ans = 0;
		int size;
		for (int i = 1; i <= n; i++) {
			if (!v[i]) {
				LinkedList<Integer> q = new LinkedList<Integer>();
				q.add(i);
				v[i] = true;
				size = 1;
				while (!q.isEmpty()) {
					int c = q.poll();
					for (int j : adj[c]) {
						if (!v[j]) {
							q.add(j);
							v[j] = true;
							size++;
						}
					}
				}
				ans = Math.max(size, ans);
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 72496
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

long double p[10], q[10], sum, r, s; vector<pair<long double, long double>> A, B;

int main() {
	for (int i = 1; i <= 6; i++) { cin >> p[i]; p[i] /= 100; }
	for (int i = 1; i <= 6; i++) { cin >> q[i]; q[i] /= 100; }
	for (int i = 1; i <= 6; i++) {
		if (fabs(p[i] - q[i]) < 0.001) {
			A.push_back(make_pair(0, p[i] + q[i]));
			s += q[i];
		}
		else if (p[i] > q[i]) {
			A.push_back(make_pair((p[i] - q[i]) / (p[i] + q[i]), p[i] + q[i]));
			s += q[i];
		}
		else {
			B.push_back(make_pair((q[i] - p[i]) / (p[i] + q[i]), p[i] + q[i]));
			r += p[i];
		}
	}
	sum = r + s; sort(A.begin(), A.end()); sort(B.begin(), B.end());
	if (r < s) {
		long double S = s - r;
		for (int i = 0; i < A.size(); i++) {
			long double E = A[i].second;
			long double F = A[i].second*A[i].first;
			if (E > S) { sum += F*S / E; break; }
			else { S -= A[i].second; sum += F; }
		}
	}
	else {
		long double S = r - s;
		for (int i = 0; i < B.size(); i++) {
			long double E = B[i].second;
			long double F = B[i].second*B[i].first;
			if (E > S) { sum += F*S / E; break; }
			else { S -= B[i].second; sum += F; }
		}
	}
	printf("%.20Lf\n", 1.0L - sum / 2);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LL long long
#define Max 100005
#define Mod 1e9+7
const LL mod=1e9+7;
const LL inf=1e10;
using namespace std;
int main()
{
	int n;
	LL a[Max];
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		scanf("%lld",&a[i]);
	sort(a,a+n);
	int t;
	while(a[1]!=inf)
	{
		for(int i=1;a[i]!=inf && i<n;i++)
		{
			t=a[i]%a[0];
			if(t==1)
				break;
			if(t==0)
				a[i]=inf;
			else
				a[i]=t;
		}
		if(t==1)
		{
			printf("%d\n",1);
			return 0;
		}
		sort(a,a+n);
	}
	printf("%lld\n",a[0]);
    return 0;
}


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

int main(void){
    int n, T;
    cin >> n >> T;
    
    int t;
    int last_t = -T;
    int ans = 0;
    int i;
    for(i = 1; i <= n; i++){
        cin >> t;
        if(last_t + T <= t){
            ans += T;
        }else{
            ans += t - last_t;
        }
        
        last_t = t;
    }
    
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef int64_t LL;
typedef uint64_t ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
template<class T, class... U> void DEBUG(const T &head, const U &... tail) { 
#ifdef HOME
    _W('#'); _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...);
#endif
}
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int get(int id){
    W(id);fflush(stdout);
    char s[24];
    RS(s);
    if(s[0]=='V')exit(0);
    if(s[0]=='F')return 1;
    return 0;
}
int a[SIZE];
int main(){
    int N;R(N);
    a[0]=a[N]=get(0);
    int ll=0,rr=N;
    while(ll<rr){
        int mm=(ll+rr)/2;
        a[mm]=get(mm);
        if((a[mm]^a[ll])==(mm-ll)%2){
            ll=mm;
        }
        else rr=mm;
    }
    return 0;
}


Measured memory_bytes: 852
#include <iostream>
#include <utility>
#include <functional>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)
#define rem(i,n,x) for(int i=n;i>x;i--)
#define SORT(x) sort(x.begin(),x.end())
#define REV(x) reverse(x.begin(),x.end())
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define setp(x) setprecision(x)
using LL = long long;
using ULL = unsigned long long;

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

	cout << min(a * n, b) << endl;

	return 0;
}

Measured memory_bytes: 256
from operator import mul
ans = 0

N, M, C = map(int, input().split())
X = [list(map(int, input().split())) for i in range(N + 1)]

for i in range(N):  
  num = list(map(mul, X[0],X[i+1]))
  add = sum(num) + C
  if add > 0:
    ans += 1

print(ans)

Measured memory_bytes: 9208
#include <iostream>
#include <math.h>
#include <vector>
#include <cstdlib>
 
using namespace std;
 
int main(int argc, const char * argv[]) {
	int N = 0;
	int count = 0;
 
	cin >> N;
	vector<int> H(N);
	for(int i=0; i<N; i++){
		cin >> H[i];
	} 
 
	if(N == 1){
		cout << "Yes" << endl;
		return 0;
	}
 
	for(int i=N-1; i>1; i--){
		if(H[i - 1] > H[i]){
			H[i - 1]--;
			count++;
		}
	}
 
	if(count == 0){
		cout << "Yes" << endl;
		return 0;
	}
 
	count = 0;
	for(int i=N-1; i>1; i--){
		if(H[i - 1] > H[i]){ count++;}
	}
	if(count == 0){
		cout << "Yes" << endl;
		return 0;
	}
 
	cout << "No" << endl;
 
	return 0;
}


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

#define MOD 1000000007

int main() {
    int N;
    cin >>N;
    vector<int> A(N, 0);
    for (int i=0; i<N; i++)
        cin >>A.at(i);
    for (int i=N-1; i>=1; i--)
        cout <<A.at(i) <<' ';
    cout <<A.at(0) <<endl;
    return 0;
}


Measured memory_bytes: 3116
#include <iostream>
int main(){
  int n, c[501], s[501], f[501], a[501]={}, i=0,j, t;
  std::cin>>n;
  while(std::cin>>c[i]>>s[i]>>f[i])i++;
  for(i=0;i<n-1;++i){
    t=0;
    j=i;
    while(j<n-1){
      if(t<s[j])t=s[j];
      else if(t%f[j]==0){t+=c[j];++j;}
      else {t+=c[j]+f[j]-t%f[j];++j;}
    }
    a[i] = t;
  }
  for(i=0;i<n;++i)std::cout<<a[i]<<"\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std ;
int main () {
    int n,x;
    x = 0;
    cin >> n;
    
    for(int i = 1; pow(2,i) <= n; i++)
    {
        x++;
    }
    cout << pow(2,x) << endl;
    
} 

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <string>
#define ll long long
#include <vector>
using std::vector;

using namespace std;


int main()
{
    ll a , b;
    cin >> a >> b;
    if((a+b)%2 == 0)
        cout << (a+b)/2 << endl;
    else
        cout << "IMPOSSIBLE" << endl;

    return 0;
}


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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

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

    rep(i,s.size()){
        if(s[i]=='C'){
            rep2(j,i+1,s.size()){
                if(s[j]=='F'){
                    cout<<"Yes"<<endl;
                    return 0;
                }
            }
        }
    }

    cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#define popcount __builtin_popcount
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int n; cin>>n;
    int cnta[200020]={}, cntb[200020]={};
    vector<int> ans;
    int a[200020], b[200020];
    int s[200020];
    for(int i=0; i<n; i++){
        cin>>a[i];
        cnta[a[i]]++;
    }
    for(int i=0; i<n; i++){
        cin>>b[i];
        cntb[b[i]]++;
    }
    for(int i=1; i<=n; i++){
        if(cnta[i]+cntb[i]>n){
            cout<<"No"<<endl;
            return 0;
        }
        s[i]=cnta[i]+cntb[i];
    }
    set<P> st;
    vector<P> v;
    for(int i=1; i<=n; i++){
        if(cntb[i]>0) st.insert({s[i], i});
    }
    cout<<"Yes"<<endl;
    for(int i=0; i<n; i++){
        P p=*st.rbegin();
        st.erase(p);
        if(p.second!=a[i]){
            ans.push_back(p.second);
            cntb[p.second]--;
            if(cntb[p.second]) st.insert({p.first-1, p.second});
            s[p.second]--;
        }else{
            P p2=*st.rbegin(); st.erase(p2);
            ans.push_back(p2.second);
            cntb[p2.second]--;
            if(cntb[p2.second]) st.insert({p2.first-1, p2.second});
            st.insert(p);
            s[p2.second]--;
        }
        st.erase({s[a[i]], a[i]});
        s[a[i]]--;
        st.insert({s[a[i]], a[i]});
    }
    for(int i=0; i<n; i++){
        cout<<ans[i]<<" ";
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 16708
use std::io;
//use std::collections::HashMap;
//use std::collections::BinaryHeap;
//use std::collections::HashSet;
//use std::mem; // mem::swap(&mut x,&mut y);
use std::cmp; // cmp::max,cmp::min

// Rust memo: https://hackmd.io/i0lQY1OKTDW1t66TECOmiw?both

#[allow(dead_code)]
fn read_line() -> String{
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
fn read_charvec() -> Vec<char>{
    read_line().chars().collect()
}

#[allow(dead_code)]
fn read_ints() -> Vec<i64>{
    let s = read_line();
    let split:Vec<&str> = s.split(" ").collect();
    split.iter().map(|&x| x.to_string().parse().unwrap()).collect()
}

#[allow(dead_code)]
fn read_int() -> i64{
    read_ints()[0]
}

#[allow(dead_code)]
fn reverse(s: &String) -> String{
    s.chars().rev().collect::<String>()
}

#[allow(dead_code)]
fn read_lines(n:i64) -> Vec<String>{
    let mut xs = Vec::new();

    for _i in 0..n{
        xs.push(read_line());
    }

    xs
}

#[allow(dead_code)]
fn read_ints2(n:i64) -> Vec<i64>{
    read_lines(n).iter().map(|x| x.parse().unwrap()).collect()
}

#[allow(dead_code)]
fn arange(start:i64,end:i64,step:i64) -> Vec<i64>{
    let mut ret = Vec::new();
    let mut i = start;

    while i < end{
        ret.push(i);
        i += step;
    }

    ret
}

#[allow(dead_code)]
const DXS : [i64; 4] = [0,0,1,-1];
#[allow(dead_code)]
const DYS : [i64; 4]  = [1,-1,0,0];
#[allow(dead_code)]
const INF : i64 = 999999999;

////////////////////////////////////////////////


fn make_cost(change_cost: &Vec<Vec<i64>>,color_map: &Vec<Vec<i64>>,n : usize) -> Vec<i64>{
    let c = change_cost.len();
    let mut ret = vec![0 as i64;c];
    //eprintln!("make-cost start");
    //eprintln!("n={},c={}",n,c);

    for i in 0..color_map.len(){
        for j in 0..color_map[0].len(){
            if (i+j)%3 == n{
                let color_from = (color_map[i][j]-1) as usize;
                
                for color_to in 0..c{
                    ret[color_to] += change_cost[color_from][color_to];
                }
            }
        }
    }
    //eprintln!("make-cost end");

    ret
}

fn solve(costs:Vec<Vec<i64>>)->i64{
    let c = costs[0].len();
    let mut min_val = 999999999999;

    for c1 in 0..c{
        for c2 in 0..c{
            if c1 == c2{
                continue;
            }

            for c3 in 0..c{
                if c1 == c3 || c2 == c3{
                    continue;
                }

                min_val = cmp::min(
                    min_val,
                    costs[0][c1] + costs[1][c2] + costs[2][c3]
                );

            }
        }
    }

    min_val

}

fn main(){
    let inputs = read_ints();
    let (n,c) = (inputs[0],inputs[1]);

    let change_cost : Vec<Vec<i64>> = (0..c)
        .map(|_| read_ints())
        .collect();
    let color_map : Vec<Vec<i64>> = (0..n)
        .map(|_| read_ints())
        .collect();
    
    let types_change_cost : Vec<Vec<i64>> =
        (0..3)
        .map(|n| make_cost(&change_cost,&color_map,n))
        .collect();

    println!("{}",solve(types_change_cost));
}


Measured memory_bytes: 6396
a=[input() for i in range(2)]
a1=[int(i) for i in a[0].split()]
a2=[int(i) for i in a[1].split()]
k=a1[1]
for i in range(a1[0]-a1[1]):
	if a2[i]<a2[i+k]:
		print("Yes")
	else:
		print("No")

Measured memory_bytes: 33676