akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> P;
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define fr(i,n) for(int i=0;i<(n);i++)
#define Fr(i,n) for(int i=0;i++<(n);)
#define ifr(i,n) for(int i=(n)-1;i>=0;i--)
#define iFr(i,n) for(int i=(n);i>0;i--)

template<class T,class E> struct LSeg{
    typedef function<T(T,T)> F;
    typedef function<T(T,E)> G;
    typedef function<E(E,E)> H;
    typedef function<E(E,int)> P;
    int n;F f;G g;H h;T et;E ee;P p;
    vector<T> dat;
    vector<E> lazy;
    LSeg(int n_,F f_,G g_,H h_,T et_,E ee_,P p_=[](E a,int b){return a;}){
        f=f_;g=g_;h=h_;et=et_;ee=ee_;p=p_;
        n=1;
        while(n<n_) n*=2;
        dat.resize(2*n-1,et);
        lazy.resize(2*n-1,ee);
    }
    inline void prop(int k,int l,int r){
        if(lazy[k]==ee) return;
        if(r-l>1){
            lazy[k*2+1]=h(lazy[k*2+1],lazy[k]);
            lazy[k*2+2]=h(lazy[k*2+2],lazy[k]);
        }
        dat[k]=g(dat[k],p(lazy[k],r-l));
        lazy[k]=ee;
    }
    T ud(int be,int en,E t,int k,int l,int r){
        prop(k,l,r);
        if(r<=be||en<=l) return dat[k];
        if(be<=l&&r<=en){
            lazy[k]=h(lazy[k],t);
            return g(dat[k],p(lazy[k],r-l));
        }
        return dat[k]=f(ud(be,en,t,k*2+1,l,(l+r)/2),ud(be,en,t,k*2+2,(l+r)/2,r));
    }
    T ud(int be,int en,E t){
        ud(be,en,t,0,0,n);
    }
    T gt(int be,int en,int k,int l,int r){
        prop(k,l,r);
        if(r<=be||en<=l) return et;
        if(be<=l&&r<=en) return dat[k];
        T vl=gt(be,en,k*2+1,l,(l+r)/2),vr=gt(be,en,k*2+2,(l+r)/2,r);
        return f(vl,vr);
    }
    T gt(int be,int en){
        return gt(be,en,0,0,n);
    }
};

template<class T> void cc(vector<T> a,map<T,int>& nm,vector<int>& c){
    sort(a.begin(),a.end());
    fr(i,a.size()){
        if(i<a.size()-1&&a[i]==a[i+1]) continue;
        nm[a[i]]=c.size();
        c.pb(a[i]);
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N=0,M,q,A,B,C;
    map<ll,int> nm;vector<ll> a;vector<int> c;
    cin>>M>>q;
    vector<ll> d(q);
    vector<pair<ll,pair<ll,ll>>> xst;
    fr(i,M){
        cin>>A>>B>>C;
        if(B<C) continue;
        if(A<C) A=C;
        xst.emplace_back(C,mp(A,B));
        a.pb(xst[N].ft);
        if(A>C) a.pb(A-C);
        a.pb(B-C);
        N++;
    }
    fr(i,q){
        cin>>d[i];
        a.pb(d[i]);
    }
    a.pb(0);
    sort(a.begin(),a.end());
    cc(a,nm,c);
    auto mn=[](int a,int b){return min(a,b);};
    LSeg<int,int> sg(c.size(),mn,mn,mn,INT_MAX,INT_MAX);
    fr(i,N){
        sg.ud(nm[-(xst[i].ft-xst[i].sd.ft)],nm[-(xst[i].ft-xst[i].sd.sd)],xst[i].ft);
    }
    fr(i,q){
        ll ans=sg.gt(nm[d[i]],nm[d[i]]+1);
        if(ans==INT_MAX) cout<<-1<<endl;
        else cout<<ans<<endl;
    }
}

Measured memory_bytes: 84620
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int N=in.nextInt();
		
		for(int i=0;i<N;i++){
			int k=Integer.parseInt(in.next()),p=Integer.parseInt(in.next());
			while(k>p){
				k-=p;
			}
			System.out.println(k);
		}
	}

}



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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll n;
  cin >> n;
  vector<string> s(n);
  REP(i, n) { cin >> s[i]; }
  sort(all(s));
  s.erase(unique(s.begin(), s.end()), s.end());
  cout << s.size() << "\n";
}

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

#define MAX 100005

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

  int n, target = 2, ans;
  cin >> n;

  vector<bool> v(MAX);
  for (int i = 0; i < MAX; i++) v[i] = true;
  v[0] = v[1] = false;

  while (target * target <= MAX)
  {
    for (int i = target+1; i <= MAX; i++)
    {
      if(i % target == 0) v[i] = false;
    }
    for (int i = target+1; i < MAX; i++)
    {
      if(v[i])
      {
        target = i;
        break;
      }
    }
  }

  for (int i = n; i < MAX; i++)
  {
    if(v[i])
    {
      cout << i << endl;
      return 0;
    }
  }

  return 0;
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
#define inf (long long)(1e9)
using namespace std;

long long n, cnt = 0;
vector<string> v;
long long memo[205][205] = {0};

long long solve();

int main() {
  cin >> n;
  v.resize(n);
  for(int i = 0; i < n; ++i) cin >> v[i];
  for(int i = 0; i < n; ++i)
    for(int j = 0; j < n; ++j)
      if(i == j)
        memo[i][j] = 0;
      else if(v[i][j] == '1')
        memo[i][j] = 1;
      else
        memo[i][j] = inf;
  cout << solve() << endl;
  return 0;
}

