akhauriyash/Code-Regression huggingface dataset:
def resolve():
    n, k = map(int, input().split())
    m= n-(n//k)*k
    tmp=m
    min=m

    while True:
        tmp = abs(tmp-k)
        if tmp < min:
            min = tmp
        else:
            break
    print(min)
    
    
if __name__ == "__main__":
    resolve()

Measured memory_bytes: 2940
#include <iostream>

using namespace std;

int main(){
	long long int N;
	long long int X,p,pl,c=0,sum=0;
	cin >> N >> X;
	long long int S,L;
	sum+=N;
	if(X<N-X){
		S=X;L=N-X;
	}else{
	 S=N-X;L=X;
	}

	if(X==1){
		sum=0;
		sum+=(N-X)*3;
		cout << sum << endl;
		return 0;
	}
	if(N-X==1){
		sum=0;
		sum+=X*3;
		cout << sum << endl;
		return 0;
	}
	while(S!=1){

		//cout << L  << ":" <<S <<endl; 
		if(L%S==0&&c%2==0){
			sum+=2*((L/S)*S)-S;
			break;
		}else if(L%S==0){
			sum+=2*((L/S)*S)-S;
			break;
		}else{
			sum+=2*(L/S)*S;
		}
		
		p=L-S*(L/S);
		
		pl=L;
		L=S;
		S=p;
		c++;

		//	cout << sum   <<endl; 

	}

	if(S==1&&c%2==0){
		sum+=L*2-S;
	}else if(S==1){
		sum+=L*2-S;
	}

	cout << sum << endl;


	return 0;
}

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

template<int mod> class ModInt
{
 private:
    lint val;
 public:
    lint value(){ return val; }
    ModInt(lint x=0){ val=x%mod; }
    ModInt pow(int n){
        ModInt res(1),x(val);
        while(n>0){ if(n&1) res*=x; x*=x; n>>=1; }
        return res;
    }
    ModInt inv(){ return pow(mod-2); }
    ModInt& operator+=(ModInt rhs){ val+=rhs.val; if(val>=mod) val-=mod; return *this; }
    ModInt& operator-=(ModInt rhs){ val+=mod-rhs.val; if(val>=mod) val-=mod; return *this; }
    ModInt& operator*=(ModInt rhs){ val=val*rhs.val%mod; return *this; }
    ModInt& operator/=(ModInt rhs){ *this*=rhs.inv(); return *this; }
    ModInt operator+(ModInt rhs){ return ModInt(val)+=rhs; }
    ModInt operator-(ModInt rhs){ return ModInt(val)-=rhs; }
    ModInt operator*(ModInt rhs){ return ModInt(val)*=rhs; }
    ModInt operator/(ModInt rhs){ return ModInt(val)/=rhs; }
};
using mint=ModInt<1000000007>;

template<typename T> class BiCoef
{
 public:
    vector<T> fact,ifact,inv;
    BiCoef(int N):fact(N+1),ifact(N+1),inv(N+1){
        fact[0]=ifact[N]=inv[0]=1;
        for(int i=1;i<=N;i++) fact[i]=fact[i-1]*i;
        ifact[N]/=fact[N];
        for(int i=N-1;i>=0;i--) ifact[i]=ifact[i+1]*(i+1);
        for(int i=1;i<=N;i++) inv[i]=ifact[i]*fact[i-1];
    }
    T comb(int n,int k){
        if(n<0 or k<0 or n<k) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

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

   int n,a,b; cin>>n>>a>>b;

   auto comb=[&](int n,int k)
   {
      mint res=1;
      for(int i=0;i<k;i++) res*=(n-i);
      for(int i=0;i<k;i++) res/=(k-i);
      return res;
   };
   mint ans=mint(2).pow(n)-1;
   ans-=comb(n,a);
   ans-=comb(n,b);
   cout<<ans.value()<<endl;
   return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
long a,b,c,n;
main()
{
	cin>>n;
	for(a=1;a<=3500;a++)for(b=a;b<=3500;b++)
	{
		long u=n*a*b,p=4*a*b-n*a-n*b;
		if(p>0&&u%p==0)
		{
			cout<<a<<" "<<b<<" "<<u/p<<endl;
			return 0;
		}
	}
}


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

int maxtime(int x){
    return (x+9) / 10 *10;
}

int rettime(int x){
    return maxtime(x) - x;
}

int main(){
    int a,b,c,d,e, sum;
    cin >> a >> b >> c >> d >> e;

    sum = maxtime(a)+maxtime(b)+maxtime(c)+maxtime(d)+maxtime(e);
    sum -= max({rettime(a),rettime(b),rettime(c),rettime(d),rettime(e)});

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;

int main() {
    int N;
    cin >> N;
    vector<pair<ll, ll>> jobs(N);
    ll a, b;
    for (int i = 0; i < N; i++) {
        cin >> a >> b;
        jobs[i] = {b, a};
    }
    sort(jobs.begin(), jobs.end());
    ll cur = 0;
    for (int i = 0; i < N; i++) {
        cur += jobs[i].second;
        if (jobs[i].first < cur) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 3328
#include <stdio.h>
int main(void){
	//atcorder A-HappyBirthday
	
	int A,B;
	
	scanf("%d",&A);
	scanf("%d",&B);
	
	if(A<=8 && B<=8){
		printf("Yay!\n");
	}else{
		printf(":(\n");
	}
	
	return 0;
}


Measured memory_bytes: 128
<?php
class Scanner {
    private $arr = [];
    private $count = 0;
    private $pointer = 0;
    public function next() {
        if($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }
    public function hasNext() {
        return $this->pointer < $this->count;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
}

class out {
    public static function println($str = "") {
        echo $str . PHP_EOL;
    }
}


$sc = new Scanner();
$S = $sc->next();
$out;

if($S[0] === 'A') {
	if($S[1] === 'B' || $S[2] === 'B') {
		$out = 'Yes';
	}
	else {
		$out = 'No';
	}
} else {
	if($S[1] === 'A' || $S[2] === 'A') {
		$out = 'Yes';
	}
	else {
		$out = 'No';
	}
}

out::println($out);


Measured memory_bytes: 4856
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int lli;
typedef vector<vector<lli> > vlli;
lli N, K, W;
vector<lli> Weight(100);
vector<lli> Value(100);
vector<vector<lli> > M(100005, vector<lli> (101, -1));
lli dfs(int S, int i, int N){
	if(S==0) return 0;
	if(S<0) return INT_MIN;
	if(i>=N) return 0;
	if(M[S][i]!=-1) return M[S][i];
	return M[S][i]=max(Value[i]+dfs(S-Weight[i], i+1, N), dfs(S, i+1, N));
}
int main() 
{ 
    cin>>N>>W;
    for (int i = 0; i < N; ++i)
    {
    	cin>>Weight[i]>>Value[i];
    }
    cout<<dfs(W, 0, N);
    return 0; 
}

Measured memory_bytes: 84352
#include <bits/stdc++.h>
using namespace std;
int n,k;
bool like[10];

bool can(int x) {
    while (x) {
        int d=x%10;x/=10;
        if (!like[d]) return false;
    }
    return true;
}

int main() {
    scanf("%d%d",&n,&k);
    memset(like,0xff,sizeof like);
    for (int i=1;i<=k;++i) {
        int d;
        scanf("%d",&d);
        like[d]=false;
    }
    int i=n;
    while (!can(i)) ++i;
    printf("%d\n",i);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cstring>
int main()
{
	int64_t X, K, D;
	std::cin >> X >> K >> D;
	X = std::abs(X);

	int64_t mul = X / D;
	if (mul > K) {
		mul = K;
	}
	X -= mul * D;
	K -= mul;
	if (K % 2) {
		X -= D;
		X = std::abs(X);
	}
	std::cout << X << std::endl;
	return 0;
}

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

int main() {
  string s;
  cin >> s;
  
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (i % 2 == 0) {
      if (s.at(i) == '0') {
        ans1++;
      }
      else { 
        ans2++;
      }
    }
    else {
      if (s.at(i) == '0') {
        ans2++;
      }
      else {
        ans1++;
      }
    }
  }
  cout << min(ans1,ans2) << endl;
}


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

struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) { }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};

using pint = pair<int,int>;
int main () {
    int N, M, K;
    cin >> N >> M >> K;
    vector<set<int> > dame(N);
    UnionFind uf(N);
    for (int i = 0; i < M; ++i) {
        int a, b; cin >> a >> b; --a, --b;
        dame[a].insert(b);
        dame[b].insert(a);
        uf.merge(a, b);
    }
    for (int i = 0; i < K; ++i) {
        int c, d; cin >> c >> d; --c, --d;
        if (!uf.issame(c, d)) continue;
        dame[c].insert(d);
        dame[d].insert(c);
    }

    for (int i = 0; i < N; ++i) {
        int mem = uf.size(i) - 1; // 同じ連結成分の「自分以外」の人数
        mem -= dame[i].size(); // その中ですでに友達かブロック関係の人数
        cout << mem << " ";
    }
    cout << endl;
}

Measured memory_bytes: 24704
#include <bits/stdc++.h>
typedef long long ll;
#define INF 1000000000
using namespace std;
int main(void){
    int n;
    string s;
    cin>>n>>s;
    int right_e=0,left_w=0;
    for(int i=1;i<s.size();i++){
        if(s[i]=='E'){
            right_e++;
        }
    }
    int ans=right_e;
    for(int i=1;i<s.size();i++){
        if(s[i-1]=='W'){
            left_w++;
        }
        if(s[i]=='E'){
            right_e--;
        }
        int tmp=left_w+right_e;
        if(tmp<ans){
            ans=tmp;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 900
import copy

n = int(input())

X = list(map(int,input().split()))

XX = copy.deepcopy(X)
XX.sort()
high = XX[n//2]
low = XX[n//2-1]

for i in range(n):
    if high == low:
        print(high)
        continue
    if X[i] < high:
        print(high)
    else:
        print(low)

Measured memory_bytes: 104316
N,K=map(int,input().split())
A=list(map(int,input().split()))
One=[0]*40
OneK=format(K, '040b')
flg=True
for i in range(40):
  for j in range(N):
    if A[j]==0:
      continue
    flg=False
    One[39-i]+=A[j]&1
    A[j]=A[j]>>1
  if flg:
    break
  flg=True
ans=0
i=0
while i<40:
  if OneK[i]=='1':
    break
  ans+=pow(2,39-i)*One[i]
  i+=1
flg=False
while i<40:
  if One[i]>=N/2:
    ans+=pow(2,39-i)*One[i]
    if OneK[i]=='1':
      flg=True
  else:
    if flg or OneK[i]=='1':
      ans+=pow(2,39-i)*(N-One[i])
    else:
      ans+=pow(2,39-i)*One[i]
  i+=1
print(ans)

Measured memory_bytes: 14620
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
const int mod=1e9+7;
const double eps=1e-8;
const int inf=0x3f3f3f3f;
const double pi=acos(-1.0);
//LL powmod(LL a,LL b) {LL res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int v[110];
int main()
{
    int n,a;
    cin>>n;
    int mx=0;
    for(int i=0;i<n;i++){
        cin>>a;
        v[a]++;
        mx=max(mx,a);
    }
    int mn=(mx+1)/2;
    for(int i=1;i<mn;i++)
        if(v[i]) return 0*puts("Impossible");
    for(int i=mn+1;i<=mx;i++)
        if(v[i]<2) return 0*puts("Impossible");
    if(v[mn]!=(mx&1)+1) return 0*puts("Impossible");
    puts("Possible");
    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
import sys
room_num,root_num = map(int,input().split())
#room_dis_dic = dict(zip(range(1,room_num+1),[0]+[sys.maxsize]*(room_num-1)))
connect_dic = defaultdict(set)
connected_list = [1]
next_connect_dic = {}
for _ in range(root_num):
    a,b = map(int,input().split())
    connect_dic[a].add(b)
    connect_dic[b].add(a)
    
for room_i in connected_list:
    #print(room_i)
    next_room_set = {connect_to for connect_to in connect_dic[room_i] if connect_to not in next_connect_dic.keys()}
    connected_list.extend(list(next_room_set))
    for next_room_i in next_room_set:
        next_connect_dic[next_room_i] = room_i

if len(set(range(2,room_num+1))-next_connect_dic.keys())!=0:
    print("No")
else:
    print("Yes")
    for i in range(2,room_num+1):
        print(next_connect_dic[i])

Measured memory_bytes: 83244
#include <stdio.h>

int	main()
{
	int K, A, B;

	scanf("%d\n%d %d\n", &K, &A, &B);
	for (int i = A; i <= B; i++)
	{
		if (i % K == 0){
			printf("OK\n");
			return 0;}
	}
	printf("NG\n");
	return 0;
}

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

int main()
{
	ll N, T;
	cin >> N >> T;
	vector<ll> D(N);
	for (int i = 0; i < N;i++) {
		cin >> D[i];
	}
	sort(D.begin(), D.end());
	ll res = 1;
	for (int i = 1; i < N;i++) {
		res = res * (i - (lower_bound(D.begin(), D.end(), D[i] - T) - D.begin()) + 1) % MOD;
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
const int N=1010,MOD=1e9+7;
char g[N][N];
int dp[N][N];
void add(int &x,int y){x+=y;if (x>=MOD) x-=MOD;}
int main()
{
	int n,m;scanf("%d%d",&n,&m);
	for (register int i=1;i<=n;++i) scanf("%s",g[i]+1);
	for (register int i=1;i<=n;++i)
	  for (register int j=1;j<=m;++j)
	  {
	  	  if (i==1&&j==1) {dp[1][1]=1;continue;}
	  	  if (g[i][j]=='.') add(dp[i][j],dp[i-1][j]),add(dp[i][j],dp[i][j-1]); else dp[i][j]=0;
	  }
	printf("%d\n",dp[n][m]);
	return 0;
}

Measured memory_bytes: 5248
from itertools import product

n, a, b, c = map(int, input().split())
kumiawase = list(product(range(4), repeat=n))
L = []
for _ in range(n):
    L.append(int(input()))


ans = 10 ** 20

for kumi in kumiawase:
    temp = 0
    L0 = []
    L1 = []
    L2 = []
    for j in range(n):
        if kumi[j] == 0:
            L0.append(L[j])
        if kumi[j] == 1:
            L1.append(L[j])
        if kumi[j] == 2:
            L2.append(L[j])
    n0 = len(L0)
    n1 = len(L1)
    n2 = len(L2)
    if n0 == 0 or n1 == 0 or n2 == 0:
        continue
    l0 = sum(L0)
    l1 = sum(L1)
    l2 = sum(L2)
    temp = 10 * (n0 - 1 + n1 - 1 + n2 - 1) + abs(l0 - a) + abs(l1 - b) + abs(l2 - c)
    ans = min(temp, ans)
print(ans)


Measured memory_bytes: 10996
#include <iostream>
#include<vector>
#include<algorithm>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include<iomanip>

using namespace std;
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define i64 int64_t
#define tos(x) to_string(x)


int main() {
	int a, b;
	cin >> a >> b;
	if (a % 2 == 0 || b % 2 == 0) {
		cout << "Even" << endl;
		return 0;
	}
	cout << "Odd" << endl;
	return 0;
}


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

int main(){
  int n;
  cin>>n;
  cout<<n<<":";
  for(int i=2;i*i<=n;i++){
    while(n % i == 0){
      n /= i;
      cout<<" "<<i;
    }
  }
  if(n-1) cout<<" "<<n;
  cout<<endl;
  return 0;
}



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

using namespace std;

int main() {
    std::ios::sync_with_stdio(false); 
    cin.tie(nullptr);
    
    int N;
    cin >> N;
    vector<int> L(2 * N);
    for (int i = 0; i < 2 * N; ++i) {
        cin >> L[i];
    }
    sort(begin(L), end(L));
    int sum = 0;
    for (int i = 0; i < 2 * N; i += 2) {
        sum += L[i];
    }
    cout << sum << "\n";

    return 0;
}

Measured memory_bytes: 256
// B - Count ACB
#include <stdio.h>

int main(void){
    int n;
    char s[51];
    scanf("%d", &n);
    scanf("%s", s);
    int cnt=0;
    for(int i=0; i<n-2; i++){
        if(s[i] == 'A'){
            if(s[i+1] == 'B'){
                if(s[i+2] == 'C') cnt++;
            }
        }
    }
    printf("%d\n", cnt);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, X;
  cin >> N >> X;
  int sum = 0;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
      cin >> vec.at(i);
    }
  for( int i = 0; i < N; i++){
    sum += vec.at(i);
      if( X < sum){
        cout << i + 1 << endl;
    break;
      }
     }
    if(sum <= X)
      cout << N + 1;
      
  }

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    // expectation: (1+n) * n / 2 / n = (n+1)/2
    int n, k;
    cin >> n >> k;
    vector<double> dp(n+1, 0.0);
    double ans = 0, val;
    for(int i = 0; i < n; i++) {
        cin >> val;
        dp[i+1] = dp[i] + (val+1) * 0.5;
    }
    for(int i = k; i < dp.size(); i++) {
        ans = max(ans, dp[i]-dp[i-k]);
    }
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
}



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

int main() {
	string S;
	cin >> S;
	bool AC = true;
	int Ccount = 0;
	if(S[0] == 'A' && S[1] >= 'a' && S[1] <= 'z' && S[S.size() - 1]  >= 'a' && S[S.size() - 1]  <= 'z'){
		for (int i = 2; i < S.size() - 1; i++)
		{
			if(S[i] == 'C'){
				Ccount++;

			}else if(!(S[i] >= 'a' && S[i] <= 'z')){
				AC = false;
				break;
			}
			
			if(Ccount > 1){
				
				AC = false;
				break;
			}

		}
	}else{

		AC = false;


	}

	if(Ccount != 1){
				
				AC = false;
			
			}
	

	if(AC){
		cout << "AC" << endl;

	}else{
		cout << "WA" << endl;

	}


}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const int INF = 1e9;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 20000;
constexpr ll nx[4] = {1,0,-1,0};
constexpr ll ny[4] = {0,1,0,-1};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> t(n),v(n);
    cins(all(t));
    cins(all(v));
    vector<vector<double>> dp(40005,vector<double>(205,0));
    int now = 0;
    rep(i,n){
        rep(j,1,2*t[i]+1){
            int limit = 2*v[i];
            rep(k,201){
                if ((i != 0 || k != 0) && dp[now+j-1][k] == 0.0) continue;
                if (i != 0 && j == 1){
                    if (k > limit) continue;
                }
                if (k == 0){
                    dp[now+j][0] = dp[now+j-1][0];
                    if (1 <= limit) dp[now+j][1] = dp[now+j-1][0]+0.125;
                }
                else if(k == 200){
                    if (200 <= limit) chmax(dp[now+j][200],dp[now+j-1][200]+50);
                    if (199 <= limit) chmax(dp[now+j][199],dp[now+j-1][200]+(2*k-1)/8.0);
                }
                else{
                    if (k-1 <= limit) chmax(dp[now+j][k-1],dp[now+j-1][k]+(2*k-1)/8.0);
                    if (k <= limit) chmax(dp[now+j][k],dp[now+j-1][k]+k/4.0);
                    if (k+1 <= limit) chmax(dp[now+j][k+1],dp[now+j-1][k]+(2*k+1)/8.0);
                }
            }
        }
        now += 2*t[i];
    }
    printf("%0.10f\n",dp[now][0]);
}


Measured memory_bytes: 65536
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		int a[] = new int[n];
		int b[] = new int[n];

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(br.readLine());
		}

		b = a.clone();

		Arrays.sort(a);
		int first = a[n - 1];
		int second = a[n - 2];

		for (int i = 0; i < n; i++) {
			if (b[i] == first) {
				System.out.println(second);
			} else {
				System.out.println(first);
			}
		}
	}
}


Measured memory_bytes: 56616
a,b,c=map(int,input().split())
k=int(input())
b_list=[]
c_list=[]

for i in range(k+1):
    b_list.append(b*(2**i))
    c_list.append(c*(2**i))

for j in range(k):
    if b_list[j]>a and c_list[k-j]>b_list[j]:
        print('Yes')
        break
else:
    print('No')

Measured memory_bytes: 9180
#include<stdio.h> //mergesort
#define N 500000
#define M 2000000000
 
 
int L[N/2+2],R[N/2+2];
int count=0;
 
 
void merge(int A[],int l,int m,int r)
{
  int i,j,k;
  int n1;
  int n2;
  
  n1 = m - l;
  n2 = r - m;

  for(i=0;i<n1;i++)
    {
      L[i] = A[l+i];
    }
  for(i=0;i<n2;i++)
    {
      R[i]=A[m+i];
    }

  L[n1] = R[n2]=M;
  i = j = 0;

  for(k=l;k<r;k++)
    {
      count++;
      if(L[i] <= R[j])
	{
	  A[k] = L[i];
	  i++;
	}
      else
	{
	  A[k] = R[j];
	  j++;
	}
    }
}
 
 
void mergesort(int A[],int l,int r)
{
  int m;
  if(l+1<r)
    {
      m = (l+r)/2;
      mergesort(A,l,m);
      mergesort(A,m,r);
      merge(A,l,m,r);
    }
}
 
 
int main()
{
  int i,a,b[N];

  scanf("%d",&a);

  for(i=0;i<a;i++)
    {
      scanf("%d",&b[i]);
    }
  mergesort(b,0,a);
  for(i=0;i<a-1;i++)
    {
      printf("%d ",b[i]);
    }
  printf("%d\n",b[a-1]);
  printf("%d",count);
  printf("\n");

  return 0;
}

Measured memory_bytes: 4508
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int W = num.nextInt();
        int H = num.nextInt();
        int x = num.nextInt();
        int y = num.nextInt();
        int r = num.nextInt();

        if (x >= r && y >= r) {
            if (W - x >= r && H - y >= r) {
                System.out.println("Yes");
            }else System.out.println("No");
        }else System.out.println("No");
    }
}

Measured memory_bytes: 26348
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
int main()	{
  int n,m;
  cin>>n>>m;
  int sum=n*(n-1)/2+m*(m-1)/2;
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <functional>
#include <numeric>
#include <set>
#include <cmath>
// #include <bits/stdc++.h>

using namespace std;
typedef long long li;

bool is_prime(const long long n) {
    for (int p = 2; p * p <= n; ++p) {
        if (n % p == 0) {
            return false;
        }
    }
    return true;
}

vector<long long> factor(long long n) {
    vector<long long> factors;
    for (long long p = 2; p * p <= n; ++p) {
        while (n % p == 0) {
            factors.push_back(p);
            n /= p;
        }
    }
    if (n > 1) {
        factors.push_back(n);
    }
    return factors;
}

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

    li n;
    cin >> n;
    vector<li> coefs(n + 1);
    for (int i = 0; i < n + 1; ++i) {
        cin >> coefs[n - i];
    }

    set<li> candidates;
    for (int i = 2; i <= n; ++i) {
        if (is_prime(i)) {
            candidates.insert(i);
        }
    }

    li g = abs(coefs[n]);
    for (const auto &coef : coefs) {
        if (coef != 0) {
            g = __gcd(g, abs(coef));
        }
    }

    for (const auto &prime : factor(g)) {
        candidates.insert(prime);
    }

    for (const auto &p : candidates) {
        vector<li> r = coefs;
        for (auto &&rv : r) {
            rv %= p;
            if (rv < 0) {
                rv += p;
            }
        }
        while (r.size() - 1 >= p) {
            const li degree = r.size() - 1;
            const li head = r.back(); r.pop_back();
            r[degree - p + 1] -= -head;
            r[degree - p + 1] %= p;
            if (r[degree - p + 1] < 0) {
                r[degree - p + 1] += p;
            }
        }
        bool ok = true;
        for (const auto &rv : r) {
            ok &= rv == 0;
        }
        if (ok) {
            cout << p << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <math.h>
#include <float.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<62;
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; }
// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
const int MOD = 1000000007;

// Binary Indexed Tree (Fenwick Tree)
template<typename T>
struct BIT {
  int n;
  vector<T> d;
  BIT(int n=0):n(n),d(n+1) {}
  void add(int i, T x=1) {
    for (i++; i <= n; i += i&-i) {
      d[i] += x;
    }
  }
  T sum(int i) {
    T x = 0;
    for (i++; i; i -= i&-i) {
      x += d[i];
    }
    return x;
  }
  T sum(int l, int r) {
    return sum(r-1) - sum(l-1);
  }
};

int main(){
    int N,Q; cin >> N >> Q;
    vector<int> c(N);
    rep(i,N) cin >> c[i];
    // 各数字が最後に出てきた場所を管理
    vector<int> pi(N+1,-1);
    vector<vector<int>> ps(N);
    rep(i,N){
        int l = pi[c[i]];
        // 今回の数字が二度目以降の場合
        // ペアとして管理
        if (l!=-1) ps[l].push_back(i);
        pi[c[i]] = i;
    }

    vector<vector<pair<int, int>>> qs(N);
    rep(i,Q){
        int l, r; cin >> l >> r;
        l--;
        r--;
        // l:x座標の位置、r:y座標の位置、i:クエリの番号
        qs[l].emplace_back(r,i);
    }

    // クエリの区間をl,rとし、
    // 重複している数字の最初に出てきた箇所をs
    // 次に出てきた箇所をtとする。
    // tが×(重複している)となる条件は
    // l <= sかつ t <= r;
    // ※ s,tがクエリに完全に内包されるという意味

    BIT<int> d(N);
    vector<int> ans(Q);
    // x座標(l)が大きい順に平面走査
    // lが大きい順に平面操作することで、
    // r(y軸)のみを気にすればよい。
    for (int x = N-1; x >= 0; --x){
        // 当該x座標にあるy座標を追加していく。
        // こうすることで、平面走査したときに
        // 当該座標までにある点のy座標を登録できる。
        for (int y : ps[x]) d.add(y,1);
        // 当該x座標のクエリを実行
        for (auto query : qs[x]){
            int r = query.first, i = query.second;
            // クエリの範囲にある数値の個数 - 重複分
            // d.sum(r)で、y座標がr以下のものの数を求める。
            ans[i] = (r-x+1) - d.sum(r);
        }
    }

    rep(i,Q) cout << ans[i] << endl;
}

Measured memory_bytes: 59848
#include <bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

ll gcd(ll a, ll b) { return b?gcd(b, a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a, b)*b;}
const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n; cin >> n;
  vector<int> hoge(n);
  
  rep_i(i, n){
    cin >> hoge[i];
  }
  int ma = *max_element(hoge.begin(), hoge.end());
  int mi = *min_element(hoge.begin(), hoge.end());

  int ans = 1000000000;
  for (int i = mi; i <= ma; i++){
    int a = 0;
    rep_i(f, n){
      a += (hoge[f] - i)*(hoge[f] - i);
    }
    if(a <= ans){
      ans = a;
    }
  }
  say(ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define rem(i, N, s) for(ll i{N}; i > s; i--)
using namespace std;using ll = long long int;using ld = long double;using P = pair<ll,ll>;const int MOD = (int)1e9+7;const string rt = "\n";const string sp = " ";/* 最大公約数 */template<typename T> T gcd(T a, T b){return b != 0 ? gcd(b, a % b) : a;}/* UnionFind */template<typename T> struct UnionFind{vector<T> par;UnionFind(T n) : par(n, -1){}void init(T n){par.assign(n, -1);}T root(T x){if (par[x] < 0) return x;else return par[x] = root(par[x]);}bool issame(T x, T y){return root(x) == root(y);}bool merge(T x, T y){x = root(x); y = root(y);if(x == y) return false;if(par[x] > par[y]) swap(x, y);par[x] += par[y];par[y] = x;return true;}int size(int x) {return -par[root(x)];}};/* コンビネーション */template<typename T> ll combpm(T N_, T C_) {const int NUM_=400001;static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];if (fact[0]==0) {inv[1]=fact[0]=factr[0]=1;for (int i=2;i<=NUM_;++i) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%MOD, factr[i]=factr[i-1]*inv[i]%MOD;}if(C_<0 || C_>N_) return 0;return factr[C_]*fact[N_]%MOD*factr[N_-C_]%MOD;}/* 多次元ベクター */template<class T>vector<T> mvec(size_t a){return vector<T>(a);}template<class T, class... Ts>auto mvec(size_t a, Ts... ts){return vector<decltype(mvec<T>(ts...))>(a, mvec<T>(ts...));}/* テスト関数 */void test(ll n){cout << "test" << n << endl;}/* 小数点以下 */void fixsp(ll n){cout << fixed << setprecision(n);}void defsp(ll n){cout << defaultfloat << setprecision(n);}/* 重み付きUnionFind */struct WUnionFind {vector<int> par;vector<int> rank;WUnionFind(int n = 1) {init(n);}void init(int n = 1) {par.resize(n); rank.resize(n);for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}int root(int x) {if (par[x] == x) {return x;}else {int r = root(par[x]);return par[x] = r;}}bool issame(int x, int y) {return root(x) == root(y);}bool merge(int x, int y) {x = root(x); y = root(y);if (x == y) return false;if (rank[x] < rank[y]) swap(x, y);if (rank[x] == rank[y]) ++rank[x];par[y] = x;return true;}};/* IO高速化 */void fastio(){ios::sync_with_stdio(false);cin.tie(NULL);}
/* ここからコード開始 */

int main(){
  fastio;
  ll S;
  cin >> S;
  if((ll)sqrt(S)*(ll)sqrt(S) == S){
    cout << 0 << sp << 0 << sp << (ll)sqrt(S) << sp << 0 << sp << (ll)sqrt(S) << sp << (ll)sqrt(S) << sp << rt;
    return 0;
  }
  ll a{}, b{}, x{(ll)sqrt(S+1)};
  b = min(x-1, S/x);
  while(true){
    if(a > x || b < 0){
      x++;
      a=0;
      b=min(x-1, S/x);
    }
    else if(2*x*x - x*(x-a) - x*(x-b) - a * b > S){
      if(b == floor((S-a*x)/(x-a))) b--;
      else b = floor((S-a*x)/(x-a));
    }
    else if(2*x*x - x*(x-a) - x*(x-b) - a * b < S){
      if(a == ceil((S-b*x)/(x-b))) a++;
      else a = ceil((S-b*x)/(x-b));
    }
    else if(2*x*x - x*(x-a) - x*(x-b) - a * b == S){
      cout << 0 << sp << a << sp << b << sp << 0 << sp << x << sp << x << rt;
      return 0;
    }
    //cout << 0 << sp << a << sp << b << sp << 0 << sp << x << sp << x << sp << 2*x*x - x*(x-a) - x*(x-b) - a * b << rt;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main(){
   
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<(a*b>=c*d?a*b:c*d)<<endl;
    
    
return 0;
}


Measured memory_bytes: 256
#include<iostream>
    #include<cstdio>
    #include<cstring>
    int main()
    {
    	int a,b;
    	scanf("%d%d",&a,&b);
    	if(a<=0 && b>=0)printf("Zero\n");
    	else if(a>0 || (((b-a+1)%2)==0))printf("Positive\n");
    	else printf("Negative\n");
    	return 0;
    }

Measured memory_bytes: 256
N, Y = map(int, input().split())
c = 0


for i in range(N + 1):
  for j in range(N - i + 1):
    k = N - i - j
    if i*10000 + j*5000 + k*1000 == Y:
      print(i, j, k)
      c += 1
      exit()
    
print("-1 -1 -1")

Measured memory_bytes: 9168
/*#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>

using namespace std;
# define ll long long
# define int long long  //comment it out when MLE
//# define endl "\n"
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//# define m 163577857
//# define MOD 163577857
# define pi acos(-1)
# define fi first
# define se second
#define REP(i,n) for (int i = 1; i <= n; i++)

const ll mod = 1000000007;
const int K = 2;
//typedef vector<vector<int> > matrix;
int add(int a, int b,int mod) {
    a%=mod;
    b%=mod;
	a += b;
	if (a >= mod) a -= mod;
	if(a<0)
    {
        a += mod;
        a %= mod;
    }
	return a;
}

int mul(ll a, int b,int mod) {
    a%=mod;
    b%=mod;
	a *= b;
	return a % mod;
}
int po(int a,int b,int mod)
{
    if(b==0)
        return 1;
    if(b%2==0)
        return po(mul(a,a,mod),b/2,mod);
    return mul(a,po(mul(a,a,mod),(b-1)/2,mod),mod);
}


ll fact[1000003];
ll inv[1000003];

void fact0()
{
	int i,j;
	fact[0]=1;
	for(i=1;i<=200000;i++)
	{
		fact[i]=i*fact[i-1]%mod;
	}
	inv[0]=1;
	inv[1]=1;
	ll p=mod;
	for (i=2; i<=200000; i++)
		inv[i] = (p - (p/i) * inv[p%i] % p) % p;

	for(i=2;i<=200000;i++)
	{
		inv[i]*=inv[i-1];
		inv[i]%=mod;
	}
}
set<int> v[100005];
signed main()
{
    gok
   //fact0();
   int n;
   cin>>n;
   int a[n];
   map<int,int> mp;
   for(int i=0;i<n;i++){
    cin>>a[i];
    mp[a[i]+i]++;
   }
   int an=0;
   for(int j=0;j<n;j++)
   {
       if(mp[j-a[j]]>0)
       {
           an += mp[j-a[j]];
       }
   }
   cout<<an;















    return 0;
    }


Measured memory_bytes: 32448
//Author: A_S_M_M@sud_P@rvez
#include<bits/stdc++.h>
using namespace std;
#define    MP ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define    For(i,n) for(int i=0;i<n;i++)
#define    forn(i,n) for(int i=1;i<=n;i++)
#define    fors(i,s) for(int i=0;i<s.size();i++)
#define    all(v) v.begin(),v.end()
#define    gcd(a, b) __gcd(a , b)
#define    lcm(a,b) (a*(b/__gcd(a,b)))
#define    test   int t;cin>>t;for(int l=0;l<t;l++)
#define    min3(a,b,c)     min(a,min(b,c))
#define    max3(a,b,c)     max(a,max(b,c))
#define    min4(a,b,c,d)   min(min(a,b),min(c,d))
#define    max4(a,b,c,d)   max(max(a,b),max(c,d))
#define    nl     "\n"
#define    End    return 0 
#define    gt     greater<int>()
#define    ll     long long 
#define    mp     make_pair
#define    pb     push_back
#define    vi     vector<int>
#define    vl     vector<ll>
#define    mod    1000000007
#define    sp(n)  fixed<<setprecision(n)
#define    pi     acos(-1)

int main()
{
MP;
    //test
    {
        int n,m;
        cin>>n>>m;
        int a[n];
        For(i,n)cin>>a[i];
        for(int i=m;i<n;i++){
            if(a[i-m]<a[i])cout<<"Yes"<<nl;
            else cout<<"No"<<nl;
        }
    }

End;
}


Measured memory_bytes: 4428
package main

import "fmt"

func main() {
	var H, W int
	fmt.Scan(&H, &W)

	fmt.Println(exec(H, W))
}

func exec(H, W int) int {
	if H == 1 || W == 1 {
		return 1
	}

	return (H*W + 1) / 2
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>

constexpr unsigned long int m = 1000000000ul + 7ul; //a prime modulus

unsigned long int getModInv(const unsigned long int a){
    constexpr unsigned long int p = m-2ul;
    unsigned long int mod = 1ul;
    for(int j=63; j>=0; --j){
        mod = mod*mod % m;
        if( ((p>>j)&1ul)==1ul ){
            mod = mod*a % m;
        }
    }
    return mod;
}

int main(int argc, char *argv[]){
    unsigned long int N,M,K;
    std::cin >> N >> M >> K;

    unsigned long int C=(N*M*( N*(M*M - 1ul) + M*(N*N - 1ul) ))/6ul;
    C %= m;
    unsigned long int numerator=M*N-2ul, denominator=K-2ul;
    while(denominator > 0ul){
        C *= numerator;
        C %= m;
        C *= getModInv(denominator);
        C %= m;
        --numerator;
        --denominator;
    }

    std::cout << C << std::endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    
    public void solve(){
        Scanner sc = new Scanner(System.in);
        
        int hi=sc.nextInt(); 
      
          for(int i=0;i<hi;i++){
          int x=sc.nextInt();
          int y=sc.nextInt();
          int b=sc.nextInt();
          int p=sc.nextInt();
          int kei=x*b+y*p;
              
            if(b<5){
                b=5;
            }
            if(p<2){
                p=2;
            }
            int wari=(x*b+y*p)/10*8;
        
              if(kei>wari){
                  System.out.println(wari);
              }else{
                  System.out.println(kei);
              }
          }
    }
    
    public static void main(String[] args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 23464
from collections import defaultdict

def gcd(x, y):
    r = x % y
    while r:
        x, y, r = y, r, y%r
    return y
    
def main():
    n = int(input())
    mod = 1000000007
    p = defaultdict(lambda: 0)
    bad = dict()
    zeros = 0
    for _ in range(n):
        a, b = map(int, input().split())
        if a == 0 and b == 0:
            zeros += 1
        else:
            if a == 0:
                p["0"] += 1
                bad["0"] = "INF"
            elif b == 0:
                p["INF"] += 1
                bad["INF"] = "0"
            else:
                g = gcd(b, a)
                a //= g
                b //= g
                sp = f"{a}_{b}"
                if b < 0:
                    b *= -1
                    a *= -1
                sm = f"{b}_{-a}"
                p[sp] += 1
                bad[sp] = sm
    done = set()
    good = 0
    ans = 1
    for key, num in p.items():
        if key in done:
            continue
        b = p.get(bad[key])
        done.add(bad[key])
        if b:
            ans *= pow(2, b, mod)+pow(2, num, mod)-1
            ans %= mod
        else:
            good += num
    ans *= pow(2, good, mod)
    ans += zeros
    ans -= 1
    ans %= mod
    print(ans)
        
        

if __name__ == "__main__":
    main()

Measured memory_bytes: 172928
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,c=0;
  cin>>n>>k;
  int a[n];
  map<int,int> mp;
  for(int i=0;i<n;i++){
    cin>>a[i];
    mp[a[i]]++;
  }
  vector<int> b;
  for(auto s:mp){
    b.push_back(s.second);
  }
  sort(b.begin(),b.end());
  for(int i=0;i<(int)b.size()-k;i++){
    c+=b[i];
  }
  cout<<c;
}

Measured memory_bytes: 11516
fun main(args: Array<String>) {
    val s = readLine()!!
    val t = readLine()!!
    var max = Int.MIN_VALUE
    for (i in 0 .. s.length - t.length) {
        var cnt = 0
        for (j in t.indices) {
            if (s[i+j] == t[j]) cnt++
        }
        max = Math.max(max, cnt)
    }
    println(t.length-max)
}


Measured memory_bytes: 36076
import java.util.*;
import java.io.*;
public class Main  {
    public static void main(String args[]) {
      FastScanner fs=new FastScanner();    
      PrintWriter out=new PrintWriter(System.out);
      
      double d=fs.nextDouble();
      double t=fs.nextDouble();
      double s=fs.nextDouble();
      double tt=d/s;
      if(tt<=t)
      out.println("Yes");
      else
      out.println("No");
        
        out.flush();
        out.close();
    }
	static void ruffleSort(int[] a) {
 		Random random=new Random();
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
}
        class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		
		String next() {
			while (!st.hasMoreTokens())
				try {
				st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		String nextLine(){
		    String str="";
		    try{
		        str=br.readLine();
		    }catch(IOException e){
		        e.printStackTrace(); }
		    return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		double nextDouble(){
		    return Double.parseDouble(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

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

int main(){
    int n,m;
    int L=-1,R=1000000;
    int l,r;
    cin>>n>>m;
    for(int i=0; i<m; i++){
        cin>>l>>r;
        if(L<l){
            L=l;
        }
        if(r<R){
            R=r;
        }
    }
    if(L>R){
        cout<<0<<endl;
    }else{
        cout<<R-L+1<<endl;
    }


    return 0;
}


Measured memory_bytes: 256
use proconio::input;
use proconio::marker::Usize1;

struct UnionFindTree {
    parent: Vec<usize>,
    size: Vec<usize>,
}

impl UnionFindTree {
    fn new(n: usize) -> Self {
        let parent = (0..n).collect();
        let size = vec![1; n];
        Self { parent, size }
    }

    fn find(&mut self, x: usize) -> usize {
        if self.parent[x] == x {
            x
        } else {
            self.parent[x] = self.find(self.parent[x]);
            self.size[x] = 1;
            self.parent[x]
        }
    }

    fn unite(&mut self, x: usize, y: usize) {
        let x = self.find(x);
        let y = self.find(y);
        if x == y {
            return;
        }

        // if self.size[x] < self.size[y] {
        //     std::mem::swap(&mut x, &mut y);
        // }

        self.parent[y] = x;
        self.size[x] += self.size[y];
    }
}
#[allow(non_snake_case)]
fn main() {
    input! {
        N: usize,
        M: usize,
        AB: [(Usize1, Usize1); M]
    }

    let mut uf = UnionFindTree::new(N);

    for &(a, b) in AB.iter() {
        uf.unite(a, b);
    }

    println!("{:?}", uf.size.iter().max().unwrap());
}


Measured memory_bytes: 10736
import java.util.*;

public class Main {
    public static void main(String[] args){
        
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        String T = scanner.next();
        
        if(T.contains(S) && S.charAt(0)==T.charAt(0)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }
}


Measured memory_bytes: 35668
#include<stdio.h>
int main(void){
	
	int a,b,c;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if(a<b&&b<c){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 580
using System;
class a{
  public static void Main()
        {
            string[] str = Console.ReadLine().Split(' ');
            int m = int.Parse(str[0]);
            int d = int.Parse(str[1]);
            int d10 = 0;
 
            while (d >= 10)
            {
                d -= 10;
                d10++;
            }
            int d1=d;
            int count = 0;
            for(int i = 2; i < d10; i++)
            {
                for(int j = 2; j < 10; j++)
                {
                    if (i * j <= m)
                    {
                        count++;
                    }
                    else
                    {
                      break;
                    }
                      
                }
            }
            for(int i = 2; i <= d1&&d10>1; i++)
            {
                if (i * d10 <= m)
                {
                    count++;
                }
            }
            Console.WriteLine(count);
        }
}

Measured memory_bytes: 13140
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<string>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<complex>
#include<unordered_map>
#define deg(x) cout<<#x<<"="<<x<<endl;
#define fd(x) for(int i=0;i<x;i++)
#define fdd(a,x) for(int i=a;i<x;i++)
#define fx(x,n) for(int i=n-1;i>=x;i--)
#define mst(x) memset(x,0,sizeof(x));
#define fi first
#define se second
#define TB ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define ok "ok"
#define HH puts("");
#define ls rt<<1
#define rs rt<<1|1
#define pb(a,b) a.push_back(b);
#define FIN  freopen("1.in","r",stdin);
#define FOUT freopen("1.out","w",stdout);
using namespace std;
typedef long long ll;typedef long long LL;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,int> pss;
typedef unsigned long long ull;
const ll mod=1e9+7;
const ll inf=1e9+7;
const long double eps=1e-8;
ll qpow(ll a,ll b,ll m){ ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
const double pi=acos(-1);

int hang[10],lie[10];
int n,m,k;
int ans=0;
string a[20];

int dfs2(int q){
    if(q==m){
        int sum=0;
        for(int i=0;i<n;i++){
            if(hang[i]) continue;
            for(int j=0;j<m;j++){
                if(lie[j]) continue;
                if(a[i][j]=='#') sum++;
            }
        }
//        for(int i=0;i<n;i++) cout<<hang[i];
//        cout<<'\n';
//        for(int i=0;i<m;i++) cout<<lie[i];
//        cout<<'\n';
//        deg(sum)
        if(sum==k) ans++;
        return 0;
    }
    lie[q]=0;
    dfs2(q+1);
    lie[q]=1;
    dfs2(q+1);
    return 0;
}
int dfs1(int q){
    if(q==n){
        return dfs2(0);
    }
    hang[q]=0;
    dfs1(q+1);
    hang[q]=1;
    dfs1(q+1);
    return 0;
}
int main()
{
    //TB
    mst(hang)mst(lie)
    cin>>n>>m>>k;
    fd(n) cin>>a[i];
    dfs1(0);
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    vector<int> id(101);
    int n;
    cin >> n;
    vector<pair<string, int>> a(n);
    int k = 1;
    for(auto& x : a)
        cin >> x.fi >> x.se, id[x.se] = k++;     
    sort(begin(a), end(a), [](auto& x, auto& y) {
        if(x.fi == y.fi)
            return x.se > y.se;

        for(int i = 0; i < min(x.fi.size(), y.fi.size()); ++i) {
            if(x.fi[i] == y.fi[i])
                continue;

            return x.fi[i] < y.fi[i];
        }
        return x.fi.size() < y.fi.size();
    });
    for(auto& x : a) {
        cout << id[x.se] << '\n';
    }
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int n;
    cin >> n;
    vector <int> a(2 * n);
    for (int i = 0; i < 2 * n; ++i) cin >> a[i];
    sort(a.begin(), a.end());
    int ans = 0;
    for (int i = 0; i < 2 * n; i += 2) ans += a[i];
    cout << ans << '\n';
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
using namespace std;
int main()
{    
	string a;
	cin>>a;
	for(int i=0;i<a.size();i++)
	{
		if(a[i]==a[i+1]&&a[i+1]==a[i+2]&&a[i]==a[i+2])
		{
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256