akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << x << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010

#define UNIQUE(x) sort(x.begin(),x.end());x.erase(unique(x.begin(),x.end()),x.end()); 

/* SegmentTree(Sum) */
//0-index

struct SegTree{
  typedef int Type;
  int segn2;
  Type inf;
  vector<Type> data,s_data;
  
  SegTree(int n){
    segn2=1;
    while(segn2<n) segn2*=2;
    
    data.assign(segn2*2,0);
    s_data.assign(segn2*2,0);
  }
  
  //get sum of [a,b]
  Type query(int a,int b,int l=0,int r=-1,int k=0){
    Type ret = 0;
    
    if(r==-1) r+=segn2;
    
    if(r<a || b<l) return 0;
    
    if(a<=l && r<=b) return data[k] + s_data[k]*(r-l+1);
    
    ret += (min(r,b)-max(l,a)+1) * s_data[k];
    
    ret += query(a,b,l,(l+r)/2,k*2+1)+query(a,b,(l+r)/2+1,r,k*2+2);
    return ret;
  }
  
  //add x to [a,b]
  Type add(int a,int b,Type x,int l=0,int r=-1,int k=0){
    if(r==-1) r+=segn2;
    
    if(a<=l && r<=b){
      s_data[k]+=x;
    }else if(a<=r && l<=b){
      data[k] = add(a,b,x,l,(l+r)/2,k*2+1) + add(a,b,x,(l+r)/2+1,r,k*2+2);
    }
    
    return data[k] + s_data[k]*(r-l+1);
  }
};



void calc(int n){
  int base = 20000;
  int x[SIZE],y[SIZE], a[4],b[4];
  
  vector<pair<int,pair<int,int> > > vec;
  
  for(int i=0;i<n;i++){
    scanf("%d%d",x+i,y+i);
    x[i] += base;
    y[i] += base;

    if(i > 0 && y[i-1] == y[i]){
      vec.push_back({y[i],{min(x[i-1],x[i]),max(x[i-1],x[i])}});
    }
  }

  if(y[0] == y[n-1]){
    vec.push_back({y[0],{min(x[0],x[n-1]),max(x[0],x[n-1])}});
  }

  int min_x = INF, min_y = INF, max_x = -INF, max_y = -INF;
  
  for(int i=0;i<4;i++){
    scanf("%d%d",a+i,b+i);
    a[i]+=base; b[i]+=base;
    min_x = min(min_x, a[i]);
    min_y = min(min_y, b[i]);
    max_x = max(max_x, a[i]);
    max_y = max(max_y, b[i]);
  }

  sort(vec.begin(),vec.end());
  
  SegTree seg(base*2+10);

  int t = 0;
  ll ans = 0;
  
  for(int i=0;i<=base*2+1;i++){
    
    while(t < vec.size() && vec[t].first == i){
      if(seg.query(vec[t].second.first, vec[t].second.second-1) > 0){
        seg.add(vec[t].second.first, vec[t].second.second-1,-1);
      }else{
        seg.add(vec[t].second.first, vec[t].second.second-1,1);
      }
      t++;
    }

    if(min_y <= i && i < max_y){
      ans += seg.query(0,min_x-1) + seg.query(max_x,INF);
    }else{
      ans += seg.query(0,INF);
    }
    
  }


  printf("%lld\n",ans);
  
}


int main(){
  int n;

  while(1){
    scanf("%d",&n);
    if(n == 0) break;
    calc(n);
  }
  
  
  return 0;
}

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

int main() {
  int n, h;
  cin>>n>>h;
  pair<int, int> a[n], b[n];
  for (int i=0; i<n; i++) {
    int ai, bi;
    cin>>ai>>bi;
    a[i] = make_pair(ai, i);
    b[i] = make_pair(bi, i);
  }
  sort(a, a + n);
  reverse(a, a + n);
  sort(b, b + n);
  reverse(b, b + n);

  int max_a = a[0].first;
  int cnt = 0;
  for (auto bi: b) {
    if (bi.first < max_a) {
      break;
    }
    h -= bi.first;
    ++cnt;
    if (h <= 0) {
      cout<<cnt<<endl;
      return 0;
    }
  }
  cout<<cnt + (h - 1) / max_a + 1<<endl;
}

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

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int a[210];

const ll mod=1000000007;
ll dp[210][10010];