long long solve() {
  for(int k = 0; k < n; ++k)
    for(int i = 0; i < n; ++i)
      for(int j = 0; j < n; ++j) {
        memo[i][j] =
            min(memo[i][j], memo[i][k] + memo[k][j]);
      }
  for(int i = 0; i < n; ++i)
    for(int j = 0; j < n; ++j)
      for(int k = 0; k < n; ++k)
        if(memo[i][j] != inf && memo[i][k] != inf &&
           (memo[i][j] % 2) !=
               (memo[i][k] + memo[k][j]) % 2)
          return -1;
  long long ans = 0;
  for(int i = 0; i < n; ++i)
    for(int j = 0; j < n; ++j) {
      ans = max(ans, memo[i][j]);
      for(int k = 0; k < n; ++k) ans = max(ans, memo[i][j]);
    }
  return ans + 1;
}


Measured memory_bytes: 4028
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926535
int main()
{
  int n,i,j,k;
  string s;
  cin>>n>>s;
  long long r=0,g=0,b=0;
  for(i=0;i<n;i++)
  {
      if(s[i]=='B')b++;
      if(s[i]=='R')r++;
      if(s[i]=='G')g++;

  }
  long long A,rbg;
  A=r*b*g;
  rbg=(int)('R')+(int)('B')+(int)('G');
  for(i=0;i<n;i++)
  {
      for(j=i+1;j<n;j++)
      {
          k=2*j-i;
          if(k<n)
            if((int)s[i]+(int)(s[j])+(int)(s[k])==rbg)
            A--;
      }
  }
cout<<A<<endl;
    return 0;
}


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

using namespace std; 
  int main()
  {
  int h,w;
  cin>>h>>w;
  char a[h][w];
  int i,j;
  for(i=0;i<h;i++)

{
    for(j=0;j<w;j++)
    {
        cin>>a[i][j];
    }
} 
long long int dp[i][j];
long long int M=1e9 +7;
      for(i=0;i<h;i++)

     {
    for(j=0;j<w;j++)
    {
        dp[i][j]=0;
    }
     }
     for(i=0;i<h;i++)
     {
         for(j=0;j<w;j++)
         {
             if(i==0&&j==0)
             dp[i][j]=1;
             else if(i==0)
             {
                 if(a[i][j]=='.')
                 dp[i][j]=dp[i][j-1];
             }
             else if(j==0)
             {
                  if(a[i][j]=='.')
                 dp[i][j]=dp[i-1][j];
             }
             else
             {
                 if(a[i][j]=='.')
                 {
                     dp[i][j]=(dp[i-1][j]+dp[i][j-1])%M;
                 }
             }
         }
     }
     cout<<dp[h-1][w-1]<<endl;

      return 0;
  }

Measured memory_bytes: 12368
#include <iostream>
#include <cassert>
#include <queue>
#include <algorithm>

#define INF 922337203685477580
typedef long long ll;

using namespace std;

ll cnt = 0LL;

void merge(ll* A, int left, int mid, int right) {
  int n1 = mid - left;
  int n2 = right - mid;
  ll L[n1 + 10];
  ll R[n2 + 10];

  for (int i = 0; i < n1; i++) {
    L[i] = A[left + i];
  }
  for (int i = 0; i < n2; i++) {
    R[i] = A[mid + i];
  }
  L[n1] = INF;
  R[n2] = INF;

  int i = 0;
  int j = 0;
  for (int k = left; k < right; k++) {
    if (L[i] <= R[j]) {
      A[k] = L[i];
      i++;
    } else {
      A[k] = R[j];
      cnt += n1 - i;
      j++;
    }
  }
}

