akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string s;
  cin >> s;
  
  if (s[0] == s[1] && s[1] == s[2]) cout << "No\n";
  else cout << "Yes\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define endl '\n'
#define MP make_pair
#define pb push_back

using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> i_P;
typedef long long LL;

static const int INF = INT_MAX;
static const LL L_INF = LLONG_MAX;
static const int MOD = (1000000000 + 7);

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

    int n;
    cin >> n;
    P m = MP( 1, INF );

    for( int i = 0; i < n; ++i ) {
        int a, b;
        cin >> a >> b;
        if( m.S > b ) m = MP( a, b );
    }

    cout << m.F + m.S << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define rep(i,j,k) for(int i=j;i<k;i++)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
#define mp make_pair
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
const int  COMMAX = 510000;

long long fac[COMMAX], finv[COMMAX], inv[COMMAX];

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcd(int a,int b){return a*b / gcd(a,b);}
// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < COMMAX; i++){
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

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

struct UnionFind {
  vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
  vector<int> rank;
  int num;
  UnionFind(int N) : par(N) , rank(N) { //最初は全てが根であるとして初期化
    num = N;
    for(int i = 0; i < N; i++){
      par[i] = i;
      rank[i] = 0;
    }
  }

  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
    if(rank[rx] < rank[ry]){
      par[rx] = ry;  
    }else{
      par[ry] = rx;
      if(rank[rx] == rank[ry])rank[rx]++;
    }
    num--;
  }

  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    return root(x) == root(y);
  }
};

const int MS = 2;
const long long mod[] = {999999937LL, 1000000007LL}, base = 9973;
struct rolling_hash {
    int n;
    vector<long long> hs[MS], pw[MS];
    rolling_hash(){}
    rolling_hash(const string &s) {
        n = s.size();
        for (int i = 0; i < MS; i++) {
            hs[i].assign(n+1,0);
            pw[i].assign(n+1,0);
            hs[i][0] = 0;
            pw[i][0] = 1;
            for (int j = 0; j < n; j++) {
                pw[i][j+1] = pw[i][j]*base%mod[i];
                hs[i][j+1] = (hs[i][j]*base+s[j])%mod[i];
            }
        }
    }

    long long hash(int l, int r, int i) { return ((hs[i][r]-hs[i][l]*pw[i][r-l])%mod[i]+mod[i])%mod[i]; }

    bool match(int l1, int r1, int l2, int r2) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l1,r1,i)==hash(l2,r2,i);
        return ret;
    }

    bool match(int l, int r, long long h[]) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l,r,i)==h[i];
        return ret;
    }
};