int main(void){
	int n,w;
	cin >> n >> w;
	rep(i,n) cin >> a[i];
	sort(a,a+n);
	dp[n][0]=1;
	//  (dp[w-w1],dp[w] ]
	//  (dp[w-w2],dp[w-w1] ]  w1 is need = (dp[w-w2-w1],dp[w-w1-w1] ]
	for(int i=n;i>0;--i)rep(j,w+1){
		dp[i-1][j]+=dp[i][j],dp[i-1][j]%=mod;
		if(j+a[i-1]<=w) dp[i-1][j+a[i-1]]+=dp[i][j],dp[i-1][j+a[i-1]]%=mod;
	}
	rep(i,n) rep(j,w) dp[i][j+1]+=dp[i][j];

	ll ans=0,sum=0,cur=0,prev=0;
	rep(i,n){
		prev=cur,cur=a[i];
		if(w-prev-sum>=0) ans+=dp[i][w-prev-sum];
		if(w-cur-sum>=0) ans-=dp[i][w-cur-sum];
		ans+=mod,ans%=mod;
		sum+=a[i];
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

struct Segment {
  int64 l, r;
  Segment(int64 l, int64 r) : l(l), r(r) {}
};

template<class T> inline bool UpdateMin(T& a, T b) {
  if (a > b) { a = b; return 1; } return 0;
}

template<class T> inline bool UpdateMax(T& a, T b) {
  if (a < b) { a = b; return 1; } return 0;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int n;
  cin >> n;
  vector<Segment> segments;
  for (int i = 0; i < n; i++) {
    int64 l, r;
    cin >> l >> r;
    segments.emplace_back(l, r);
  }
  sort(
      segments.begin(), segments.end(),
      [](const Segment& s1, const Segment& s2) -> bool {
        if (s1.l != s2.l) return s1.l > s2.l;
        return s1.r > s2.r;
      });
  
  int64 ans = 0;

  // 1 + n - 1
  multiset<int64> l_set, r_set;
  for (const auto& segment : segments) {
    l_set.insert(segment.l);
    r_set.insert(segment.r);
  }

  for (const auto& segment : segments) {
    l_set.erase(l_set.find(segment.l));
    r_set.erase(r_set.find(segment.r));

    int64 l_max = *(l_set.rbegin());
    int64 r_min = *(r_set.begin());
    UpdateMax(ans, max(r_min - l_max + 1, 0LL) + (segment.r - segment.l + 1));

    l_set.insert(segment.l);
    r_set.insert(segment.r);
  }

  multiset<int64> l_set_2, r_set_2;
  for (const auto & segment : segments) {
    if (DEBUG) cout << "segment: " << segment.l << " " << segment.r << endl;
    l_set.erase(l_set.find(segment.l));
    r_set.erase(r_set.find(segment.r));

    l_set_2.insert(segment.l);
    r_set_2.insert(segment.r);

    if (l_set.empty()) break;

    int64 l_max = *(l_set.rbegin());
    int64 r_min = *(r_set.begin());
    int64 l_max_2 = *(l_set_2.rbegin());
    int64 r_min_2 = *(r_set_2.begin());
    UpdateMax(
        ans, max(r_min - l_max + 1, 0LL) + max(r_min_2 - l_max_2 + 1, 0LL));
  }
  
  cout << ans << endl;
}

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;

    // A mod B * X = C ??
    int D = A % B;

    int sum = 0;
    for (int i = 0; i < B; ++i) {
        sum += D;
        sum = sum % B;
        if (sum == C) {
            cout << "YES" << endl;
            return 0;
        }
    }

    cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<class T>
istream& operator >> (istream& is, vector<T>& v)
{
	for (auto &i : v) is >> i;
	return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& v)
{
	const string delimiter = "\n";
	REP(i, v.size())
	{
		os << v[i];
		if (i != v.size() - 1) os << delimiter;
	}
	return os;
}
/*--------------------template--------------------*/

ll comb(ll a, ll b)
{
	if (a < b) return 0;
	ld res = 1;
	REP(i, b)
	{
		res *= a - i;
		res /= i + 1;
	}
	return res;
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n, a, b;
	cin >> n >> a >> b;
	vi v(n); cin >> v;
	sort(v.rbegin(), v.rend());
	ll av = 0;
	REP(i, a) av += v[i];
	cout << av / ld(a) << endl;
	ll tar = v[a - 1];
	int cnt = count(ALL(v), tar);
	int used = 0;
	REP(i, a)
	{
		if (v[i] == tar) used++;
	}
	ll ans = 0;

	if (v[0] != tar)
	{
		ans += comb(cnt, used);
	}
	else
	{
		FOR(i, a, min(cnt, b) + 1)
		{
			ans += comb(cnt, i);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
public class Hello{
    public static void Main(){
        var array = new long[200001];
        var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var n = input[0];
        var k = input[1];
        var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var ans = 0L;
        for(var i = 0;i < n;i++){
            array[a[i]]++;
        }
        Array.Sort(array);
        for(var i = 0;i < array.Length - k;i++){
            ans += array[i];
        }
        Console.WriteLine(ans);
    }
}


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

class UnionFind {
private:
	vector<int> p, s, w;
	vector<vector<int>> h;
public:
	UnionFind(const vector<int>& v): p(v.size(), -1), s(v.size(), 1), w(v.begin(), v.end()) {}
	void wrap() {
		h.push_back({});
	}
	void unwrap() {
		int k = h.back().size();
		rep(i, k) {
			s[p[h.back()[k - 1 - i]]] -= s[h.back()[k - 1 - i]];
			w[p[h.back()[k - 1 - i]]] -= w[h.back()[k - 1 - i]];
			p[h.back()[k - 1 - i]] = -1;
		}
		h.pop_back();
	}
	int find(int a) {
		if(p[a] < 0) {
			return a;
		}
		return find(p[a]);
	}
	void unite(int a, int b) {
		a = find(a);
		b = find(b);
		if(a != b) {
			if(s[a] >= s[b]) {
				h.back().push_back(b);
				s[a] += s[b];
				w[a] += w[b];
				p[b] = a;
			}
			else {
				h.back().push_back(a);
				s[b] += s[a];
				w[b] += w[a];
				p[a] = b;
			}
		}
	}
	int get(int a) {
		return w[find(a)];
	}
};

vector<int> v;
vector<pair<int, pair<int, int>>> ed;

vector<int> dfs(int b, int e, UnionFind& uf) {
	if(b == e - 1) {
		uf.wrap();
		uf.unite(ed[b].second.first, ed[b].second.second);
		if(uf.get(ed[b].second.first) >= ed[b].first) {
			uf.unwrap();
			return {b};
		}
		else {
			uf.unwrap();
			return {};
		}
	}
	else {
		int m = (b + e) / 2;
		uf.wrap();
		for(int i = b; i < m; i++) {
			uf.unite(ed[i].second.first, ed[i].second.second);
		}
		auto r1 = dfs(m, e, uf);
		uf.unwrap();
		uf.wrap();
		for(auto i: r1) {
			uf.unite(ed[i].second.first, ed[i].second.second);
		}
		auto r2 = dfs(b, m, uf);
		uf.unwrap();
		r2.insert(r2.end(), r1.begin(), r1.end());
		return r2;
	}
}

signed main() {
	int n, m;
	cin >> n >> m;
	rep(i, n) {
		int w;
		cin >> w;
		v.push_back(w);
	}
	rep(i, m) {
		int a, b, y;
		cin >> a >> b >> y;
		ed.push_back(make_pair(y, make_pair(a - 1, b - 1)));
	}
	if(m == 0) {
		cout << 0 << endl;
		return 0;
	}
	sort(ed.begin(), ed.end());
	UnionFind uf(v);
	cout << m - dfs(0, m, uf).size() << endl;
}


Measured memory_bytes: 8300
#include <iostream>

using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) {
	if (a < b)return gcd(b, a);
	if (a%b == 0)return b;
	else return gcd(b, a%b);
}

int main() {
	ll n, tf;
	cin >> n >> tf;
	for (int i = 1; i < n; i++) {
		ll tb, g;
		cin >> tb;
		g = gcd(tf, tb);
		tf = (tf / g)*(tb / g)*g;
	}
	cout << tf << endl;
	return 0;
}

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



int main(void) {
  int n,d;
  cin >> n >> d;
  vivi a(n,vi(d));
  rep(i,n)rep(j,d){
    cin >> a[i][j];
  }
  int cnt = 0;
  rep(i,n)rep2(j,i+1,n){
    int sum = 0;
    rep(k,d){
      sum += (a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
    }
    bool ok = false;
    rep(k,10000){
      if(k*k==sum) ok = true;
    }
    if(ok) cnt++;
  }
  cout << cnt << endl;
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int n,m;
	cin>>n>>m;
	if(n>12)
		cout<<m<<endl;
	else if(n>=6) 
		cout<<m/2<<endl;
	else 
		cout<<0<<endl;
} 

Measured memory_bytes: 256
object Main extends App {

    def division_counter(n: Int, count: Int = 0): Int =
        if(n % 2 == 0) division_counter(n / 2, count + 1) else count
    
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val list = List.fill(n)(sc.nextInt)
    print(list.map(x => division_counter(x)).min)
}


Measured memory_bytes: 27344
#include<stdio.h>
#define N 100005
int search(int ,int,int *);

int main()
{
int n,A[N],q,B,found = 0,i;

scanf("%d",&n);
for(i=0;i<n;i++)
  {
scanf("%d",&A[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++)
  {
scanf("%d",&B);
if(search(B,n,A)) found++;
}
printf("%d\n",found);

return 0;
}

int search(int B,int n,int A[])
{
  int left = 0,right = n,mid;
  while(left < right )
    {
      mid = (left + right)/2;
      if(B == A[mid]) return 1;
      if(B > A[mid])
	{
	  left = mid + 1;
	}
      else if(B < A[mid])
	{
	  right = mid ;
	}
    }
  return 0;
}



Measured memory_bytes: 2104
#include<stdio.h>

int main()
{
    int A,B,C;
    scanf("%d %d", &A, &B);
    if(A>=1&&A<=9&&B>=1&&B<=9){
        C=A*B;
        printf("%d\n", C);
    }
    else{
        printf("-1\n");
    }
    return 0;
}


Measured memory_bytes: 128
import sys
N,K = map(int,input().split())
cnt_nodes = (N-1)*(N-2) // 2
if K > cnt_nodes:
	print(-1)
	sys.exit(0)
    
print((N-1)*(N) // 2 - K)
cnt = 0
for i in range(1,N):
	for j in range(i+1,N+1):
		if cnt >= (N-1)*(N) // 2 - K:
			break
		print(i,j)
		cnt += 1
	else:
		continue
	break



Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    long A, B;
    cin >> A >> B;

    long min_num = max(A, B);
    long max_num = A * B;

    long num = min_num;
    long common_multiple = 0;
    
    while(num < max_num){
        if( (num % A == 0) && (num % B == 0)){
            common_multiple = num;
            break;
        }
        num += min_num;
    }
    if(common_multiple == 0) cout << max_num << endl;
    else cout << common_multiple << endl;
    
    return 0;
}

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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

void solve(){

}

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    vector<int> cnt(N);

    ll ans = 1;
    for (int i = 0; i < N/2; i++){
        ans *= 2;
        ans %= MOD;
    }

    for (int i = 0; i < N; i++){
        cin >> a[i];
        cnt[a[i]]++;
    }

    if (N % 2 == 0){
        for (int i = 0; i < N; i++){
            if (i == 0){
                if (cnt[i] != 0){
                    ans = 0;
                }
            } else if (i % 2 == 0){
                if (cnt[i] != 0){
                    ans = 0;
                }
            } else if (i % 2 != 0){
                if (cnt[i] != 2){
                    ans = 0;
                }
            }
        }
    } else {
        for (int i = 0; i < N; i++){
            if (i == 0){
                if (cnt[i] != 1){
                    ans = 0;
                }
            } else if (i % 2 == 0){
                if (cnt[i] != 2){
                    ans = 0;
                }
            } else if (i % 2 != 0){
                if (cnt[i] != 0){
                    ans = 0;
                }
            }
        }
    }
    cout << ans << endl;

    return 0;
}


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

int main(){
  int n;
  cin >> n;
  int s=n%10;
  if(s==2||s==4||s==5||s==7||s==9) cout << "hon" << endl;
  else if(s==0||s==1||s==6||s==8) cout <<"pon" << endl;
  else if(s==3) cout <<"bon" << endl;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  
  bool ans = false;
  
  if(a < 9 && b < 9)
    ans = true;
  
  if(ans)  cout << "Yay!" << endl;
  else     cout << ":(" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
	int n,k; 
	cin>>n>>k;

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

	ll res = 1e9;
	for(int i = 0; i < n-k+1; i++){
		res = min(res, (ll)abs(arr[i]) + abs(arr[i+k-1] - arr[i]));
		res = min(res, (ll)abs(arr[i+k-1]) + abs(arr[i] - arr[i+k-1]));
	}
	 cout<<res;
}

Measured memory_bytes: 640
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
    int N, K;
    cin >> N >> K;

    if((N - 1) % (K - 1) == 0) cout << (N -1) / (K-1);
    else cout << (N - 1) / (K - 1) + 1;
    /*
    int N;
    cin >> N;
    int sum = 0;
    while( N > 0) {
        sum += N % 10;
        N /= 10;
    }
    if(N % sum == 0) cout << "Yes";
    else cout << "No";
    */
    return 0;
}


Measured memory_bytes: 256
fun main(array: Array<String>) {
    val (a, b, c) = readLine()!!.split(" ").map { it.toLong() }
    var ans: Long = a * b * c
    if(c % 2 == 1L) ans = a * b
    else ans = 0
    if(b % 2 == 1L) {
        if(a * c < ans) ans = a * c
    }
    else ans = 0
    if(a % 2 == 1L) {
        if(b * c < ans) ans = b * c
    }
    else ans = 0
    print(ans)
}

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

using namespace std;
using ll = long long;
const ll MOD = 1000000007;

int main() {
  ll N, S{}, S2{}, A;
  cin >> N;
  while(cin >> A) {
    S = (S + A)%(MOD*2);
    S2 = (S2 + A * A)%(MOD*2);
  }
  ll ans = ((S*S) - S2)%(MOD*2)/2;
  cout << ans << endl;
}


Measured memory_bytes: 3584
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>

using namespace std;

int main() {
	int i, j, k;
	int n, q;
	//vector<vector<short>>(1, vector<short>(1));
	vector<set<short>>num;
	vector<short>flag(10007, -1);
	int cnt = 0;
	vector<short>ans;

	cin >> n >> q;

	for (i = 0; i < q; i++) {
		short com, x, y;

		cin >> com >> x >> y;

		//x--; y--;

		if (com == 0) {
			if (flag[x] == -1 && flag[y] == -1) {
				set<short>st;

				st.insert(x);
				st.insert(y);
				num.push_back(st);
				flag[x] = num.size()-1;
				flag[y] = num.size()-1;

			}
			else if (flag[x] != -1 && flag[y] != -1) {
				if (flag[x] == flag[y]) {

				}
				else if (flag[x] < flag[y]) {
					short yy = flag[y];
					//for (auto itr = num[flag[y]].begin(); itr != num[flag[y]].end(); ++itr) {
					for (auto itr = num[yy].begin(); itr != num[yy].end(); ++itr) {
						num[flag[x]].insert(*itr);
						flag[*itr] = flag[x];
					}
				
				//	num.erase(num.begin() + yy);
					num[yy].erase(num[yy].begin(), num[yy].end());

				}
				else if (flag[x] > flag[y]) {
					short xx = flag[x];
					//for (auto itr = num[flag[x]].begin(); itr != num[flag[x]].end(); ++itr) {
					for (auto itr = num[xx].begin(); itr != num[xx].end(); ++itr) {
						num[flag[y]].insert(*itr);
						flag[*itr] = flag[y];
					}
					
				//	num.erase(num.begin() + xx);
					num[xx].erase(num[xx].begin(), num[xx].end());
				
				}

			}
			else if (flag[x] != -1) {
				num[flag[x]].insert(y);
				flag[y] = flag[x];
			}
			else if (flag[y] != -1) {
				num[flag[y]].insert(x);
				flag[x] = flag[y];
			}
		}
		else if (com == 1) {
			if (flag[x] == flag[y] && flag[x] != -1) {
				//cout << 1 << endl;
				ans.push_back(1);
			}
			else {
				//cout << 0 << endl;
				ans.push_back(0);
			}
		}
	}


	for (i = 0; i < ans.size(); i++) {
		cout << ans[i] << endl;
	}




	getchar();
	getchar();
	return 0;
}


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

using namespace std;

#define pii pair<int,int>
#define ll long long
#define s second
#define f first

const int MAX_N=2*10e3+5;
ll n,k,x,y,d[MAX_N],ans[MAX_N];
vector<int> g[MAX_N];
queue<int> q;

int main(){
  cin >> n >> x >> y;
  for(int i=0;i<n-1;++i){
    g[i].push_back(i+1);
    g[i+1].push_back(i);
  }
  g[x-1].push_back(y-1);
  g[y-1].push_back(x-1);
  for(int i=0;i<n;++i){
    queue<int> q;
    memset(d,0,MAX_N);
    q.push(i);
    while(!q.empty()){
        x=q.front();
        q.pop();
        for(auto u:g[x]){
            if(!d[u] && u!=i){
                d[u]=d[x]+1;
                ++ans[d[u]];
                q.push(u);
            }
        }
    }
  }
  for(int i=1;i<n;++i){
    cout << ans[i]/2 << endl;
  }
  return 0;
}


Measured memory_bytes: 768
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var input = int.Parse(Console.ReadLine());
        var arrayList = new List<int[]>();
        var array = new int[10] { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
        long oldNum = 9;

        var list = new List<long>() { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

        if (input < 10)
        {
            Console.WriteLine(input);
            return;
        }

        input -= 9;


        while (true)
        {
            var newList = new List<long>();
            foreach (var n in list)
            {
                if (n % 10 == 0)
                {
                    newList.Add(n * 10);
                    newList.Add(n * 10 + 1);
                }
                else if (n % 10 == 9)

                {
                    newList.Add(n * 10 + 8);
                    newList.Add(n * 10 + 9);
                }
                else
                {
                    newList.Add(n * 10 + (n % 10) - 1);
                    newList.Add(n * 10 + (n % 10));
                    newList.Add(n * 10 + (n % 10) + 1);
                }
            }

            if(input > newList.Count)
            {
                input -= newList.Count;
                list = newList;
            }
            else
            {
                Console.WriteLine(newList[input - 1]);
                break;
            }
        }

        Console.ReadKey();
    }
}



Measured memory_bytes: 16608
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
    char b;
    cin >> b;
	
  	if(b == 'A')
  		cout << 'T' << endl;
  	if(b == 'T')
  		cout << 'A' << endl;    
  	if(b == 'C')
  		cout << 'G' << endl;
  	if(b == 'G')
  		cout << 'C' << endl;  
    return 0;
}


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

int main(){
  int x, y;
  cin >> x >> y;
  
  if (x < 10 && x > 0 && y < 10 && y > 0){
    cout << x * y << endl;
  }
  else {
    cout << -1 << endl;
  }
}

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

int main() {
  int n,m;cin>>n>>m;
  vi parent[n], child[n];
  vi n_parent(n,0);
  int a,b;
  rep(i,n-1+m) {
    cin>>a>>b;
    a--;b--;
    child[a].push_back(b);
    parent[b].push_back(a);
    n_parent[b]++;
  }
  
  int root;
  rep(i,n) {
    if (parent[i].size() == 0) {
      root = i;
      break;
    }
  }
  
  vi ans(n,-1);
  queue<int> q;
  q.push(root);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int c: child[x]) {
      if (n_parent[c]==1) {
        
        ans[c]=x;
        q.push(c);
      } else {
        n_parent[c]--;
      }
    }
  }
  rep(i,n) cout<<(ans[i]+1)<<endl;
}


Measured memory_bytes: 14796
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=a+b+c
n=int(input())
ans='No'
for _ in range(n):
  s=int(input())
  x=['x' if i==s else i for i in x]
if x[0]==x[3]==x[6]=='x':ans='Yes'
elif x[1]==x[4]==x[7]=='x':ans='Yes'
elif x[2]==x[5]==x[8]=='x':ans='Yes'
elif x[0]==x[1]==x[2]=='x':ans='Yes'
elif x[3]==x[4]==x[5]=='x':ans='Yes'
elif x[6]==x[7]==x[8]=='x':ans='Yes'
elif x[0]==x[4]==x[8]=='x':ans='Yes'
elif x[2]==x[4]==x[6]=='x':ans='Yes'
print(ans)


Measured memory_bytes: 9204
def resolve():
    A, B, C, D = list(input())
    OP = ("+", "-")
    for i in range(2**3):
        op = ["+" for _ in range(3)]
        for j in range(3):
            if (i >> j) & 1:
                op[j] = OP[0]
            else:
                op[j] = OP[1]
        if eval(A + op[0] + B + op[1] + C + op[2] + D) == 7:
            print(A + op[0] + B + op[1] + C + op[2] + D + "=7")
            return

resolve()


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

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)

const int MOD = 1e+9 + 7;

template <typename T>
T pow_mod(T n, T p, T m)
{
    if(p == 0) return 1;
    if(p%2 == 1) return pow_mod<T>(n, p-1, m) * n % m;
    else{
        T tmp = pow_mod<T>(n, p/2, m) % m;
        return tmp * tmp % m;
    }
}

int main()
{
    int N;
    cin >> N;
    vector<long long> C(N);
    REP(i, N) cin >> C[i];

    sort(C.begin(), C.end());  // コストの小さい順に変更していくのが最適

    long long ans = 0;
    REP(i, N){
        long long before_cases = pow_mod<long long>(2, 2*i, MOD);
        long long after_cases  = pow_mod<long long>(2, 2*N-2*i-2, MOD) * (N-i+1) % MOD;
        ans += before_cases * C[i] % MOD * after_cases % MOD;
        ans %= MOD;
    }    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
package main

import (
	"fmt"
	"sort"
)

func main() {
	a := make([]int, 3)
	for i := 0; i < 3; i++ {
		fmt.Scan(&a[i])
	}
	sort.Ints(a)
	fmt.Println(10*a[2] + a[1] + a[0])
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> a(4);
  for(int i=0;i<4;i++)cin>>a.at(i);
  sort(a.begin(),a.end());
  if(a.at(0)==1&&a.at(1)==4&&a.at(2)==7&&a.at(3)==9)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] al = new long[n];
        long[] cl = new long[n+1];
        long total = 0;
        for(int i = 0; i < n; i++){
            int a = sc.nextInt();
            al[i] = a;
            cl[a]++;
        }
        for(int i = 1; i < n+1; i++){
            total += cl[i] * (cl[i]-1) / 2;
        }
        for(long a : al){
            System.out.println(total - cl[(int)a]+1);
        }
    }
}

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , "; logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 100005;