void mergeSort(ll* A, int left, int right) {
  if (left + 1 < right) {
    int mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}


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

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


  mergeSort(A, 0, n);

  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 6212
#include<bits/stdc++.h>
using namespace std;
int L;
int p[25], eid;
struct edge{
    int v, w, nxt;
}e[200];
void add(int u, int v, int w){
    e[eid].v = v;
    e[eid].w = w;
    e[eid].nxt = p[u];
    p[u] = eid++;
}
int main(){
    memset(p, -1, sizeof p);
    eid = 0;
    scanf("%d", &L);
    int n = 0, tmp = L;
    while(tmp){
        n++;
        tmp >>= 1;
    }
    for(int i = 1; i < n; ++i){
        add(i, i+1, 0);
        add(i, i+1, 1<<(i-1));
    }
    int w = 1<<(n-1);
    for(int i = n - 2; i >= 0; --i){
        if(L&(1<<i)){
            add( i+1, n, w);
            w += 1<<i;
        }
    }
    printf("%d %d\n", n, eid);
    for(int i = 1; i <= n; ++i){
        for(int j = p[i]; ~j; j = e[j].nxt){
            printf("%d %d %d\n", i, e[j].v, e[j].w);
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const long long INF = LLONG_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ll long long int
using namespace std;
ll ans = 0, sum = 0, n, k, counter = 0, w, h;
string s;
vector<ll> v;
vector<pair<ll, ll>> vp;
vector<vector<ll>> vv(50, vector<ll>(50, INF));

map<char, ll> mp;
ll d[105][105];
vector<ll> vec;

int main()
{
	cin >> w >> h >> n;
	ll a, b, c;
	ll cu = 0, cd = h, cl = 0, cr = w;
	vp.resize(n);
	REP(i,n)
	{
		cin >> a >> b >> c;
		if (c == 1)
		{
			cl = max(cl, a);
		}
		else if (c == 2)
		{
			cr = min(cr, a);
		}
		else if (c == 3)
		{
			cu = max(cu, b);
		}
		else if (c == 4)
		{
			cd = min(cd, b);
		}
	}
	if (cd - cu < 0 || cr - cl < 0)
	{
		cout << "0" << endl;
		return 0;
	}
	cout << (cd - cu) * (cr - cl) << endl;
}


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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;

int main(){
	int n;
	int w[110];
	cin>>n;

	int rw[101];
	rw[0]=0;
	int sum=0;
	for (int i = 1; i <= n; ++i){
		cin>>w[i];
		rw[i]=w[i]+rw[i-1];
		sum+=w[i];
	}

	int ans=1e+9;
	for (int i = 0; i <= n; ++i){
		ans=min(abs((sum-rw[i])-rw[i]),ans);
	}


	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
	re int t=0;re char v=getchar();
	while(v<'0')v=getchar();
	while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
	return t;
}
int n;
long long ans;
char s[200002];
map<int,int>v;
inline int ksm(re int x,re int y){
	re int an=1;
	while(y){
		if(y&1)an=an*x%2019;
		x=x*x%2019;
		y>>=1;
	}
	return an;
}
inline void work(re int l,re int r){
	if(l==r)return;
	re int mid=l+r>>1;
	v.clear();
	re int pw=1,m=0;
	for(re int i=mid;i>=l;--i){
		m=m+(s[i]-'0')*ksm(10,mid-i);
		m%=2019;
		++v[m];
	}
	m=0;
	for(re int i=mid+1;i<=r;++i){
		m=m*10+s[i]-'0';
		m%=2019;
		pw*=10;
		pw%=2019;
		for(re int j=0;j<=2018;++j)if((j*pw+m)%2019==0){
			ans+=v[j];
			break;
		}
	}
	work(l,mid),work(mid+1,r);
}
int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	work(1,n);
	printf("%lld\n",ans);
}

Measured memory_bytes: 3948
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
N,X,T = map(int,input().split())
a = (N-1)//X + 1
print(a*T)

Measured memory_bytes: 10568
n = int(input())
num = n % 10

if num == 2 or num == 4 or num == 5 or num == 7 or num == 9:
    print("hon")
elif num == 0 or num == 1 or num == 6 or num == 8:
    print("pon")
else:
    print("bon")

Measured memory_bytes: 9172
import java.util.*;

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

        int level = 0;
        if (a >= 400 && a < 600) {
            level = 8;
        } else if (a >= 600 && a < 800) {
            level = 7;
        } else if (a >= 800 && a < 1000) {
            level = 6;
        } else if (a >= 1000 && a < 1200) {
            level = 5;
        } else if (a >= 1200 && a < 1400) {
            level = 4;
        } else if (a >= 1400 && a < 1600) {
            level = 3;
        } else if (a >= 1600 && a < 1800) {
            level = 2;
        } else if (a >= 1800 && a < 2000) {
            level = 1;
        }

        System.out.println(level);
	}
}

Measured memory_bytes: 35852
import math
 
n=int(input())
 
sum=0
for i in range(1,n+1):
  for j in range(1,n+1):
      x=math.gcd(i,j)
      for h in range(1,n+1):
        p=math.gcd(x,h)
        sum=sum+p
print(sum)

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

int main(void) {
  string s, t;
  cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());

  string result = s < t ? "Yes" : "No";
  cout << result << endl;
  return 0;
}

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

using namespace std;

int main() {
    string ar[] = {"Sunny", "Cloudy", "Rainy"};
    map<string, string> st = {{ar[0], ar[1]},
                              {ar[1], ar[2]},
                              {ar[2], ar[0]}};

    string s;
    cin >> s;
    cout << st[s] << endl;
//    if (s == "Sunny") {
//        cout << "Cloudy" << endl;
//    } else if (s == "Cloudy") {
//        cout << "Rainy" << endl;
//    } else {
//        cout << "Sunny" << endl;
//    }
    return 0;
}


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

int n, sum, ans;
int t[22];
bool used[22];

void solve(int idx, int t_sum){
  if(idx == n){
    ans = min(ans, abs(t_sum - (sum - t_sum)));
    return;
  }

  solve(idx + 1, t_sum);
  solve(idx + 1, t_sum + t[idx]);
}

int main(){
  while(cin >> n, n){
    sum = 0;
    for(int i = 0; i < n; i++){
      cin >> t[i];
      sum += t[i];
    }

    ans = INT_MAX;
    memset(used, 0, sizeof(used));
    solve(0, 0);

    cout << ans << endl;
  }
}

Measured memory_bytes: 864
/** 
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

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

/* see https://github.com/pllk/cphb/
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
    tree_order_statistics_node_update> indexed_set;
 **/

typedef long long ll;
#define endl "\n"
#define fori(n) for(ll i=0; i<(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinall(a, n) vll a(n); fori(n) { cin>>a[i]; }

//typedef __int128 lll;
typedef pair<int, int> pii;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;
typedef vector<ll> vll;

int main() {
cin.tie(nullptr);
std::ios::sync_with_stdio(false);
    cini(a);
    cini(b);
    cini(c);

    cout<<max(0, c-(a-b))<<endl;
}



Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<iomanip>
#include<sstream>
#include<map>
#include<set>
#include<cmath>
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
	std::fill((T*)array, (T*)(array + N), val);
}
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1;i <=n;i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
#define ALL(a) a.begin(),a.end()
typedef long long ll;
typedef long double ld;
const ll INF =  1LL << 60;
const int inf = 1 << 20;
ll n, m, x, y, q, d,z, w = 0, sum = 0, ans = 0;
const int MAX = 510000;
const int MOD = 1000000007;
int main(void) {
	cin >> n >> m; vector<int> a(n),c;
	rep(i, n) cin >> a[i];
	rep(i, m + 1) {
		for (int j = 0; i + j <= min(m, n); j++) {
			priority_queue<int>pq;
			rep(k, i) pq.push(a[k] * -1);
			for (int k = n - 1, c = 0; c < j; c++, k--)pq.push(a[k] * -1);
			for (int k = i + j; k < m; k++) {
				if (!pq.empty() && pq.top() > 0)pq.pop();
			}sum = 0;
			while (!pq.empty())sum -= pq.top(), pq.pop();
			ans = max(sum, ans);
		}
	}cout << ans << endl;
}

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