int main(){
  int k,x;
  cin >> k >> x;
  cout << (500*k >= x?"Yes":"No") << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
double x[3],y[3];
bool isin(double px,double py){
    bool ok=true;
        for(int i=0;i<3;i++){
            bool plus=false;
            if(x[(i+1)%3]==x[(i+2)%3]){
                if(x[i]>x[(i+1)%3])plus=true;
            }
            else{
                double a,b;
                a=(x[i]-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
                b=(y[i]-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
                if(a>b)plus=true;
            }
            bool pnt=false;
            if(x[(i+1)%3]==x[(i+2)%3]){
                if(px>x[(i+1)%3])pnt=true;
            }
            else{
                double a,b;
                a=(px-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
                b=(py-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
                if(a>b)pnt=true;
            }
            if(pnt!=plus)ok=false;
        }
        if(ok)return true;
        else return false;
}
int main(){
	char z;
	double xx[4],yy[4];
	while(cin>>xx[0]>>z>>yy[0]){
		for(int i=1;i<4;i++)cin>>z>>xx[i]>>z>>yy[i];
		bool ok=true;
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++)x[j]=xx[j],y[j]=yy[j];
			if(isin(xx[3],yy[3]))ok=false;
			double kx=xx[3],ky=yy[3];
			for(int j=0;j<3;j++)xx[j+1]=x[j],yy[j+1]=y[j];
			xx[0]=kx,yy[0]=ky;
		}
		if(ok)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1216
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<queue>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	ll N, A;
	cin >> N >> A;
	ll ans = N;
	for (int k = 2; k < 40; k++) {
		ll low = 1, high = sqrt(N)+1;
		while (high-low > 1) {
			const ll med = (low+high)/2;
			ll now = 1;
			for (int i = 0; i < k; i++) {
				now *= med;
				if (now > N) break;
			}
			if (now >= N) high = med;
			else low = med;
		}
		int maxi = 0;
		for (int i = 1; i <= k; i++) {
			ll now = 1;
			for (int j = 0; j < i; j++) {
				if (now > N) break;
				now *= (high-1);
			}
			for (int j = i; j < k; j++) {
				if (now > N) break;
				now *= high;
			}
			if (now >= N) maxi = max(maxi, i);
		}
		ll tmp = (k-1) * A + (high-1)*maxi + high*(k-maxi);
		ans = min(ans, tmp);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

using Graph=vector<vector<int>>;
Graph G;
ll solve(ll n){
  if(n%2==1) return 0;
  ll res=0;
  n/=2;
  while(n){
    res+=n/5;
    n/=5;
  }
  return res;
}
int main(){
  int n;
  cin >> n;
  rep(i,n+1){
    int tax=floor((double)i*1.08);
    if(tax==n){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<":("<<endl;
 
}
    


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m=numeric_limits<T>::max()){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  int N; cin >>N;
  vector<ll> a(N); rep(i, N) cin >>a[i];
  ll sum = 0;
  rep(i, N) sum ^= a[i];
  rep(i, N){
    ll res = sum ^ a[i];
    cout <<res <<endl;
  }

}
/*

1 2 3 4 5

  2 3 4
1   3 4
1 2   4
1 2 3  

*/


Measured memory_bytes: 4836
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[10],vis[10],flag;
int main()
{
    int i,j,k,n,s;
    scanf("%d",&n);
    a[1]=n/1000;
    a[2]=(n/100)%10;
    a[3]=(n/10)%10;
    a[4]=n%10;
    flag=0;
    for(i=0;i<(1<<3);i++)
    {
        j=i;
        k=1;
        memset(vis,0,sizeof(vis));
        s=a[1];
        while(j>0)
        {
            if(j%2)
            vis[k]=1;
            j=j/2;
            k++;
        }
        for(k=1;k<=3;k++)
        if(vis[k]==0)
        s=s+a[k+1];
        else
        s=s-a[k+1];
        if(s==7)
        break;
    }
    printf("%d",a[1]);
    if(vis[1]==0)
    printf("+");
    else
    printf("-");
    printf("%d",a[2]);
    if(vis[2]==0)
    printf("+");
    else
    printf("-");
    printf("%d",a[3]);
    if(vis[3]==0)
    printf("+");
    else
    printf("-");
    printf("%d=7\n",a[4]);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <deque>
#include <set>
#include <map>
#include <queue>
using namespace std;

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

    if(B == 1)
    {
        cout << 0;
        return 0;
    }
    if(B < A)
    {
        cout << 1;
        return 0;
    }
    int num = ceill((B - A) / (double)(A - 1)) + 1;

    cout << num;
}


Measured memory_bytes: 888
n = int(input())
a = list(map(lambda x: int(x)-1, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

res = b[a[0]]
for i in range(1, n):
    res += b[a[i]]
    if a[i-1]+1 == a[i]:
        res += c[a[i-1]]
print(res)


Measured memory_bytes: 3064
import sys

n, q = map(int, sys.stdin.readline().split())
g = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, sys.stdin.readline().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)
xs = [0 for _ in range(n)]
for i in range(q):
    p, x = map(int, sys.stdin.readline().split())
    p -= 1
    xs[p] += x

visited = [False for _ in range(n)]
# def rec(prev_v, v, value):
#     if visited[v]:
#         return
#     visited[v] = True
#     next_value = value + xs[v]
#     costs[v] = next_value
#     for next_v in g[v]:
#         if next_v == prev_v:
#             continue
#         rec(v, next_v, next_value)
# rec(-1, 0, 0)

current_node = [0]
while len(current_node) > 0:
    next_node = []
    for v in current_node:
        visited[v] = True
        for next_v in g[v]:
            if visited[next_v]:
                continue
            next_node.append(next_v)
            xs[next_v] += xs[v]
    current_node = next_node

print(' '.join(map(str, xs)))


Measured memory_bytes: 66836
import itertools
n, m = map(int, input().split())
ks = []
for i in range(m):
    ks.append(list(map(int, input().split())))
p = list(map(int, input().split()))

ans = 0
for si in itertools.product([0, 1], repeat=n):
    ok = True
    for mi in range(m):
        s_on = 0
        for k in range(ks[mi][0]):
            s_on += si[ks[mi][1 + k] - 1]
        if s_on % 2 != p[mi]:
            ok = False
            break
    if ok:
        ans += 1

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int signed long long int
#define lli int
void solve(){
  int N;
  cin>>N;
  int ans =0 ;
  for(int A = 1; A<=N;A++){
    ans+= (N-1)/A;
  }
  cout<<ans<<endl;
}
signed main(){
  solve();
}


Measured memory_bytes: 3592
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<deque>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
const int Nmax=200000;
int N;
ll A[Nmax];

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

	deque<ll> deq;
	for(int i=0; i<N; i++){
		if(i%2==1){
			deq.push_back(A[i]);
		}
		else{
			deq.push_front(A[i]);
		}
	}

	if(N%2==0){
		reverse(deq.begin(), deq.end());
	}

	for(int i=0; i<N; i++){
		cout << deq[i] << (i==N-1 ? '\n' : ' ');
	}
	cout << flush;

	return 0;
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
bool out[200050],in[200050];
int a,b;
int n,m;
int main() {
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++) {
		scanf("%d%d",&a,&b);
		if(a==1)
			out[b]=1;
		if(b==n)
			in[a]=1;
	}
	out[1]=1;
	in[n]=1;
	for(int i=2;i<n;i++) {
		if(out[i]&&in[i]) {
			puts("POSSIBLE");
			return 0;
		}
	} 
	puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 640
N, T = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(N)]


AB.sort(reverse = True)
DP = [[0] * T for _ in range(N)]
DP[0][0] = AB[0][1]
for i in range(1, N):
  a, b = AB[i]
  DP[i][0] = max(DP[i - 1][0], b)
  for j in range(T):
    DP[i][j] = max(DP[i][j], DP[i - 1][j])
    if j + a < T:
      DP[i][j + a] = DP[i - 1][j] + b

print(max(DP[-1]))
      


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

int main() {
	int N;
	cin >> N;
	string S;
	cin >> S;
	int ans = 0;
	for (int i = 0; i < 10; ++i) {
		for (int j = 0; j < 10; ++j) {
			for (int k = 0; k < 10; ++k) {
				int count = 0;
				vector<int>X = {i,j,k};
				for (int l = 0;l<S.size();++l) {
					if ((X[count]+'0') == S[l]) {
						count++;
					}
					if (3 == count) {
						ans++;
						break;
					}
				}
			}
		}
	}
	cout << ans <<  endl;
	return 0;
}


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

//#pragma GCC optimize("ffast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")

using namespace std;

/** Interface */

inline int readChar();
template <class T = int> inline T readInt();
template <class T> inline void writeInt( T x, char end = 0 );
inline void writeChar( int x );
inline void writeWord( const char *s );

/** Read */

static const int buf_size = 4096;

inline int getChar() {
    static char buf[buf_size];
    static int len = 0, pos = 0;
    if (pos == len)
        pos = 0, len = fread(buf, 1, buf_size, stdin);
    if (pos == len)
        return -1;
    return buf[pos++];
}

inline int readChar() {
    int c = getChar();
    while (c <= 32)
        c = getChar();
    return c;
}

template <class T>
inline T readInt() {
    int s = 1, c = readChar();
    T x = 0;
    if (c == '-')
        s = -1, c = getChar();
    while ('0' <= c && c <= '9')
        x = x * 10 + c - '0', c = getChar();
    return s == 1 ? x : -x;
}

/** Write */

static int write_pos = 0;
static char write_buf[buf_size];

inline void writeChar( int x ) {
    if (write_pos == buf_size)
        fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
    write_buf[write_pos++] = x;
}

template <class T>
inline void writeInt( T x, char end ) {
    if (x < 0)
        writeChar('-'), x = -x;

    char s[24];
    int n = 0;
    while (x || !n)
        s[n++] = '0' + x % 10, x /= 10;
    while (n--)
        writeChar(s[n]);
    if (end)
        writeChar(end);
}

inline void writeWord( const char *s ) {
    while (*s)
        writeChar(*s++);
}

struct Flusher {
    ~Flusher() {
        if (write_pos)
            fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
    }
} flusher;

typedef long long ll;
typedef long double ld;

const ld EPS = 1e-9;

const int M = 30;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n = readInt();
    int k = readInt();
    vector<int> a(n), b(n);
    ll ans = 0;
    for (int i = 0; i < n; ++i) {
        a[i] = readInt();
        b[i] = readInt();
    }
    for (int i = 0; i < n; ++i) {
        if ((a[i] | k) == k) {
            ans += b[i];
        }
    }
    for (int i = 0; i < M; ++i) {
        if (k & (1 << i)) {
            k ^= 1 << i;
            k |= (1 << i) - 1;
        }
        ll res = 0;
        for (int i = 0; i < n; ++i) {
            if ((a[i] | k) == k) {
                res += b[i];
            }
        }
        ans = max(ans, res);
    }
    writeInt(ans);
    return 0;
}

Measured memory_bytes: 1024
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
//#include <utility>
#include <set>
#include <iostream>
//#include <memory>
#include <string>
#include <vector>
#include <algorithm>
//#include <functional>
#include <sstream>
//#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cctype>
#include <cstring>
//#include <ctime>
#include <iterator>
#include <bitset>
//#include <numeric>
//#include <list>
//#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

void mainmain(){
	int n1,n2;
	int a[7][7]={
		{0,6,13,18,23,43,58},
		{300,0,7,12,17,37,52},
		{500,350,0,5,10,30,45},
		{600,450,250,0,5,25,40},
		{700,600,400,250,0,20,35},
		{1350,1150,1000,850,600,0,15},
		{1650,1500,1350,1300,1150,500}
	};
	while(cin>>n1,n1){
		int m1,s1,m2,s2;
		cin>>m1>>s1;
		cin>>n2;
		cin>>m2>>s2;
		bool f1=false;
		bool f2=false;
		int t1=m1*60+s1;
		int t2=m2*60+s2;
		if(17*60+30<=t1&&t1<=19*60+30) f1=true;
		if(17*60+30<=t2&&t2<=19*60+30) f1=true;
		if(a[min(n1,n2)-1][max(n1,n2)-1]<=40) f2=true;
		if(f1&&f2){
			int ans=a[max(n1,n2)-1][min(n1,n2)-1];
			if(ans%100==0) cout<<ans/2<<endl;
			else{
				ans+=50;
				cout<<ans/2<<endl;
			}
		}
		else{
			cout<<a[max(n1,n2)-1][min(n1,n2)-1]<<endl;
		}
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

int main(){
  ll i, j;
  ll n;
  cin >> n;
  vector<ll> a(n);
  for(i = 0; i < n;i++)
    cin >> a[i];
  
  cout << *max_element(ALL(a)) - *min_element(ALL(a)) << endl; 

  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#define MAXN 100000
using namespace std;
struct node
{
	int to,id;
	node(){};
	node(int _to,int _id):to(_to),id(_id){}
};
vector<node> q[MAXN+5];
map<int,int> dp[MAXN+5];
int hasval[MAXN+5];
int L,n,Q;
int x[MAXN+5],far[MAXN+5][20];
int Lower_bound(int val)
{
	int L=0,R=n+1;
	while(L+1<R)
	{
		int mid=(L+R)/2;
		if(x[mid]<=val)
			L=mid;
		else
			R=mid;
	}
	return L;
}
void prepare()
{
	memset(far,-1,sizeof(far));
	for(int i=1;i<=n;i++)
	{
		int val=x[i]+L;
		int pos=Lower_bound(val);
		far[i][0]=pos;
	}
	for(int j=1;(1<<j)<=n;j++)
		for(int i=1;i<=n;i++)
			if(far[i][j-1]!=-1)
				far[i][j]=far[far[i][j-1]][j-1];
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&x[i]);
	scanf("%d %d",&L,&Q);
	prepare();
	int x,y,log;
	for(log=1;(1<<log)<=n;log++);
	log--;
	for(int i=1;i<=Q;i++)
	{
		scanf("%d %d",&x,&y);
		if(x>y)
			swap(x,y);
		int p=x,ans=0;
		for(int j=log;j>=0;j--)
			if(far[p][j]!=-1&&far[p][j]<y)
			{
				ans+=(1<<j);
				p=far[p][j];
			}
		if(p!=y)
			ans++;
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 16384
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int main() {

	int a,b;
	int total=0;
	cin>>a>>b;

	for(int i=a; i<=b; i++){
		if(i/10000==i%10&&i/1000%10==i/10%10)total++;
	}
	cout<<total<<endl;
	return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
B - Christmas Eve Eve
https://atcoder.jp/contests/abc115/tasks/abc115_b

"""
import sys


def solve(prices):
    return sum(prices[:-1]) + prices[-1]//2


def main(args):
    N = int(input())
    prices = sorted([int(input()) for _ in range(N)])
    ans = solve(prices)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


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

ll ceil(ll n, ll m) {
    return n % m == 0 ? n / m : n / m + 1;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll h, a;
    cin >> h >> a;
    cout << ceil(h, a);
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	ll x,y;
	scan(x>>y);
	ll base=0;
	if(x==0&&y!=0) x++,base++;
	ll ans1=INFl,ans2=INFl,ans3=INFl,ans4=INFl;
	if(x<=y) ans1=y-x;
	if(-x<=y) ans2=y+x+1;
	if(-x<=-y) ans3=-y+x+2;
	if(x<=-y) ans4=-y-x+1;
	prin(base+min({ans1,ans2,ans3,ans4}));
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2


def generate_adj(v_info):
    for v_detail in v_info:
        v_adj_list = v_detail[2:]
        assert len(v_adj_list) == int(v_detail[1])
        for each in v_adj_list:
            init_adj_matrix[int(v_detail[0]) - 1][int(each) - 1] = 1
    return init_adj_matrix


def graph_dfs(v_init):
    global time
    # init the first node of overall graph iterations(times >= 1)
    vertex_visit_stack.append(v_init)
    vertex_status_list[v_init] = VISITED_IN_STACK
    vertex_d_time[v_init] += time
    # init end
    while len(vertex_visit_stack) > 1:
        current_vertex = vertex_visit_stack[-1]
        next_vertex = get_adj_vertices(_vertex=current_vertex)
        # print('start', current_vertex, next_vertex, vertex_status_list, vertex_visit_stack)

        if next_vertex:
            if vertex_status_list[next_vertex] is UNVISITED:
                vertex_status_list[next_vertex] = VISITED_IN_STACK
                time += 1
                vertex_d_time[next_vertex] += time
                vertex_visit_stack.append(next_vertex)
                # print('on', current_vertex, next_vertex, vertex_status_list, vertex_visit_stack)
        else:
            # print('no out degree', current_vertex)
            vertex_visit_stack.pop()
            vertex_status_list[current_vertex] = POPPED_OUT
            time += 1
            vertex_f_time[current_vertex] += time
        # print('end', current_vertex, vertex_status_list, vertex_visit_stack)

    return None


def get_adj_vertices(_vertex):
    for j in range(vertex_num):
        if adj_matrix[int(_vertex) - 1][j]:
            adj_matrix[int(_vertex) - 1][j] = 0
            return j + 1
    return None


def dfs_start():
    global time
    for i in range(vertex_num):
        if vertex_status_list[i + 1] == UNVISITED:
            # print('round', i + 1)
            graph_dfs(v_init=i + 1)
            time += 1


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    vertex_num = int(_input[0])
    vertex_info = list(map(lambda x: x.split(), _input[1:]))
    init_adj_matrix = [[0] * vertex_num for _ in range(vertex_num)]
    # assert len(vertex_info) == vertex_num
    # config length -> (vertex_num + 1)
    vertex_visit_stack = [-1]
    vertex_status_list = [UNVISITED] * vertex_num
    vertex_status_list.insert(0, -1)
    vertex_d_time, vertex_f_time = ([0] * (vertex_num + 1) for _ in range(2))

    adj_matrix = generate_adj(vertex_info)

    time = 1
    dfs_start()

    for k in range(vertex_num):
        print(k + 1, vertex_d_time[k + 1], vertex_f_time[k + 1])

Measured memory_bytes: 7816
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>

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

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; }

typedef long long ll;

using namespace std;
int dx[4]={0,1,0,-1};

class FF
{
public:
  struct edge{int to,cap,rev;};
  vector<vector<edge>>G;
  vector<bool> used;
  FF(int maxv)
  {
    G.resize(maxv);
    used.resize(maxv);
  }
  void add_edge(int from,int to,int cap,bool directed=1)
  {
    G[from].push_back({to,cap,(int)G[to].size()});
    G[to].push_back({from,cap*(!directed),(int)G[from].size()-1});
  }
  int dfs(int v,int t,int f)
  {
    if(v==t)return f;
    used[v]=1;
    for(auto &nv:G[v])
    {
      if(!used[nv.to] && nv.cap>0)
      {
        int d=dfs(nv.to,t,min(f,nv.cap));
        if(d>0)
        {
          nv.cap-=d;
          G[nv.to][nv.rev].cap+=d;
          return d;
        }
      }
    }
    return 0;
  }
  int solve(int s,int t)
  {
    int res=0;
    while(1)
    {
      for(int i=0;i<used.size();i++)used[i]=0;
      int f=dfs(s,t,(1<<30)-1);
      if(f==0)break;
      res+=f;
    }
    return res;
  }
};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h,w;
  cin>>h>>w;
  vector<string> hw(h);
  rep(i,h)cin>>hw[i];
  FF ff(h*w*2+2);
  int s=h*w*2,t=h*w*2+1;
  rep(i,h)rep(j,w)rep(k,4)
  {
    int y=i+dx[k^1],x=j+dx[k];
    if(y<0||y>=h||x<0||x>=w)
    {
      ff.add_edge((i*w+j)*2+1,t,10000,1);
      //cout<<h*w+1<<" "<<i*w+j<<endl;
    }
    else
    {
      ff.add_edge((i*w+j)*2+1,(y*w+x)*2,1,1);
    }
  }
  rep(i,h)rep(j,w)
  {
    if(hw[i][j]=='X')
    {
      if(i==0||i==h-1||j==0||j==w-1)
      {
        cout<<-1<<endl;
        return 0;
      }
      ff.add_edge(s,(i*w+j)*2+1,10000,1);
    }
    else
    {
      ff.add_edge((i*w+j)*2,(i*w+j)*2+1,1,1);
    }
  }
  cout<<ff.solve(s,t)<<endl;

  return 0;

}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int base = 1;
    int N, K;
    cin >> N >> K;

    for(int i=0; i<N; i++){
        if(base*2 > base+K){
            base += K;
        }
        else{
            base *= 2;
        }
    }

    cout << base << endl;
}


Measured memory_bytes: 256
import decimal
#decimal.getcontext().prec = 30
a,b,c = list(map(int, input().split()))
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)
d = decimal.Decimal(0.5)
e = decimal.Decimal(1/10000000)

#print(a**decimal.Decimal(0.5))

if(a**d + b**d < (c)**d ):
    print("Yes")
else:
    print("No")
#print(a**d + b**d , (c)**d)


Measured memory_bytes: 59372
#include<stdio.h>
int main(void){
    int first,second,third;
    int i,t;

    first=second=third=0;
    for(i=0;i<10;i++){
	scanf("%d",&t);
	if(t>first){
	    third=second;
	    second=first;
	    first=t;
	} else if(t>second){
	    third=second;
	    second=t;
	} else if(t>third){
	    third=t;
	}
    }
    printf("%d\n%d\n%d\n",first,second,third);

    return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
ll k,x,y,res;
//bool ck(ll a){return a+1>=(k-a)/2*x;}
int main() {
	read(k);read(x);read(y);
	res=k+1;
	/*ll t=min(max((k*x-2)/(2+x)+3,0LL),k);
	if(t-k&1)t++;
	while(t-2>=0&&ck(t-2))t-=2;
	res=max(res,t+1+(k-t)/2*(y-x));*/
	if(x<y&&x-1<=k){
		ll t=x-1;if(k-t&1)t++;
		res=max(res,t+1+(k-t)/2*(y-x));
	}
	
	cout<<res;
	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>    
#define inf 100000000
#define INF 9223372036854775807
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;

int in(void){
    int i;scanf("%d",&i);
    return i;
}
long long llin(void){
    long long i;scanf("%lld",&i);
    return i;
}
double din(void){
    double i;scanf("%lf",&i);
    return i;
}
void chin(char s[]){
    scanf("%s",s);
}
void print(int a){
    printf("%d\n",a);
}
void llprint(long long a){
    printf("%lld\n",a);
}
void dprint(double a){
    printf("%.10f\n",a);
}
void print2(int a,int b){
    printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
    return a>b?a:b;
}
long long min(long long a,long long b){
    return a<b?a:b;
}
double dmax(double a,double b){
    return a>b?a:b;
}
int cmp(const void *a,const void *b){
    return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
    return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
    return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
    return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
    int t=*a;
    *a=*b;
    *b=t;
}
long long gcd(long long x,long long y){
    return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
    return x/gcd(x,y)*y;
}

// konoshita kara kaku
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};

int main(void){
    int h=in(),w=in(),i,j,k,f=1;
    char s[52][55];
    rep(i,h){
        chin(s[i]);
        //rep(j,w)s[i][j]=getchar();
        //getchar();
    }
    rep(i,h)rep(j,w){
        int hh=i;//+1;
        int ww=j;//+1;
        if(s[hh][ww]=='#'){
            rep(k,4){
                if(s[hh+dy[k]][ww+dx[k]]=='#')break;
            }
            if(k==4)f=0;
        }
    }
    puts(f?"Yes":"No");
    return 0;
}

Measured memory_bytes: 128
n,m,l=(int(x) for x in input().split())
A=[[0 for i in range(m)] for j in range(n)]
B=[[0 for i in range(l)] for j in range(m)]
C=[[0 for i in range(l)] for j in range(n)]
for i in range(n):
    A[i]=[int(x) for x in input().split()]
for i in range(m):
    B[i]=[int(x) for x in input().split()]
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j]+=A[i][k]*B[k][j]
for i in range(n):
    for j in range(l):
        if j==l-1:
            print(C[i][j])
        else:
            print(C[i][j],end=" ")


Measured memory_bytes: 7060
#include <bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define rep(i,a,b) for (int i=(a); i<(b); i++)
#define debug(x) cout << #x << " => " << x << endl
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
typedef pair<int,int> pii;
const int MAX_N = 7 + 1000;
int n;
vector<pair<int,double> > G[MAX_N];
///----------------------------------------------
ll Sqr(int d) { return 1ll*d*d; }
double getdis(pii a,pii b) {
    return sqrt( Sqr(a.fi-b.fi) + Sqr(a.se-b.se) );
}
///----------------------------------------------
double dis[MAX_N];
bool in[MAX_N];
queue<int> que;
double Spfa(int s,int t) {
    ///init
    rep(i,0,n+2) dis[i]=-1.0; dis[s]=0.0;
    memset(in,false,sizeof(in)); in[s]=true;
    ///work
    for (que.push(s); !que.empty(); que.pop()) {
        int u=que.front();
        //debug(u);
        rep(i,0,sz(G[u])) {
            int v=G[u][i].fi;
            double c=G[u][i].se;
            if (dis[v]<0.0 || dis[v]>dis[u]+c) {
                //debug(dis[u]+c);
                for (dis[v]=dis[u]+c; !in[v]; in[v]=true) que.push(v);
            }
        }
        in[u]=false;
    }
    ///return
    return dis[t];
}
///----------------------------------------------
pair<pii,int> p[MAX_N];
int main() {

    //freopen ( "xx.in" ,  "r" , stdin );
    ///read
    pii s,t; cin>>s.fi>>s.se>>t.fi>>t.se;
    cin>>n;
    rep(i,0,n) scanf("%d%d%d",&p[i].fi.fi,&p[i].fi.se,&p[i].se);

    ///prework
    int S=n,T=n+1;
    rep(i,0,n) rep(j,0,n) if (j!=i) {
        double dis=max(0.0,getdis(p[i].fi,p[j].fi)-p[i].se-p[j].se);
        //debug(i);
        //debug(j);
        //debug(dis);
        G[i].pb(mp(j,dis));
        G[j].pb(mp(i,dis));
    }
    rep(i,0,n) {
        double dis1=max(0.0,getdis(p[i].fi,s)-p[i].se); G[S].pb(mp(i,dis1));
        double dis2=max(0.0,getdis(p[i].fi,t)-p[i].se); G[i].pb(mp(T,dis2));
        //if (i==2){
            //debug(getdis(p[i].fi,s));
            //debug(dis1);
            //debug(dis2);
        //}
    }
    G[S].pb(mp(T,getdis(s,t)));

    ///spfa
    printf("%.15f",Spfa(S,T));

}


Measured memory_bytes: 32768
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int main(){
    string S;
    cin >> S;
    
    int cnt=0;
    char c=S[0];
    for(auto &s:S){
        if(c!=s){
            cnt++;
            c=s;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3688
#include <stdio.h>

int main(void)
{
  int n;
  
  scanf("%d", &n);
  
  while(n>0){
    if(n%10 == 7){
      printf("Yes");
      break;
    }
    n = n/10;
  }
   
  if(n == 0)
    printf("No");
  
  return 0;
}


Measured memory_bytes: 1688
import sys

def lcm(a, b):
    a, b = max(a, b), min(a, b)
    c = a * b
    while a % b > 0:
        a, b = b, a % b
    return c // b


def solve():
    input = sys.stdin.readline
    X = int(input())
    L = lcm(360, X)
    print(L // X)

    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 9188
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
    int a, b;
    while(cin>>a>>b){
        ll ans=-1;
        int tmp1=b*10, tmp2=(b+1)*10;
        for(int i=tmp1; i<tmp2; ++i){
        	if(i*8/100 == a){
        		ans=i;
        		break;
        	}
        }
        cout<<ans<<endl;
    }
  return 0;
}




Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
	
	int n;
	while(cin>>n){
		if(n==0)break;
		int a,b;
		int A=0,B=0;
		for(int i=0;i<n;i++){
			cin>>a>>b;
			if(a<b){
				B=B+a+b;
			}
			else if(a>b){
				A=A+a+b;
			}
			else if(a==b){
				A=A+a;
				B=B+b;
			}
		}
         cout<<A<<' '<<B<<endl;
	 }
	 return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;


int main() {
  int n,k,s;
  cin >> n >> k >> s;
  vector<int> a(n);
  rep(i,k){
    a[i]=s;
  }
  rep(i,n-k){
    a[i+k]=58375904;
  }
  rep(i,n){
    cout << a[i] << " ";
  }
  cout << endl;
}


Measured memory_bytes: 1664
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
      	int H = sc.nextInt();
      	int M = sc.nextInt();
      	if(H == 0) H = 12;
		double H2 = (H * 60 + M) * 0.5;
        double M2 = M * 6;
      	if (M2 == 0) M2 = 360;
      	double kakudo = 0;
      	if(M2 > H2){
	      kakudo = M2 - H2;
        }
      	else{
          kakudo = H2 - M2;
    	}
      	
      	kakudo = Math.min(kakudo,360-kakudo);
      	//System.out.println(kakudo);
      	
         double cos = Math.cos(Math.toRadians(kakudo));
      	 double ans = Math.sqrt((A*A)+(B*B)-(2*A*B*cos));

         System.out.println(ans);
    }
}

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

int main() {
  int64_t n, m, v, p;
  cin >> n >> m >> v >> p;
  int a[n], result = p;
  for (int i = 0; cin >> a[i]; ++i) {}
  sort(a, a + n, greater<int>());
  int64_t sum = 0;
  for (int i = p; i < n; ++i) {
    sum += a[i - 1];
    if (a[i] + m >= a[p - 1] && (i - p + 1) * (a[i] + m) - sum + (p + n - 1 - i) * m >= m * v) {
      ++result;
    }
  }
  cout << result;
  return 0;
}


Measured memory_bytes: 3436
n, m = map(int, input().split())
s = input()
t = input()
def gcd(a, b):
    while b!=0:
        a, b = b, a%b
    return a
g = gcd(n, m)
l = n*m//g
for i, j in zip(s[0:n:n//g], t[0:m:m//g]):
    if i!=j:
        print(-1)
        break
else:
    print(l)

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;


int main() {
    int d, t, s; cin >> d >> t >> s;
    if((d + s - 1) / s <= t) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
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; }
const int INF = 1e9;
const LL LLINF = 1e16;

int main(){
    fastcin();

    string s;
    cin >> s;
    LL k;
    cin >> k;

    string t = s+s;
    LL ans = 0;
    int ct = 0, tmp = 1;
    if(s[0] != s[s.size()-1]){
        rep(i, s.size()-1){
            if(s[i+1] == s[i]) tmp++;
            else{
                ans += tmp/2;
                tmp = 1;
            }
        }
        ans += tmp/2;
        ans *= k;
        cout << ans << endl;
        return 0;
    }
    int bd = 0;
    rep(i, t.size()-1){
        if(t[i+1] == t[i]) tmp++;
        else{
            if(ct > 0) ans += tmp/2;
            ct++;
            if(i >= s.size()){
                bd = tmp/2;
                break;
            }
            tmp = 1;
        }
    }
    if(ct == 0){
        ans = k*s.size()/2;
    }else{
        ans *= k;
        ans -= bd;
        tmp = 1;
        rep(i, s.size()-1){
            if(s[i+1] == s[i]) tmp++;
            else{
                ans += tmp/2;
                break;
            }
        }
        tmp = 1;
        reverse(all(s));
        rep(i, s.size()-1){
            if(s[i+1] == s[i]) tmp++;
            else{
                ans += tmp/2;
                break;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<map>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
using namespace std;
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
inline ll read(){
   int s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
#define d read()
ll a,b,c;
int main(){
	a=d,b=d,c=d;
	cout<<c<<" "<<a<<" "<<b;
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

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

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl



int main(){
    int n;
    cin>>n;
    vi a(n);
    REP(i,n){
        cin>>a[i];
        a[i]--;
    }
    int ans=0;
    REP(i,n){
        if(a[i]!=-1 && a[a[i]]==i){
            a[a[i]]=-1;
            a[i]=-1;
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
bool judge(string s)
{
    int n=s.length();
    for(int i=0;i<n/2;i++)
    {
        if(s[i]!=s[n/2+i])
            return false;
    }
    return true;
}
int main()
{
    string s;
    cin>>s;
    int n=s.length();
    int ans;
    for(int i=2;i<n;i+=2)
    {
        s.erase(s.length()-2,2);
        if(judge(s))
        {
            ans=n-i;
            break;
        }
    }
    cout<<ans;
}


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

int main(){
	int N;
	cin >> N;
	int T[N];
	for(int i=1; i<N+1; i++){
		cin >> T[i];
	}
	int sum=0;
	for(int i=1; i<N+1; i++){
		sum += T[i];
	}

	int M;
	cin >> M;
	int X[M],m[M];
	for(int i=1; i<M+1; i++){
		cin >> m[i] >> X[i];
	}

	for(int i=1; i<M+1; i++){
		cout << sum - T[m[i]] + X[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int i,j,h,w;
    while(1)
    {
        scanf("%d%d",&h,&w);
        if(h==0)
        {
            break;
        }
        else
        {
            for(i=0; i<h; i++)
            {
                for(j=0; j<w; j++)
                {
                    printf("#");
                }
                printf("\n");
            }
            printf("\n");
        }
    }
    return 0;
}



Measured memory_bytes: 2064
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int mod = 1e9+7;
const int MAX = 510000;
const int V = 100005;
ll dy[8] = {1,0,-1,0,1,-1,1,-1};
ll dx[8] = {0,1,0,-1,1,-1,-1,1};
const double pi = acos(-1);
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << endl;}
#define INT_MAX 1e9+7

int main(){
    ll n; cin >> n;
    vl a(n);
    rep(i,n) cin >> a[i];
    ll r=0,g=0,b=0;
    ll ans = 1;
    rep(i,n){
        ll c = 0;
        if(r==a[i]) c++;
        if(g==a[i]) c++;
        if(b==a[i]) c++;
        ans *= c;
        ans %= mod;
        if(r==a[i]){
            r++; continue;
        }
        if(g==a[i]){
            g++; continue;
        }
        if(b==a[i]){
            b++; continue;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
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; }
using namespace std;


int main(){
  string S;
  cin>>S;
  
  if(S=="SUN") co(7);
  if(S=="MON") co(6);
  if(S=="TUE") co(5);
  if(S=="WED") co(4);
  if(S=="THU") co(3);
  if(S=="FRI") co(2);
  if(S=="SAT") co(1);
}

Measured memory_bytes: 256