/* ...o(^-^)o... */


struct union_find{
    vector<int> par;
    vector<int> rank;
    vector<int> size;
    union_find(int n) : par(n), rank(n), size(n){
        for(int i = 0; i < n; i++){
            par[i] = i; rank[i] = 0; size[i] = 1;
        }
    }
    int root (int x){
        if(par[x] == x) return x;
        par[x] = root(par[x]);
        return par[x];
    }
    void unite(int x, int y){
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        if (rank[rx] < rank[ry]){
            par[rx] = ry;
            size[ry] += size[rx];
        }
        else{
            par[ry] = rx;
            if (rank[rx] == rank[ry]) rank[rx]++;
            size[rx] += size[ry];
        }
    }
    bool same(int x, int y){
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main(){
    int n, m; cin >> n >> m;
    vector<lint> a(n); rep(i, n) cin >> a[i];

    union_find uf(n);
    rep(i, m){
        int a, b; cin >> a >> b;
        uf.unite(a, b);
    }

    if(m == n-1){
        out(0); return 0;
    }
    if(2*(n-m-1) > n){
        out("Impossible"); return 0;
    }

    vector<vector<lint>> c(n);
    vector<int> r;
    rep(i, n){
        int p = uf.root(i);
        if(p == i) r.push_back(i);
        c[p].push_back(a[i]);
    }

    lint res = 0;
    priority_queue<P, vector<P>, greater<P>> pq;
    rep(i, r.size()){
        sort(all(c[r[i]])); res += c[r[i]][0];
        if(c[r[i]].size() > 1) pq.push(P(c[r[i]][1], r[i]));
    }

    vector<int> where(n, 1);
    int k = n-m-2;
    rep(_, k){
        P p = pq.top(); pq.pop();
        res += p.fi;
        where[p.se]++;
        if(c[p.se].size() > where[p.se]) pq.push(P(c[p.se][where[p.se]], p.se));
    }
    out(res);
}


Measured memory_bytes: 7548
#!/usr/bin/env python3
import heapq
n,m = map(int,input().split())
a = [-int(_) for _ in input().split()]
heapq.heapify(a)
ans = 0
for _ in range(m):
    min_ = heapq.heappop(a)
    min_ /= 2
    heapq.heappush(a,min_)
print(-sum(int(i) for i in a))

Measured memory_bytes: 92952
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  string s = "111";
  for(int i=0;i<3;i++){
    cin >> s.at(i);
  }
  int num = stoi(s);
  
  if(num % 4 == 0){
    cout << "YES"<<endl;
  }else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define int long long
using namespace std;

int k,q,d[5010],num[5010];

signed main()
{
	ios::sync_with_stdio(false);
	cin>>k>>q;
	for(int i=0;i<k;i++) cin>>d[i];
	while(q--){
		int n,x,m;
		cin>>n>>x>>m;
		for(int i=0;i<k;i++){
			num[i]=(n-1ll)/k+(((n-1ll)%k)>i);
		}
		int equal=0ll,large=0ll;
		for(int i=0;i<k;i++){
			if(d[i]%m==0ll) equal+=num[i];
		}
		int val=x%m;
		for(int i=0;i<k;i++){
			val+=(d[i]%m)*num[i];
		}
		large=val/m;
		cout<<n-1ll-equal-large<<endl;
	} 
	return 0;
}

Measured memory_bytes: 512
x, y = map(int, input().split())

gr1=[1,3,5,7,8,10,12]
gr2=[4,6,9,11]
gr3=[2]

if x in gr1 and y in gr1:
    print('Yes')
elif x in gr2 and y in gr2:
    print('Yes')
elif x in gr3 and y in gr3:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9012
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
struct strview {
    const char *ptr;
    int sz;
    strview(const char* p, int s) : ptr(p), sz(s) {}
    const char& operator[](int x) { return ptr[x]; }
    int size() { return sz; }
    strview substr(int pos, int count) { return strview(ptr+pos, count); }
};
int main()
{
    string A; cin >> A;
    strview s(A.c_str(), A.size());
    string ans;
    for (;;) {
        int counter = 0, letters = 0;
        for (int i = s.size()-1; i >= 0; i--) {
            letters |= 1 << (s[i]-'a');
            if (letters == (1 << 26)-1) {
                counter++;
                letters = 0;
            }
        }
        for (int i = 0; i < 26; i++) {
            if (!(letters & (1 << i))) {
                ans.push_back('a' + i);
                break;
            }
        }
        if (counter == 0) break;
        for (int i = 0; i < s.size(); i++) {
            if (s[i] == ans.back()) {
                s = strview(&s[i+1], s.size() - i - 1);
                break;
            }
        }
    }
    cout << ans << '\n';
    return 0;
}


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

using namespace std;

/********** TEMPLATE STARTS HERE ***********/

#define IOS ios::sync_with_stdio(false), cin.tie(0);
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back
#define test int t; cin >> t; while(t--)
#define skip continue
#define stop break
#define sz(v) v.size()
#define endl '\n'
#define PI 3.1415926535897932384626433832795
#define EPS 1e-9
#define FR(i, a, b) for(int i = a; i <= b; i++)
#define gcd __gcd 
#define FR(i, l, r) for(int i = (l); i <= (r); i++)
#define debug(a) cout << #a << ": " << a << endl
#define debug1(a, l, r) FR(i, l, r) cout << a[i] << " "; cout << endl
	
	
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <pii> vii;
typedef vector <pll> vll;

const int INF = 0x3f3f3f3f;
const int LINF = 0x3f3f3f3f3f3f3f3f;

template <typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template <typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }


/*********** TEMPLATE ENDS HERE *************/

main()
{
	int a, b;
	cin >> a >> b;
	cout << a * b - a - b + 1;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll p = 1e9+7;

ll llpowmod(ll a,ll e){
  if(e==0){
    return 1LL;
  }
  if(e%2==0){
    ll ret=llpowmod(a,e/2);
    ret%=p;
    return (ret*ret)%p;
  }else{
    ll ret=llpowmod(a,e-1)*a;
    ret%=p;
    return ret%p;
  }
}
int main(){
  ll n;
  cin>>n;
  ll ans=(llpowmod(10LL,n)-2*llpowmod(9LL,n)+llpowmod(8LL,n));
  ans%=p;
  ans=(ans+p)%p;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;

int main() {
    ll k;
    cin >> k;
    ll a = 0;
    for(int i = 0; i < k; i++) {
        a = (a * 10 + 7) % k;
        if(a == 0) {
            cout << i + 1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <cmath>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
using ull =unsigned long long;
const ll INF =1001001001;

//10億7。　　　100000007

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}


int main(){
cout<<fixed<<setprecision(10);
//cin.tie(0); ios::sync_with_stdio(false);

string S;
  
 cin>>S;
  vsort(S);
  //cout<<S<<endl;
  bool isOK=true;
  for(int i=0;i<S.size();i++){
    if(S[i]==S[i+1]){
      isOK=false;
      break;
    }
  }
  
  if(isOK){
    cout<<"yes"<<endl;
  }else{
    cout<<"no"<<endl;
  }
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <list>
#include <iomanip>
#include <queue>
#include <cmath>
#include <numeric>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)

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; }
const long long mod = 1e9 + 7;


int main() {

	ll N, K;
	cin >> N >> K;

	vector<ll> A(N), B(2001, 0);
	ll x = 0, y = 0;

	rep(i, N) {
		cin >> A[i];
		rep(j, i) {
			if (A[i] < A[j]) {
				x++;
			}
		}
	}

	rep(i, N) {
		rep(j, N) {
			if (A[i] < A[j]) {
				y++;
			}
		}
	}


	ll z;

	z = K * (K - 1) / 2 % mod;

	ll ans, tmp;

	ans = x * K % mod;

	tmp = (y * z) % mod;

	ans = (ans + tmp) % mod;

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3616
#pragma GCC optimize("Ofast")

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pop_b pop_back
#define pf push_front
#define pop_f pop_front
#define mt make_tuple
#define eb emplace_back
#define sf(x) sizeof(x)
#define len(x) x.length()
#define sz(x) x.size()
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef long double ld; 
typedef vector<int> vi;
typedef vector<set<ll>> vset;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef deque<ll> dql;
typedef deque<int> dqi;
typedef unsigned long long ull;
typedef tuple<int,int,int> State;

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << ", ";
	err(++it, args...);
	cout<<"\n";
}

#define vmax(type)   std::numeric_limits<type>::max()
#define vmin(type)   std::numeric_limits<type>::min()
#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define cinai(a, n) vi a(n); rep(i, n) { cin>>a[i]; }
#define cinal(a, n) vl a(n); rep(i, n) { cin>>a[i]; }
#define coutai(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define coutal(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define ent cout<<endl;
#define resize_vec(a) a.resize(unique(a.begin(), a.end()) - a.begin());
#define ms(dp, x) memset(dp, x, sf(dp))
#define endl '\n'

ll powm(ll a, ll b, ll mod) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}

const ll mod = 1e9 + 7;
const ll N = 1000005;
const ll inf = 1e9;

void solve()
{
	ll d, t, s;
	cin>>d>>t>>s;
	cout<<(d <= t*s ? "Yes\n" : "No\n");
}

// #define _DEBUG 
// #define testCases
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	cout << fixed << setprecision(15);
	
	int tc = 1;
#ifdef testCases
	cin>>tc;
#endif
	while(tc--)
	{
#ifdef _DEBUG
	int tt = clock();
#endif
		solve();
		
#ifdef _DEBUG
		cerr << "TIME = " << clock() - tt << endl;
		tt = clock();
#endif
	}
	return 0;
}



Measured memory_bytes: 3648
#ifdef __APPLE__
#include <iostream>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <iomanip>
#include <cmath>
#include <ctgmath>
#include <math.h>
#else
#include <bits/stdc++.h>
#endif

using namespace std;
#define io ios_base::sync_with_stdio(false), cin.tie(NULL)
#define GFOR(i,a,n) for (i=a;i<n;i++)
#define FOR(i,a,n) for (int i=a;i<n;i++)
#define RFOR(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define tc(t) for (int tc=1; tc<=t; tc++)
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long long int> VLL;
typedef vector<pair<int, int> > VPI;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll, ll> PLL;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
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;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll modInverse (ll a) {ll p = mod - 2; return powmod(a, p);}
// head

int main() {
    io;
    int a, v, b, w;
    cin >> a >> v >> b >> w;
    int t;
    cin >> t;
    if (v == w) {
            if (a == b)
                goto good;
            else
                goto bad;
    } else if (w > v) {
        goto bad;
    } else {
        if (ceil((abs(a-b))/(long double)(v-w)) > t) {
            goto bad;
        } else {
            goto good;
        }
    }

    good: cout << "YES" << "\n";
    return 0;
    bad: cout << "NO" << "\n";
}
//check for edge cases in limits
//printing double may print 1.223232e9 like values, beware of that


Measured memory_bytes: 3684
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

const ll MAX=500000;
const ll INFTY=1000000010;

ll L[MAX/2+2],R[MAX/2+2];

ll merge(int A[], int left, int mid ,int right){
  int n1=mid-left;
  int n2=right-mid;
  ll cnt=0;
  rep(i,n1) L[i]=A[left+i];
  rep(i,n2) R[i]=A[mid+i];
  L[n1]=INFTY;
  R[n2]=INFTY;
  int i=0,j=0;
  for(int k=left;k<right;k++){
    if(L[i]<=R[j]) A[k]=L[i++];
    else{
      A[k]=R[j++];
      cnt+=n1-i;
    }
  }
  return cnt;
}

ll mergeSort(int A[],int left,int right){
  int mid;
  ll v1,v2,v3;
  if(left+1<right){
    mid=(left + right)/2;
    v1=mergeSort(A,left,mid);
    v2=mergeSort(A,mid,right);
    v3=merge(A,left,mid,right);
    return v1+v2+v3;
  }else return 0;
}

int main() {
  int n;
  cin>>n;
  
  int A[MAX];
  rep(i,n) cin>>A[i];
  
  ll ans=mergeSort(A,0,n);
  cout<<ans<<endl;
 
  return 0;
}


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

int main()
{
    ll n;
    ll x[100];
    cin >> n;
    ll min = 100;
    ll max = 0;
    for (ll i = 0; i < n;i++)
    {
        cin >> x[i];
        if (min > x[i])
            min = x[i];
        if (max < x[i])
            max = x[i];
    }   
    ll ans = 1e+9;
    for (ll i = min; i <= max;i++)
    {
        ll sum = 0;
        for (ll j = 0; j < n;j++)
        {
            sum += (x[j] - i) * (x[j] - i);
        }
        //cout << sum << endl;
        if(ans > sum)
            ans = sum;
    }
    cout << ans;
}

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

int main(){
    int h,w,n;
    cin >> h >> w >> n;
    int x;
    if(h>w){
        x=h;
    }else{
        x=w;
    }
    if(n%x==0){
        cout << n/x << endl;
    }else{
        cout << (n/x)+1 << endl;
    }
}

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

using namespace std;

typedef long long ll;

const int INF = 1000000000;

int dfs(int u, int t, vector<vector<int> >& adj, vector<int>& d,
        vector<int>& low, vector<int>& parent)
{
  ++t;
  d[u] = low[u] = t;
  int ret = 0;
  for (int v : adj[u]) {
    if (d[v] == -1) {
      parent[v] = u;
      ret += dfs(v, t, adj, d, low, parent);
      low[u] = min(low[u], low[v]);
      if (d[u] < low[v]) { ++ret; }
    }
    else {
      if (v != parent[u]) {
        // back edge
        low[u] = min(low[u], d[v]);
      }
    }
  }
  return ret;
}

int main()
{
  int N, M; scanf("%d %d", &N, &M);
  vector<vector<int>> adj(N + 5, vector<int>());
  for (int i = 0; i < M; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
  }

  vector<int> d(N + 5, -1), low(N + 5), parent(N + 5, -1);
  int ans = dfs(1, 0, adj, d, low, parent);
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    string s; cin>>s;
    int n = s.size();

    vector<vector<ll>> dp(n+1, vector<ll>(2, 0));
    // dp[i][j] := 上から i 桁目までを確定、j = 1 のとき L 未満である
    dp[0][0] = 1;

    for(int i=0; i<n; i++){
        if(s[i] == '0'){
            // (0, 0)
            dp[i+1][0] += dp[i][0];
        }
        else{
            // (0, 1) or (1, 0)
            dp[i+1][0] += dp[i][0] * 2;

            // L 未満にする (0, 0)
            dp[i+1][1] += dp[i][0];
        }

        // 既に L 未満のとき、全ての遷移を許容 (0, 0) or (0, 1) or (1, 0)
        dp[i+1][1] += dp[i][1] * 3;

        dp[i+1][0] %= MOD;
        dp[i+1][1] %= MOD;
    }

    cout << (dp[n][0] + dp[n][1]) % MOD << endl;

    return 0;
}

Measured memory_bytes: 5840
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T, class T2> void smin(T& a, T2 val) {if (a > val) a = val;}template<class T, class T2> void smax(T& a, T2 val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

void yes(){
   cout<<"Yes"<<endl;
   //exit (0);
}
void no(){
   cout<<"No"<<endl;
   //exit (0);   
}

int n, m;
string s, t;

int32_t main(){_
      
   cin >> n;
   int mult = (n + 999) / 1000;
   mult *= 1000;

   cout<<mult-n;
   

   return 0;
}

Measured memory_bytes: 3648