const int maxn = 1e5+5;
int N;
int H[maxn];

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }
    bool poss = true;
    for (int i = N - 2; i >= 0; i--) {
        if (H[i] <= H[i+1]) {
            continue;
        }
        else {
            H[i]--;
            if (H[i] > H[i+1]) {
                poss = false;
                break;
            }
        }
    }
    cout << (poss ? "Yes" : "No") << '\n';
}



Measured memory_bytes: 768
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int h, w;
vector<string> s;
const int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1};
vector<vector<bool>> used;

bool dfs(int x, int y, int a, int b, int c, int d, int e, int f) {
    if (x == h - 1 && y == w - 1) {
        return true;
    }
    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (nx < h && nx >= 0 && ny < w && ny >= 0 && !used[nx][ny]) {
            used[nx][ny] = true;
            if (i == 0) {// 前
                if (b != s[nx][ny] - '0') {
                    continue;
                }
                else if (dfs(nx, ny, e, a, c, d, f, b)) {
                    return true;
                }
            }
            else if (i == 1) {// 右
                if (c != s[nx][ny] - '0') {
                    continue;
                }
                else if (dfs(nx, ny, d, b, a, f, e, c)) {
                    return true;
                }
            }
            else if (i == 2) {// 後
                if (e != s[nx][ny] - '0') {
                    continue;
                }
                else if (dfs(nx, ny, b, f, c, d, a, e)) {
                    return true;
                }
            }
            else {// 左
                if (d != s[nx][ny] - '0') {
                    continue;
                }
                else if (dfs(nx, ny, c, b, f, a, e, d)) {
                    return true;
                }
            }
        }
    }
    //cout << x << " " << y << " " << a << " " << b << " " << c << endl;
    return false;
}

int main() {
    cin >> h >> w;
    s.resize(h);
    used.resize(h, vector<bool>(w, false));
    for (int i = 0; i < h; i++) {
        cin >> s[i];
    }
    used[0][0] = true;
    if (dfs(0, 0, 1, 2, 3, 4, 5, 6)) {
        puts("YES");
    }
    else {
        puts("NO");
    }
    return 0;
}


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

typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))



int main(){
  stack<char> s;
  string S;
  cin >> S;
  int N = S.size();
  s.push(S.at(0));
  rep(i, N - 1){
    char a = S.at(i + 1);
    if(a != s.top()) s.push(a);
  }
  cout << s.size() - 1 <<endl;
}
    

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

long long A[1009];
vector<long long> stk;

int main() {
    int N, K; scanf("%d%d",&N,&K);
    for(int i=0; i<N; i++) scanf("%lld",&A[i]);
    for(int i=0; i<N; i++) {
        long long s = 0;
        for(int j=i; j<N; j++) {
            s += A[j];
            stk.push_back(s);
        }
    }
    for(int i=40; i>=0; i--) {
        vector<long long> nxt;
        for(auto& it: stk) {
            if(it & (1LL << i)) nxt.push_back(it);
        }
        if((int)nxt.size() >= (int)K) stk = nxt;
    }
    long long ans = stk[0];
    for(auto& it: stk) ans &= it;
    printf("%lld", ans);
    return 0;
}


Measured memory_bytes: 6128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    int m,n;
    vector<int> a(2000,0);
    cin >> n >> m;
    int sum = 0;
    for (size_t i = 0; i < n; i++)
    {
        cin >> a[i];
        sum += a[i];
    }
    int num = 0;
    for (size_t i = 0; i < n; i++)
    {
        if (a[i] * (4 * m) >= sum)
        {
            num += 1;
        }
    }
    cout << (num >= m ? "Yes" : "No") << endl;
}

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

using ll=long long;

int main() {
  int N,A,B; cin >>N >>A >>B;
  int max_val=min(A,B);
  int min_val=max(0,max_val-N+max(A,B));
  cout <<max_val <<' ' <<min_val <<endl;
  return 0;
}


Measured memory_bytes: 3584
#include <cstdio>
using namespace std;
const int n=50;
typedef long long LL;

LL a[51];
LL k;

int main()
{
	scanf("%lld",&k);
	int rem=(int)(k%(LL)n);
	LL p=k/(LL)n;
	for(int i=1;i<=n;i++)
		a[i]=p+(n-1);
	
	for(int i=1;i<=rem;i++)
		a[i]+=(LL)n-(LL)rem+1ll;
	for(int i=rem+1;i<=n;i++)
	    a[i]-=(LL)rem;
	
	printf("%d\n",n);
	for(int i=1;i<=n;i++)
		printf("%lld ",a[i]);
	printf("\n");
	return 0;
}

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

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

struct Matrix{
    ll V[50][50];
    Matrix(){
        rep(i,50){
            rep(j,50){
                V[i][j] = 0;
            }
        }
    }
};

Matrix I;

Matrix operator*(Matrix a, Matrix b){
    Matrix c;
    rep(i,50){
        rep(j,50){
            rep(k,50){
                c.V[i][j] += a.V[i][k] * b.V[k][j] % MOD;
                c.V[i][j] %= MOD;
            }
        }
    }
    return c;
}

ll N,K;

Matrix matrix_power(Matrix a, ll b){
    if(b==0) return I;
    Matrix res = matrix_power(a,b/2);
    res = res * res;
    if(b%2) res = res * a;
    return res;
}

int main(){
    rep(i,50) I.V[i][i] = 1;
    ll N,K; cin>>N>>K;
    Matrix A;
    rep(i,N)rep(j,N)cin>>A.V[i][j];

    Matrix res = matrix_power(A,K);
    ll ans = 0;
    rep(i,N)rep(j,N){
        ans += res.V[i][j];
        ans %= MOD;
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 9524
#include<bits/stdc++.h>
using namespace std;
int h,w;
int ch,cw,dh,dw;
char mtr[1001][1001];
int visited[1001][1001]={0};
bool legal(int x,int y)
{
	if(x>=0 && x<h && y>=0 && y<w && mtr[x][y]=='.' && !visited[x][y])
	 return true;
	return false;
}
int main()
{
	cin>>h>>w;
    cin>>ch>>cw>>dh>>dw;
    ch--,cw--,dh--,dw--;
    for(int i=0; i<h; i++){
    	for(int j=0; j<w; j++)
    	 cin>>mtr[i][j];
	}
	deque<pair<int,pair<int,int> > >dq;
	dq.push_front(make_pair(0,make_pair(ch,cw)));
	int dx[]={1,0,0,-1};
	int dy[]={0,1,-1,0};
	int ans=-1;
	while(!dq.empty())
	{
		auto var=dq.front();
		dq.pop_front();
		int x=var.second.first;
		int y=var.second.second;
		if(visited[x][y])
		 continue;
		visited[x][y]=1;
	//	cout<<"("<<x+1<<" , "<<y+1<<" , "<<var.first<<")\n";
		if(x==dh && y==dw){
			ans=var.first;
			break;
		}
		for(int i=0; i<4; i++){
			if(legal(x+dx[i],y+dy[i])){
				dq.push_front(make_pair(var.first,make_pair(x+dx[i],y+dy[i])));
			}
		}
		for(int i=-2; i<=2; i++){
			for(int j=-2; j<=2; j++){
				if(legal(x+i,y+j)){
					dq.push_back(make_pair(var.first+1,make_pair(x+i,y+j)));
				}
			}
		}
	}
	cout<<ans;
	return 0;
}

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

int a[100000];
int main() {
    const int INF = 1e9;
    int n, k;
    while(~scanf("%d%d", &n, &k) && n) {
        for(int i = 0; i < n; ++i) scanf("%d", a + i);
        int sum = 0, ans = -INF;
        for(int i = 0; i < n; ++i) {
            sum += a[i];
            if(i < k - 1) continue;
            if(i >= k) sum -= a[i - k];
            ans = max(ans, sum);
        }
        printf("%d\n", ans);
    }
}

Measured memory_bytes: 3544
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int n;
vvi G;
vi in;
bool h=true;
int dfs(int a){
	bitset<5011>bs;
	bs[0]=1;
	int sum=0,out=inf;
	rep(i,G[a].size()){
		int to=G[a][i];
		int p=dfs(to);
		sum+=in[to]+p;
		bs=bs<<p|bs<<in[to];
	}
	rep(i,in[a]+1)if(bs[i])out=min(out,sum-i);
	if(out==inf)h=false;
	return out;
}
int main(){
	cin>>n;
	G=vvi(n);
	rep(i,n-1){
		int a;cin>>a;
		G[a-1].pb(i+1);
	}
	in=vi(n);
	rep(i,n)cin>>in[i];
	dfs(0);
	if(h)cout<<"POSSIBLE"<<endl;
	else cout<<"IMPOSSIBLE"<<endl;
}









Measured memory_bytes: 1664
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
ITP1_5-D
Structured Program I - Structured Programming
Time Limit : 1 sec, Memory Limit : 65536 KB
?§???????????????°???????????°

goto ?????????C/C++?¨????????????§???????????¨?????§???????????§????????????????????¨????????¶????????????????????????????????????????£?????????????????????° goto CHECK_NUM; ??¨?????????????????????????????¨???????????°??????????????§ CHECK_NUM: ??¨????????????????????????????§?????????????????????????????????£????????°?????????????????????????????????????????¨?????§????????????

?????????goto ???????????±??????????????????????????°?????????????????§?????±??????????????????????????????????????????????????¨?????¨?\¨?????????????????????

?¬????C++?¨???????????????°????????¨?????????????????????????????°????????????????????????????????????????????????goto ????????????????????§????£?????????????????????????

void call(int n){
  int i = 1;
 CHECK_NUM:
  int x = i;
  if ( x % 3 == 0 ){
    cout << " " << i;
    goto END_CHECK_NUM;
  }
 INCLUDE3:
  if ( x % 10 == 3 ){
    cout << " " << i;
    goto END_CHECK_NUM;
  }
  x /= 10;
  if ( x ) goto INCLUDE3;
 END_CHECK_NUM:
  if ( ++i <= n ) goto CHECK_NUM;

  cout << endl;
}

Input

???????????´??° n

?????????????????????????????????
Output

????¨?????????°???????????\????????´??° n

????????????????????????????????????????????????
Constraints

    3???n???10000

Sample Input

30

Sample Output

 3 6 9 12 13 15 18 21 23 24 27 30

??????????????????????????????????????¨?????¨????????????????????????
=end
#n = ARGV[0].to_i
n=STDIN.gets.to_i
i = 1
while i <=n do
  x = i
  if x % 3 == 0 then
    print " " + i.to_s
  elsif x % 10 == 3 then
    print " " + i.to_s
  else
    x = x / 10
    while x > 0 do
      if x % 10 == 3 then
        print " " + i.to_s
        break
      end
      x = x / 10
    end
  end

  i = i + 1
end
puts

Measured memory_bytes: 8720
#include<stdio.h>

main(){
  int a[2], b, c, tmp;
  int pre, res;
  int i;
  int min_b, min_c;
  int min, max;

  while(1){
    res = scanf("%d %d", &b, &c);

    if(res == EOF){
      break;
    }

    a[0] = b;
    a[1] = c;

    if(a[0] < a[1]){
      tmp = a[0];
      a[0] = a[1];
      a[1] = tmp;
    }

    while(1){
      pre = a[0] % a[1];

      if(pre == 0){
        max = a[1];
        break;
      }
      else{
        a[0] = a[1];
        a[1] = pre;
      }
    }

    min_b = b;
    min_c = c;

    while(1){
      if(min_b < min_c){
        min_b += b;
	continue;
      }

      if(min_c < min_b){
        min_c += c;
	continue;
      }

      if(min_c == min_b){
        min = min_c;
        break;
      }
    }

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

  return 0;
}

Measured memory_bytes: 596
#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N,A;
ll x[100];
ll dp[51][51][2501];
int main(){
    cin>>N>>A;
    for(ll i=0;i<N;i++){
        cin>>x[i];
    }
    dp[0][0][0]=1;
    for(ll i=0;i<N;i++){
        for(ll j=0;j<=N;j++){
            for(ll k=0;k<=N*50;k++){
                dp[i+1][j][k]+=dp[i][j][k];
                if(k+x[i]>N*50 || j+1>N)continue;
                dp[i+1][j+1][k+x[i]]+=dp[i][j][k];
            }
        }
    }
    ll ans=0;
    for(ll j=1;j<=N;j++){
        for(ll k=0;k<=N*50;k++){
            if(k%j==0 && k/j==A)ans+=dp[N][j][k];
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 50048
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

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

	vector<int> a(n);
	vector<int> b(n, 0);

	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		if (i && a[i] < a[i - 1])
		{
			b[i] = a[i - 1] - a[i];
			a[i] = a[i - 1];
		}
	}

	long long ans = 0;

	for (int i = 0; i < n; i++)
	{
		ans += b[i];
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4840
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <iomanip>
#include <locale>

using namespace std;

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


	bool isMMYY = true;
	bool isYYMM = true;

	if (S.c_str()[0] > 49) {
		isMMYY = false;
	}
	if((S.c_str()[0] == 49 && S.c_str()[1] > 50)
	|| (S.c_str()[0] == 48 && S.c_str()[1] == 48)) {
		isMMYY = false;
	}
	if (S.c_str()[2] > 49) {
		isYYMM = false;
	}
	if (S.c_str()[2] == 49 && S.c_str()[3] > 50
	|| (S.c_str()[2] == 48 && S.c_str()[3] == 48)) {
		isYYMM = false;
	}

	if (isMMYY && isYYMM) {
		cout << "AMBIGUOUS" << endl;
	}
	else if (isMMYY) {
		cout << "MMYY" << endl;
	}
	else if (isYYMM) {
		cout << "YYMM" << endl;
	}
	else {
		cout << "NA" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define endl '\n'
#define mod 1000000007
#define inf 1000000000000000000
#define pii pair<ll, vector<ll>>
const double pi = acos(-1);
ll n;
int solve() {
	int d;
	cin>>n>>d;
	int ans = 0;
	while(n--) {
		ll x, y;
		cin>>x>>y;
		ll x1 = pow(x, 2) + pow(y, 2);
		double cur = sqrt(x1);
		if(cur <= d) ans++;
	}
	return ans;
}
int main() {
	io
	int t = 1;
	//cin>>t;
	while(t--) {
		cout<<solve()<<endl;
	}
}






Measured memory_bytes: 3716
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int h = 0;
		for(int i=1; i<=b-a; i++){
			h += i;
		}
		System.out.println(h - b);
	}
}

Measured memory_bytes: 24148
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;

double memo[302][302][302];
int N;

double dfs(int one, int two, int thr) {
  if (memo[one][two][thr] != 0) return memo[one][two][thr];

  if (one == 1 && two == 0 && thr == 0) {
    return N;
  }

  double ret = 0;
  int num_ok = one + two + thr;
  if (thr > 0) ret += (1.0 * thr / num_ok) * dfs(one, two + 1, thr - 1);
  if (two > 0) ret += (1.0 * two / num_ok) * dfs(one + 1, two - 1, thr);
  if (one > 0) ret += (1.0 * one / num_ok) * dfs(one - 1, two, thr);

  // 次のステップに進めるまでに掛かる回数の期待値
  double e = 1.0 / (1.0 * num_ok / N);
  return memo[one][two][thr] = e + ret;
}

int main(void) {
  cin >> N;
  vector<int> a(N);
  vector<int> cnt(3);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    cnt[a[i] - 1]++;
  }

  cout << fixed << setprecision(10) << dfs(cnt[0], cnt[1], cnt[2]) << endl;
  
  return 0;
}

Measured memory_bytes: 215296
#include<bits/stdc++.h>
using namespace std;
char a[100][101],b[102][102];

int main(){
  int h,w;
  cin >> h >> w;
  for(int i=0; i<h; i++)
   scanf("%s",a[i]);
  
  for(int i=0;i<h+2;i++)
    for(int j=0; j<w+2; j++)
      b[i][j] = '#' ;
  
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      b[i+1][j+1] = a[i][j];

  
  for(int i =0; i<h+2; i++){
    for(int j=0; j<w+2; j++)
      cout << b[i][j];
    cout << endl;
  }
    

}

Measured memory_bytes: 3748
n,d = map(int,input().split())
x = []
for _ in range(n):
  xi = list(map(int,input().split()))
  x.append(xi)
def dis(a,b,d):
  s = 0
  for i in range(d):
    s += (a[i] - b[i])**2
  return s
count = 0
for i in range(n-1):
  for j in range(i+1,n):
    e = dis(x[i],x[j],d)
    ed = e**(1/2)
    if (ed - int(ed)) == 0:
      count += 1
print(count)
      

Measured memory_bytes: 3064
s=list(input())
l=len(s)
now=0
ans=[0 for i in range(l)]
def c(rnum,lnum,rcen,lcen):
    if (rnum-1)%2==1:
        ans[lcen]+=(rnum-1)//2+1
        ans[rcen]+=(rnum-1)//2
    else:
        ans[lcen]+=(rnum-1)//2
        ans[rcen]+=(rnum-1)//2
    if (lnum-1)%2==1:
        ans[lcen]+=(lnum-1)//2
        ans[rcen]+=(lnum-1)//2+1
    else:
        ans[lcen]+=(lnum-1)//2
        ans[rcen]+=(lnum-1)//2
    ans[lcen]+=1 #中心のヒトも足す
    ans[rcen]+=1
while now<=(l-1):
    r=0 #Rの間はr=0
    rnum,lnum=0,0
    rcen,lcen=0,0 #R,Lの中心の座標
    while True: #１区間
        if l-1<now: #範囲オーバー
            c(rnum,lnum,rcen,lcen)
            break
        if r==1 and s[now]=="R": #区間の終わり
            c(rnum,lnum,rcen,lcen)
            # now+=1しない　このRは次の区間のスタートだから
            break
        if s[now]=="R":
            rnum+=1
            now+=1
            continue
        if r==0 and s[now]=="L": #この条件が起こることは保証されてる
            rcen,lcen=now-1,now #R,Lの中心の座標
            lnum+=1
            now+=1
            r=1
            continue
        else:
            lnum+=1
            now+=1
            continue
    #print(rnum)
    #print(lnum)
for i in range(l):
    print(ans[i],end=" ")

Measured memory_bytes: 5556
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))
#define PRECISION(x) std::fixed << std::setprecision(x)

using namespace std;

using ll = long long;
using VI = std::vector<int>;
using VI2D = std::vector<vector<int>>;
using VLL = std::vector<long long>;
using VLL2D = std::vector<vector<long long>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T, std::size_t N>
struct make_vector_type {
	using type =
		typename std::vector<typename make_vector_type<T, (N - 1)>::type>;
};

template <typename T>
struct make_vector_type<T, 0> {
	using type = typename std::vector<T>;
};

template <typename T, size_t N>
auto make_vector_impl(const std::vector<std::size_t>& ls, T init_value) {
	if constexpr(N == 0) {
		return std::vector<T>(ls[N], init_value);
	} else {
		return typename make_vector_type<T, N>::type(
			ls[N], make_vector_impl<T, (N - 1)>(ls, init_value));
	}
}

template <typename T, std::size_t N>
auto make_vector(const std::size_t (&ls)[N], T init_value) {
	std::vector<std::size_t> dimensions(N);
	for(int i = 0; i < N; i++) {
		dimensions[N - i - 1] = ls[i];
	}
	return make_vector_impl<T, N - 1>(dimensions, init_value);
}

template <typename T>
std::vector<T> make_vector(std::size_t size, T init_value) {
	return std::vector<T>(size, init_value);
}

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max<T>(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min<T>(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

int main() {
	int n, x, t;
	cin >> n >> x >> t;
	cout << (n + x - 1) / x * t << endl;
	return 0;
}


Measured memory_bytes: 3644
s=list(input())
a=s[::2]
b=s[1::2]
if a.count('R')+a.count('U')+a.count('D')==len(a) and b.count('L')+b.count('U')+b.count('D')==len(b):
    print('Yes')
    exit()
print('No')


Measured memory_bytes: 2940
/*{{{*/
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define mset(x,c) memset(x, c, sizeof(x))
#define mem0(x) mset(x,0)
#define mem1(x) mset(x,-1)
#define memc(x,y) memcpy(x, y, sizeof(x));
#define P(a,n) FOR(_,0,n) _W(a),printf("%c", " \n"[_==n-1])
#define print(a,n) cout << #a << " = ";FOR(_,0,n) _W(a),printf("%c", " \n"[_==n-1])
using namespace std;

template<class T> void _R(T &x) { cin >> x; }
void _R(signed &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 signed &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.fi); putchar(' '); _W(x.se);}
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...); }
#ifdef LOCAL
 #define debug(...) {printf(" [" #__VA_ARGS__ "]: ");W(__VA_ARGS__);}
#else
 #define debug(...)
#endif

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
/*}}}*/
//#define int long long

signed main() {
#ifndef ONLINE_JUDGE
	freopen("a.in", "r", stdin);
	freopen("a.out", "w", stdout);
#endif
	int d, t, s;
	R(d, t, s);
	if (s*t >= d) puts("Yes");
	else puts("No");
}


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

int main() {
    int a,b;
    cin >> a >> b;
    if(a <= b) cout << a << endl;
    else cout << a-1 << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

class Main{
	public static void main(String[] args) {
		SC sc=new SC(System.in);
		int H=sc.nextInt();
		int W=sc.nextInt();
		int[][] flag=new int[H][W];
		int[][] wbr=new int[3][H+1];	//累積和
		for(int i=0; i<H; i++) {
			String s=sc.next();
			for(int j=0; j<W; j++) {
				if(s.charAt(j)=='W') {
					flag[i][j]=0;
				}
				else if(s.charAt(j)=='B') {
					flag[i][j]=1;
				}
				else if(s.charAt(j)=='R') {
					flag[i][j]=2;
				}
			}
		}
		for(int i=0; i<3; i++) {
			for(int j=0; j<=H; j++) {
				wbr[i][j]=0;
			}
		}
		for(int h=0; h<3; h++) {
			for(int i=0; i<H; i++) {
				for(int j=0; j<W; j++) {
					if(flag[i][j]!=h) {
						wbr[h][i+1]++;
					}
				}
			}
		}
		for(int i=0; i<3; i++) {
			for(int j=1; j<=H; j++) {
				wbr[i][j]=wbr[i][j]+wbr[i][j-1];
			}
		}
		int min=H*W*2;

		for(int i=1; i<H; i++) {
			for(int j=1; j<H; j++) {
				if(i<j) {
					int sum=wbr[0][i]-wbr[0][0]+wbr[1][j]-wbr[1][i]+wbr[2][H]-wbr[2][j];
					min=Math.min(min, sum);
				}
			}
		}
		pl(min);
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}


Measured memory_bytes: 24724
import java.util.*;

class Node{
	int ver;
	long wei;

	Node(int ver, long wei){
		this.ver = ver;
		this.wei = wei;
	}
}

public class Main{

	// declaring variables
	static boolean vis[];
	static ArrayList<ArrayList<Node>> adj;
	static int color[];

	public static void dfs(int node, long dis){
		vis[node] = true;
		// odd means 1, even means 0
		if( dis%2 == 0 )
			color[node] = 0;
		else
			color[node] = 1;

		for(Node nd : adj.get(node)){
			if( !vis[nd.ver] ){
				dfs(nd.ver, dis + nd.wei); // passing the edge weight
			}
		}
	}

	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		vis = new boolean[n];
		color = new int[n];
		adj = new ArrayList<ArrayList<Node>>();
		for(int i = 0; i < n; i++)
			adj.add(new ArrayList<Node>());
		int u, v;
		long w;
		for(int i = 0; i < n-1; i++){
			u = in.nextInt();
			v = in.nextInt();
			w = in.nextLong();
			u--;
			v--;
			adj.get(v).add(new Node(u, w));
			adj.get(u).add(new Node(v, w));
		}
		dfs(0, 0);
		for(int i = 0; i < n; i++)
			System.out.println(color[i]);
	}
}

Measured memory_bytes: 116756
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//				new Main().solveA();
		new Main().solveA2();
		//		new Main().solveB();
		//		new Main().solveC();
		//		new Main().solveC2();
		// new Main().solveD();
	}

	private void solveA() {

		try (Scanner scanner = new Scanner(System.in)) {
			int numA = 0;
			int numB = 0;
			int numC = 0;
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();

			int wk = numB;
			int res = 0;
			while (wk >= numA && res < numC) {
				wk -= numA;
				res++;
			}

			System.out.println(res);

		}
	}

	private void solveA2() {

		try (Scanner scanner = new Scanner(System.in)) {
			int numA = numA = scanner.nextInt();
			int numB = scanner.nextInt();
			int numC = scanner.nextInt();

			int res = 0;
			if (numB / numA > numC) {
				res = numC;
			} else {
				res = numB / numA;
			}

			System.out.println(res);

		}
	}

	private void solveB() {

		try (Scanner scanner = new Scanner(System.in)) {
			int numA = 0;
			int numB = 0;
			int numK = 0;
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numK = scanner.nextInt();

			List<Integer> wk = new ArrayList<Integer>();
			for (int i = 1; i <= Math.max(numA, numB); i++) {
				if (numA % i == 0 && numB % i == 0) {
					wk.add(i);
				}
			}

			System.out.println(wk.get(wk.size() - 1 - numK));

		}
	}

	private int getList(List<Character> wk) {

		if (wk.size() < 2) {
			return 0;
		}

		int res = 0;
		int i1 = 0;
		int i2 = 1;
		for (int i = 1; i < wk.size(); i++) {
			if (wk.get(i) != wk.get(i - 1)) {
				i1 = i - 1;
				i2 = i;
				break;
			}
			if (i == wk.size() - 1) {
				return 0;
			}
		}
		while (i2 < wk.size()) {

			char c1 = wk.get(i1);
			char c2 = wk.get(i2);
			if (c1 != c2) {
				wk.remove(i2);
				wk.remove(i1);
				res += 2;
			} else {
				i1 = i2;
				i2 = i2 + 1;
			}
		}
		return getList(wk) + res;
	}

	private void solveC() {

		try (Scanner scanner = new Scanner(System.in)) {
			char[] wkS;
			wkS = scanner.next().toCharArray();

			List<Character> wk = new ArrayList<Character>();
			for (char c : wkS) {
				wk.add(c);
			}

			System.out.println(getList(wk));

		}
	}

	private void solveC2() {

		try (Scanner scanner = new Scanner(System.in)) {
			char[] wkS;
			wkS = scanner.next().toCharArray();

			int cnt0 = 0;
			int cnt1 = 0;
			for (char c : wkS) {
				if (c == '0') {
					cnt0++;
				} else if (c == '1') {
					cnt1++;
				}
			}

			System.out.println(Math.min(cnt0, cnt1) * 2);

		}
	}

	private void solveD() {

		try (Scanner scanner = new Scanner(System.in)) {
			int numN = 0;
			int numK = 0;
			int numS = 0;
			numN = scanner.nextInt();

			System.out.println("");

		}
	}
}

Measured memory_bytes: 22996
import math
a, b, x = (int(i) for i in input().split())
if a*a*b/2 >= x:
    print(math.degrees(math.atan((b*b*a)/(2*x))))
else:
    print(math.degrees(math.atan((2*(a*a*b-x))/(a*a*a))))

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main() {
    int n,m;
    cin>>n>>m;
    int ass=0,t;
    while(m--){
    	cin>>t;
    	ass+=t;
    }if(ass>n){
    	cout<<-1;
    }else cout<<n-ass;
    return 0;
}


Measured memory_bytes: 3632
// In the name of God

#include <bits/stdc++.h>

using namespace std;

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

	vector<int> a(n);

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

	int ans = 0;
	
	priority_queue<pair<int,int>> pq;

	for(int i = 0; i < n; i++) pq.push(make_pair(-a[i], i));

	while(!pq.empty()) {
		int now = pq.top().second;
		pq.pop();
		ans += a[now];
		for(int j = now + 1; j < n; j++) {
			if(a[j] == 0) break;
			a[j] -= a[now];
		}
		for(int j = now - 1; j >= 0; j--) {
			if(a[j] == 0) break;
			a[j] -= a[now];
		}
		a[now] = 0;
	}

	cout << ans;

	return 0;
}


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

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

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

int main() {
	int n; cin >> n;
	vector<int>a(n + 1); for (int i = 0; i < n; i++)cin >> a[i + 1];
	vector<int>b(n + 1);
	for (int i = n; i >= 1; i--) {
		int sum = 0;
		for (int j = i + i; j <= n; j += i) {
			sum ^= b[j];
		}
		b[i] = sum ^ a[i];
	}
	vector<int>ans;
	for (int i = 1; i <= n; i++) {
		if (b[i])ans.push_back(i);
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++) {
		printf("%d%c", ans[i], i + 1 == ans.size() ? '\n' : ' ');
	}
	return 0;
}

Measured memory_bytes: 3064