akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <stack>
#include <set>
#include <bitset>
#include <deque>
#pragma GCC optimize(3 , "Ofast" , "inline")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std ;
#define ios ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0)
#define x first
#define y second
#define pb push_back
#define ls rt << 1
#define rs rt << 1 | 1
typedef long long ll ;
const double esp = 1e-6 , pi = acos(-1) ;
typedef pair<int , int> PII ;
const int N = 1e6 + 10 , INF = 0x3f3f3f3f , mod = 1e9 + 7;
int work()
{
  ll a , b , c , d ;
  cin >> a >> b >> c >> d ;
  cout << max(a * c , max(a * d , max(b * c , b * d))) << endl ;
  return 0 ;
}
int main()
{
  //   freopen("C://Users//spnooyseed//Desktop//in.txt" , "r" , stdin) ;
  //   freopen("C://Users//spnooyseed//Desktop//out.txt" , "w" , stdout) ;

  work() ;
  return 0 ;
}
/*
*/


Measured memory_bytes: 3184
#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/algorithm/string/classification.hpp> // is_any_of
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/math/tools/minima.hpp>

const int MOD = 1e9+7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n); i >= 0; --i)

namespace adaptor = boost::adaptors;
using namespace std;
using boost::math::tools::brent_find_minima;
using boost::irange;
using boost::algorithm::join;
using boost::algorithm::split;
using boost::algorithm::replace_all;
using boost::multiprecision::cpp_int;
using ll = long long;
using P = pair<int, int>;

// TOP
void	Main()
{
	int	n;
	cin >> n;
	vector<int>	V(n + 1);
	rep(i, n)
		cin >> V.at(i);
	int times;
	times = 0;
	while (1)
	{
		int i;
		i = 0;
		while (i < n && V.at(i) == 0)
			i++;
		if (i == n)
			break ;
		int starti;
		int minv;
		minv = INT_MAX;
		starti = i;
		while (V.at(i) != 0)
		{
			minv = min(minv, V.at(i));
			i++;
		}
		for (int j = starti; j < i; j++)
			V.at(j) -= minv;
		times += minv;
	}
	cout << times << endl;
}
// END

int		main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 256
"""
102 C
"""

import math

def read_input():
    n = int(input())
    alist = list(map(int, input().split()))

    return n, alist


def sum_abs(alist, b):
    return sum([abs(a - b) for a in alist])


def submit():
    n, alist = read_input()

    alist = [a - (i + 1) for i, a in enumerate(alist)]
    alist.sort()

    if n % 2 == 0:
        b_min, b_max = alist[n // 2], alist[n // 2 + 1]
        print(min(sum_abs(alist, b_min), sum_abs(alist, b_max)))
    else:
        print(sum_abs(alist, alist[n // 2]))


if __name__ == "__main__":
    submit()

Measured memory_bytes: 26612
import java.io.*;
import java.util.*;
public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String[] lo =reader.readLine().split(" ");
		int a = Integer.parseInt(lo[0]);
		int b = Integer.parseInt(lo[1]);
		System.out.println(a*b);
	}
}


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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var age = int.Parse(Console.ReadLine());
        Console.WriteLine(new [] { 3, 5, 7 }.Any(x => age == x) ? "YES" : "NO");
    }
}


Measured memory_bytes: 13268
// b_maximum_sum.c

#include <stdio.h>


int main()
{
  int a, b, c, k, max;
  int index=2, answer;

  /***  input  ***/
  scanf("%d %d %d", &a, &b, &c);
  scanf("%d", &k);

  max = a;
  if (b > max){
    max = b;
  }
  if (c > max){
    max = c;
  }


  for ( int i = 1; i < k; i++){
    index *= 2;
  }

  answer = a + b + c + max * (index - 1);
  printf("%d\n", answer);

}


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

using namespace std;

const int MAXN = 1E5;
int sa[MAXN + 1];
int sb[MAXN + 1];
int ta[MAXN + 1];
int tb[MAXN + 1];

int main()
{
    string s, t;
    int q;
    cin >> s >> t >> q;
    int n = (int) s.length();
    int m = (int) t.length();
    for (int i = 1; i <= n; i++)
    {
        sa[i] = sa[i - 1] + (s[i - 1] == 'A');
        sb[i] = sb[i - 1] + (s[i - 1] == 'B');
    }
    for (int i = 1; i <= m; i++)
    {
        ta[i] = ta[i - 1] + (t[i - 1] == 'A');
        tb[i] = tb[i - 1] + (t[i - 1] == 'B');
    }
    while (q--)
    {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        int amod = ((sa[b] - sa[a - 1]) % 3 - (ta[d] - ta[c - 1]) % 3 + 3) % 3;
        int bmod = ((sb[b] - sb[a - 1]) % 3 - (tb[d] - tb[c - 1]) % 3 + 3) % 3;
        int nmod = ((b - a) % 3 - (d - c) % 3 + 3) % 3;
        if (amod == bmod && (amod + nmod) % 3 == 0)
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 2432
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define fir first
#define sec second
#define mod 998244353
#define int long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
inline int read()
{
	char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();}
	int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();}
	if(nega==-1) return -ans;
	return ans;
}
typedef pair<int,int> pii;
inline int min(int x,int y,int z){return min(x,min(y,z));}
inline int max(int x,int y,int z){return max(x,max(y,z));}
inline int add(int x,int y){return x+y>=mod?x+y-mod:x+y;}
inline int add(int x,int y,int z){return add(add(x,y),z);}
inline int sub(int x,int y){return x-y<0?x-y+mod:x-y;}
inline int mul(int x,int y){return 1LL*x*y%mod;}
inline int mul(int x,int y,int z){return mul(mul(x,y),z);}
#define N 5005
int a[N];
int f[N][N];
signed main()
{
	int n,A,B; cin>>n>>A>>B;
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=n;j++)
		{
			if(j<a[i]) f[i][j]=f[i-1][j]+A;
			else if(j>a[i]) f[i][j]=f[i-1][j]+B;
		}
		f[i][a[i]]=INF;
		for(int j=0;j<=a[i];j++) if(f[i-1][j]<f[i][a[i]]) f[i][a[i]]=f[i-1][j];
	}
	int ans=INF;
	for(int i=0;i<=n;i++) if(f[n][i]<ans) ans=f[n][i];
	cout<<ans<<endl;
	return 0;
}




Measured memory_bytes: 195840
#include<iostream>
#include<algorithm>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#define ll long long
#define lson (rt<< 1)
#define rson (rt<< 1 | 1)
#define gmid ((l+r)>> 1 )
using namespace std;

const int maxn=20000050;
int main()
{
	int x;
	cin>>x;
	if(x==0) cout<<1<<endl;
	  else cout<<0<<endl; 
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
//////////////////////////////////

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

    return 0;
}

// EOF


Measured memory_bytes: 256
n = int(input())						# 5

H = [int(i) for i in input().split()]			# 1 2 3 4 5 ...

imax=0
count=0

for i in range(n-1):
	if H[i]>=H[i+1]:
		count+=1
		imax=max(imax,count)
	else:
		count=0

print(imax)


Measured memory_bytes: 14252
import java.util.*;
import java.io.*;
 public class Main{
   public static void main(String [] args){
     Scanner sc=new Scanner(System.in);
     int n=sc.nextInt();
     long [] arr=new long[n];
     
     for(int i=0;i<n;i++)arr[i]=sc.nextLong();

     long [] dp=new long[n];
     dp[0]=0;
     if(n>=1)
        dp[1]=Math.abs(arr[0]-arr[1]);
     if(n>=2){
       for(int i=2;i<n;i++)
          dp[i]=Math.min(dp[i-2]+Math.abs(arr[i]-arr[i-2]),
          dp[i-1]+Math.abs(arr[i]-arr[i-1]));
     }

     System.out.println(dp[n-1]);
    }
   }
 

Measured memory_bytes: 63256
import sys
input = sys.stdin.readline
import math

def isPrime(x):
    for i in range(2, int(math.sqrt(x)) + 1):
        if x % i == 0:
            return 0
    return 1

def main():
    x = int(input())
    for i in range(x, 1000000):
        if isPrime(i):
            print(i)
            return

main()


Measured memory_bytes: 2940
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(1000000)

def main():
    n, m = map(int, input().split())
    parents = [i for i in range(n)]
    for i in range(m):
        x, y, z = map(int, input().split())
        unite(x - 1, y - 1, parents)
    uniq = {find(i, parents) for i in range(n)}
    print(len(uniq))

def unite(x, y, parents):
    px = find(x, parents)
    py = find(y, parents)
    parents[py] = px

def find(x, parents):
    if parents[x] == x:
        return x
    fx = find(parents[x], parents)
    parents[x] = fx
    return fx

if __name__ == "__main__":
    main()


Measured memory_bytes: 16016
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
#include <stack>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)
int main(void)
{
    int N;
    cin >> N;
    string s;
    int ac = 0, wa = 0, tle = 0, re = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> s;
        if (s == "AC")
        {
            ac++;
        }
        if (s == "WA")
        {
            wa++;
        }
        if (s == "TLE")
        {
            tle++;
        }
        if (s == "RE")
        {
            re++;
        }
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
    return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>

int main(int argc, char *argv[])
{
  int a, b, c, d, e, f;

  while((scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f)) != EOF)
    {
      double x, y;
      double i = a*e - b*d;

      if(i == 0)
	continue;

      x = (c*e - b*f)/i;
      y = (-c*d + a*f)/i;

      printf("%.3f %.3f\n", (x == 0.0) ? 0.0 : x, (y == 0.0) ? 0.0 : y); 
    }
  return 0;
}

Measured memory_bytes: 636
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int crackerN = scanner.nextInt();
        int peopleM = scanner.nextInt();
        int getMin = crackerN/peopleM;
        int exceed = crackerN%peopleM;
        if(exceed >1){
            exceed=1;
        }
        System.out.println(exceed);
    }
}


Measured memory_bytes: 21844
#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
using ll = long long;
int main(){
  int n;
  cin >> n;
  vector<int> c(n), s(n), f(n);
  for(int i = 0; i < n - 1; i++){
    cin >> c[i] >> s[i] >> f[i];
  }
  for(int i = 0; i < n - 1; i++){
    int time = 0;
    time += s[i] + c[i];
    int j = i + 1;
    while(j < n - 1){
      if(time < s[j]){
        time = s[j];
      }else if(time % f[j]){
        time += f[j] - time % f[j];
      }
      time += c[j];
      j++;
    }
    cout << time << '\n';
  }

  cout << 0 <<'\n';
  return 0;
}

Measured memory_bytes: 256
fn main() {
    let r = std::io::stdin();
    let mut sc = Scanner::new(r.lock());

    let v = sc.read_line();
    let s : Vec<char> = v[0].chars().collect();

    let mut start : usize = 0;
    let mut end : usize = s.len() - 1;

    loop {
        if s[start] == 'A' {
            break;
        } else {
            start = start + 1;
        }
    }
    loop {
        if s[end] == 'Z' {
            break;
        } else {
            end = end - 1;
        }
    }

    print!("{}", end - start + 1);
}

pub struct Scanner<R: std::io::Read> (std::io::BufReader<R>);
 
impl<R: std::io::Read> Scanner<R> {
    pub fn new(r: R) -> Scanner<R> {
        Scanner (std::io::BufReader::new(r))
    }
 
    pub fn read_line(&mut self) -> Vec<String> {
        use std::io::BufRead;
        let mut line = String::new();
        self.0
            .read_line(&mut line)
            .unwrap();
 
        line.split_whitespace()
            .map(|b| b.to_string())
            .collect::<Vec<String>>()
    }
}

Measured memory_bytes: 4352
#include<stdio.h>
int main(void){
	int W,H,x,y,r;
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if((0<=(x-r) && (x+r)<=W && 0<=(y-r) && (y+r)<=H)){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	return 0;
}

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

const int maxn=2e3+10;

int N,Z,W;
int a[maxn];
int F[maxn][2];

int dfs(int cur,int player){
	if (cur==N)abort();
	int& ans=F[cur][player];
	if (~ans)return ans;
	if (player==0){
		ans=std::abs((cur?a[cur]:W)-a[N]);
		for (int k=cur+1;k<N;k++)
			ans=std::max(ans,dfs(k,1));
	}else {
		ans=std::abs((cur?a[cur]:Z)-a[N]);
		for (int k=cur+1;k<N;k++)
			ans=std::min(ans,dfs(k,0));
	}
	return ans;
}

int main (){
#ifdef LOCAL
	freopen("input","r",stdin);
#endif
	memset(F,0xFF,sizeof(F));
	std::cin >> N >> Z >> W;
	for (int i=1;i<=N;i++)
		std::cin >> a[i];
	std::cout << dfs(0,0) << '\n';
	return 0;
}



Measured memory_bytes: 384
using System;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var ab = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            if (ab[0] % 3 == 0)
            {
                Console.WriteLine("Possible");
                return;
            }
            if (ab[1] % 3 == 0)
            {
                Console.WriteLine("Possible");
                return;
            }
            Console.WriteLine(ab.Sum()%3==0? "Possible" : "Impossible");
        }
    }
}


Measured memory_bytes: 13396
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

const int MaxN = 100, Pt = 1e9 + 7;
typedef long long LL; 
using namespace std;

int h, w, K; 
LL dp[MaxN + 5][10], f[MaxN + 5];

int main() 
{
	f[-1] = 1, f[0] = 1, f[1] = 2; 
	for (int i = 2; i <= 10; i++) f[i] = f[i - 1] + f[i - 2];
	while(~scanf("%d%d%d", &h, &w, &K)) {
		memset(dp, 0, sizeof(dp));
		dp[h][1] = 1; 
		for (int i = h - 1; i >= 0; i--) {
			for (int j = 1; j <= w; j++) {
				dp[i][j] = (dp[i][j] + dp[i + 1][j] * f[j - 2] * f[w - j - 1]) % Pt;
				dp[i][j] = (dp[i][j] + dp[i + 1][j - 1] * f[j - 3] * f[w - j - 1]) % Pt;
				dp[i][j] = (dp[i][j] + dp[i + 1][j + 1] * f[j - 2] * f[w - j - 2]) % Pt;
			}
		}
		printf("%lld\n", dp[0][K]);
	}
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    vector<int> a(n), b(n), c(n-1); 
    for(int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
    }
    for(int i = 0; i < n; ++i) cin >> b[i];
    for(int i = 0; i < n-1; ++i) cin >> c[i];
    int ans = 0;
    for(int i = 0; i < n; ++i){
        ans += b[a[i]];
        if(i == 0) continue;
        if(a[i] == a[i-1]+1) ans += c[a[i-1]];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3592
#include<stdio.h>
#include<string.h>

int LCS(char *,char *);

int main(){
  int i,n,q;
  char S1[1002],S2[1002];
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%s",S1);
    scanf("%s",S2);
    printf("%d\n",LCS(S1,S2));
  }
  return 0;
}


int LCS(char *X,char *Y){
  int m,n,i,j,c[1002][1002];
  m=strlen(X);
  n=strlen(Y);
  for(i=0;i<=m;i++)c[i][0]=0;
  for(j=1;j<=n;j++)c[0][j]=0;
  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i-1]==Y[j-1]){
	c[i][j]=c[i-1][j-1]+1;
      }
      else if(c[i-1][j]>=c[i][j-1]){
	c[i][j]=c[i-1][j];
      } else {
	c[i][j]=c[i][j-1];
      }
    }
  }
  return c[i-1][j-1];
}
  



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


using namespace std;
typedef long long ll;
#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++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;




int main() {

	int n, k;
	cin >> n >> k;

	VI p(n);
	REP(i, n)cin >> p[i];

	map<int, int> mg;
	map<int, int> ms;
	priority_queue<int> qg;
	priority_queue<int, vector<int>, greater<int>> qs;


	int ans = 1;

	REP(i, k) {
		qg.push(p[i]);
		qs.push(p[i]);
	}

	VB check(n, false);
	check[0] = true;


	FOR(i, k, n) {
		int a = p[i - k];
		mg[a]++;
		ms[a]++;
		if (p[i] > a) {
			if (qs.top() == a) {
				if (qg.top() < p[i]) {
				}
				else {
					check[i - k+1] = true;
					ans++;
				}
			}
			else {
				check[i - k+1] = true;
				ans++;
			}
		}
		else {
			check[i - k+1] = true;
			ans++;
		}

		while (true) {
			if (ms[qs.top()] > 0) {
				ms[qs.top()]--;
				qs.pop();
			}
			else break;
		}
		while (true) {
			if (mg[qg.top()] > 0) {
				mg[qg.top()]--;
				qg.pop();
			}
			else break;
		}
		qg.push(p[i]);
		qs.push(p[i]);
	}

	

	int cnt = 1;
	bool b = false;
	int cn = 0;
	
	FOR(i, 1, n) {
		if (p[i] > p[i - 1]) {
			cnt++;
			if (cnt >= k)if(check[i-k+1]) {
				cn++;
			}
		}
		else {
			cnt = 1;
		}
		
	}


	if (cn > 1)ans -= cn - 1;

	cout << ans << endl;


}



Measured memory_bytes: 21224
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = LLONG_MAX/4;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll n; cin >> n;
    string s;cin >> s;
    string t;cin >> t;
    string ret = "";
    rep(i,n){
        ret += s[i];
        ret += t[i];
    }
    cout << ret <<endl;
}

Measured memory_bytes: 256
#include<stdio.h>

void view(int a[], int n){
	int i;
	for(i=0;i<n-1;i++) printf("%d ",a[i]);
	printf("%d\n",a[n-1]);
}

void selectionSort(int a[], int n){
	int i,j,temp,minj,count=0;
	for(i=0;i<n;i++){
		minj = i;
		for(j=i;j<n;j++){
			if(a[j]<a[minj]) minj = j;
		}
		if(i!=minj){
			temp = a[i];
			a[i] = a[minj];
			a[minj] = temp;
			count++;
		}
	}
	view(a,n);
	printf("%d\n",count);
}

int main(void){
	int i,a[100],n;

	scanf("%d\n",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	selectionSort(a,n);

	return 0;
}

Measured memory_bytes: 600
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=200005;
int n,l,r,mid;
int a[N],b[N];
inline void get(int &a)
{
	char c=getchar();
	a=0;
	for(;c<'0'||c>'9';c=getchar());
	a=c-'0';
	for(c=getchar();c>='0'&&c<='9';c=getchar())
		a=a*10+c-'0';
}
inline bool ok()
{
	for(int i=1;i<=2*n-1;i++)
		if(a[i]<=mid)
			b[i]=0;
		else
			b[i]=1;
	if(b[n]==0&&(b[n-1]==0||b[n+1]==0))
		return true;
	if(b[n]==1&&(b[n-1]==1||b[n+1]==1))
		return false;
	for(int i=n,j=n;i>1&&j<2*n-1;i--,j++)
	{
		if(b[i]==0&&b[i-1]==0)
			return true;
		if(b[i]==1&&b[i-1]==1)
			return false;
		if(b[j]==0&&b[j+1]==0)
			return true;
		if(b[j]==1&&b[j+1]==1)
			return false;
	}
	return !b[1];
}
int main()
{
	get(n);
	for(int i=1;i<=2*n-1;i++)
		get(a[i]);
	l=1,r=2*n-1;
	while(l<=r)
	{
		mid=(l+r)/2;
		if(ok())
			r=mid-1;
		else
			l=mid+1;
	}
	printf("%d\n",r+1);
	return 0;
}

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

using namespace std;

string a,b="CODEFESTIVAL2016";
int ans;

int main(void)
{
	ios::sync_with_stdio(false);
	getline(cin,a);
	for(int i=0;i<a.length();i++)
	{
		if(a[i]!=b[i])
		{
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
if(n[0] >= n[1]):
  print(0)
else:
	k=1
	kyori=list()
	while k < n[1]: 
	  sa=i[k]-i[k-1]
	  kyori.append(sa)
	  k=k+1
	kyori.sort()
	mm=1
	owari=n[1]-n[0]
	kyori=kyori[0:owari]
	idou=sum(kyori)
	print(idou)

Measured memory_bytes: 13968
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.functional;

void main() {
    char[] s = readln.chomp.to!(char[]);
    int n = s.length.to!int;

    bool[] app = new bool[](26);

    foreach (ch ; s) {
        app[ch - 'a'] = 1;
    }

    debug {
        writeln("app:", app);
    }

    if (app.sum == 1) {
        writeln(0);
        return;
    }

    int ans = 200;

    foreach (alp ; 0 .. 26) {
        if (!app[alp]) continue;

        auto sc = s.dup;
        int cnt;

        debug {
            writeln((alp + 'a').to!char);
        }

        foreach (i ; 0 .. n - 1) {
            foreach (j ; 0 .. n - 1 - i) {
                if (sc[j + 1] == (alp + 'a')) {
                    sc[j] = sc[j + 1];
                }
            }

            debug {
                writeln("sc:", sc);
            }

            bool flag = true;

            foreach (j ; 0 .. n - 1 - i - 1) {
                if (sc[j] != sc[j + 1]) {
                    flag = false;
                }
            }

            cnt++;

            if (flag) {
                break;
            }
        }

        ans = min(ans, cnt);
    }

    writeln(ans);
}

void scan(T...)(ref T args) {
    auto line = readln.split;
    foreach (ref arg ; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

Measured memory_bytes: 256
num = int(input())
fibtbl = [ 0 for x in range(50)]
fibtbl[0] = 1
fibtbl[1] = 1

def fib(n):
    global fitbl
    
    if n == 0:
        return 1
    if n == 1:
        return 1
    
    if fibtbl[n-1] != 0:
        p = fibtbl[n-1]
    else:
        p = fib(n-1)
    
    if fibtbl[n-2] != 0:
        pp = fibtbl[n-2]
    else:
        pp = fib(n-2)
    
    fibtbl[n] = p + pp
    return p + pp
    

print(fib(num))


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

int main() {
  string n;
  cin>>n;
  if((n[0]==n[1]&&n[1]==n[2])||(n[1]==n[2]&&n[2]==n[3]))
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map { it.toInt() }
    val B = readLine()!!.split(" ").map { it.toInt() }
    val C = readLine()!!.split(" ").map { it.toInt() }

    println(B(n, A, B, C))
}

fun B(n: Int, a: List<Int>, b: List<Int>, c: List<Int>): Int {
    var manzoku = 0

    a.withIndex().forEach {
        manzoku += b[it.value-1]
        if (it.index != 0 && (a[it.index-1]+1 == a[it.index])) {
            manzoku += c[a[it.index-1] - 1]
        }
    }

    return manzoku
}

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

using namespace std;

int main(){
    int a,b,c,x,y;
    int64_t value = 1000000000;
    cin >> a >> b >> c >> x >> y;
    for(int i = 0;i <= 2*max(x,y);i+=2){
        int a_,b_;
        if(x-(i/2) >= 0){
            a_ = x-(i/2);
        }else{
            a_ = 0;
        }
        if(y-(i/2) >= 0){
            b_ = y-(i/2);
        }else{
            b_ = 0;
        }
        value = min(value,(int64_t)(a_*a+b_*b+c*i));
    }
    cout << value;
    return 0;
}

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


#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T, class T2> void amax(T& a,T2 b){ if(a < b) a = b;}
typedef pair<ll, ll> pll;

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int k;
	cin >>k;
	
	vector<vector<pii>> r(k);
	rep(i, k){
		r[i].emplace_back((i+1)%k, 1);
		r[i].emplace_back((i*10)%k, 0);
	}
	
	typedef pair<ll, int> pli;
	const ll INF = 1e18;
	priority_queue< pli, vector<pli>, greater<pli> > que;
	vector<ll> d(k, INF);
	d[1] = 1;
	que.emplace(1, 1);
	while(!que.empty()){
		ll cost; int v; tie(cost, v) = que.top(); que.pop();
		if(d[v] < cost) continue;
		for(const auto& rp : r[v]){ 
			int rto = rp.first;
			ll ncst = d[v] + rp.second;
			if(d[rto] > ncst){
				d[rto] = ncst; que.emplace(ncst, rto);
			}
		}
	}	
	cout <<d[0] <<"\n";
	return 0;
}


Measured memory_bytes: 7672
// AOJ 1181: Biased Dice
// 2017.12.22 bal4u@uu

#include <stdio.h>
#include <string.h>

#define MAX  8
#define BASE 4
#define S 2
#define E 3
#define W 4
#define N 5

char map[MAX+1][MAX+1];
int  h[MAX+1][MAX+1];
char dice[7][7][7] = {{{0},{0},{0},{0},{0},{0},{0}},
	{{0},{0},{0,1,2,3,4,5,6},{0,1,3,5,2,4,6},{0,1,4,2,5,3,6},{0,1,5,4,3,2,6},{0}},
	{{0},{0,2,1,4,3,6,5},{0},{0,2,3,1,6,4,5},{0,2,4,6,1,3,5},{0},{0,2,6,3,4,1,5}},
	{{0},{0,3,1,2,5,6,4},{0,3,2,6,1,5,4},{0},{0},{0,3,5,1,6,2,4},{0,3,6,5,2,1,4}},
	{{0},{0,4,1,5,2,6,3},{0,4,2,1,6,5,3},{0},{0},{0,4,5,6,1,2,3},{0,4,6,2,5,1,3}},
	{{0},{0,5,1,3,4,6,2},{0},{0,5,3,6,1,4,2},{0,5,4,1,6,3,2},{0},{0,5,6,4,3,1,2}},
	{{0},{0},{0,6,2,4,3,5,1},{0,6,3,2,5,4,1},{0,6,4,5,2,3,1},{0,6,5,3,4,2,1},{0}}};

int mv[7][2] = {{0},{0},{1,0},{0,1},{0,-1},{-1,0},{0}};
int ans[7];

int main()
{
	int n, i, t, f, r, c, d, x, max;
	int r2, c2, t2, f2;

	while (scanf("%d", &n) && n > 0) {
		memset(h, 0, sizeof(h));
		for (i = 0; i < n; i++) {
			r = c = BASE;
			scanf("%d%d", &t, &f);
			while (h[r][c]) {
				for (max = 6; max >= 4; max--) for (d = 2; d <= 5; d++) {
					if (dice[t][f][d] == max) {
						r2 = r + mv[d][0], c2 = c + mv[d][1];
						if (h[r2][c2] < h[r][c]) goto next;
					}
				}
				break;

next:			x = dice[t][f][3];
				if      (d == S) t2 = 7-f, f2 = t;
				else if (d == E) t2 = 7-x, f2 = f;
				else if (d == W) t2 = x,   f2 = f;
				else /* d== N */ t2 = f,   f2 = 7-t;
				r = r2, c = c2, t = t2, f = f2;
			}
			map[r][c] = t, h[r][c]++;
		}

		memset(ans, 0, sizeof(ans));
		for (r = 0; r < MAX; r++) for (c = 0; c < MAX; c++)
			if (h[r][c] > 0) ans[map[r][c]]++;

		printf("%d", ans[1]);
		for (i = 2; i <= 6; i++) printf(" %d", ans[i]);
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 1804
#include<bits/stdc++.h>
typedef long long ll;
const ll mod=1e9+7;
using namespace std;
char mp[330][330];
int boom[330];
int dp[330][330];
int main()
{
    int h,w,k;
    cin>>h>>w>>k;
    int t=1;
    for(int i=0; i<h; i++)
        for(int j=0; j<w; j++)
        {
            cin>>mp[i][j];
            if(mp[i][j]=='#')
                boom[i]++,dp[i][j]=t,t++;
        }
    for(int i=0; i<h; i++)
    {
        if(boom[i]!=0)
        {
            for(int j=0; j<w; j++)
            {
                if(mp[i][j]=='#')
                {
                    for(int u=0; u<j; u++)
                        dp[i][u]=dp[i][j];
                    break;
                }

            }
        }
    }
    for(int i=0; i<h; i++)
    {
        if(boom[i]!=0)
        {
            for(int j=0; j<w; j++)
            {
                if(dp[i][j]==0)
                    dp[i][j]=dp[i][j-1];
            }

        }
    }

    for(int i=0; i<w; i++)
    {
        for(int j=0; j<h; j++)
        {
            if(dp[j][i]!=0)
            {
                for(int u=0;u<j;u++)
                    dp[u][i]=dp[j][i];
                break;
            }
        }
    }
    for(int i=0; i<w; i++)
    {
        for(int j=0; j<h; j++)
        {
            if(dp[j][i]==0)
                dp[j][i]=dp[j-1][i];
        }
    }


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


    return 0;
}


Measured memory_bytes: 4060
import java.util.Scanner;

public class Main {

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

        for(int i=0; i<N; i++){
        	blue[i] = new String(sc.next());
        }
        
        int M = sc.nextInt();
        String[] red = new String[M];
        for(int i=0; i<M; i++){
        	red[i] = new String(sc.next());
        }
        
        int count = 0;
        int max = 0;
        for(int i=0; i<N; i++){
        	count = 0;
        	String one = blue[i];
        	for(int j=0; j<N; j++){
        		if(blue[j].equals(one)){
        			count++;
        		}
        	}
        	for(int j=0; j<M; j++){
        		if(red[j].equals(one)){
        			count--;
        		}
        	}
        	
        	if(count > max)
        		max = count;
        }
        System.out.println(max);

	}

}


Measured memory_bytes: 21844
#include <stdio.h>
int main(void){
	int n,k,t,i;
	int a[11][7]={
					{0,1,1,1,1,1,1},
					{0,0,0,0,1,1,0},
					{1,0,1,1,0,1,1},
					{1,0,0,1,1,1,1},
					{1,1,0,0,1,1,0},
					{1,1,0,1,1,0,1},
					{1,1,1,1,1,0,1},
					{0,1,0,0,1,1,1},
					{1,1,1,1,1,1,1},
					{1,1,0,1,1,1,1},
					{0,0,0,0,0,0,0}
				};
	while(1){
		scanf("%d",&n);
		if(n==-1)break;
		t=10;
		while(n--){
			scanf("%d",&k);
			for(i=0;i<7;i++){
				if(a[k][i]==a[t][i]){
					printf("0");
				}
				else{
					printf("1");
				}
			}
			putchar('\n');
			t=k;
		}
	}
	return 0;
}

Measured memory_bytes: 576
#ABC129-B
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
n=I()
W=IL()
ans=10*10
for t in range(1,n):
    s1,s2=0,0
    for i in range(n):
        if i<=t:
            s1+=W[i]
        else:
            s2+=W[i]
    ans=min(ans,abs(s1-s2))
print(ans)

Measured memory_bytes: 41020
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
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 FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

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

string best(string a, string b) {
	if(a.length() < b.length()) {
		return b;
	}
	if(a.length() == b.length() && b < a) {
		return b;
	}
	return a;
}

int main() {
	int h, w;
	while(cin >> h >> w, h) {
		vs field(h);
		REP(i, h) {
			cin >> field[i];
		}

		map<string, int> times;
		string ans;
		REP(i, h) {
			REP(j, w) {
				vvi visited(h, vi(w, -1));
				REP(d, 8) {
					string tmp;
					int y = i, x = j;
					while(visited[y][x] != d) {
						tmp += field[y][x];
						visited[y][x] = d;
						times[tmp]++;
						if(times[tmp] > 1) {
							ans = best(ans, tmp);
						}
						y = (y+dy[d]+h)%h;
						x = (x+dx[d]+w)%w;
					}
					
				}
			}
		}

		if(ans.length() < 2) {
			cout << 0 << endl;
		} else {
			cout << ans << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 36052
#include<iostream>
using namespace std;
int main(){
	string s;
	cin>>s;
	int x=0,y=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='0'){
			x++;
		}else{
			y++;
		}
	}
	x=(x<y)?x:y;
	cout<<2*x<<endl;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>

using namespace std;

#define int long long

const int N = 2e5 + 10;

char a[N];

int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);    
  int n;
  cin >> n;
  int red = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    red += a[i] == 'R';
  }
  int ans = 0;
  for (int i = 0; i < red; ++i) {
    ans += a[i] == 'W';
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 3804
#include<iostream>
#define ll long long
#define REP(i,n) for(int(i)=0;(i)<(n);(i)++)
using namespace std;

int main(){
  ll A,B,K;
  cin>>A>>B>>K;
  if(K<=A)cout << A-K << " " << B;
  else if(K <= A+B){ cout << 0 << " " << B-(K-A) <<endl; }
  else{ cout << 0 << " " << 0 <<endl; } 
  return 0;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
a, b = [], []
for i in range(n):
    a.append(input())
for i in range(m):
    b.append(input())
for i in range(n - m + 1):
    for j in range(len(a[0]) - len(b[0]) + 1):
        for k in range(m):
            # print()
            # print(a[i+k][j:(j+m)])
            # print(b[k])

            if a[i+k][j:(j+m)] != b[k]:
                # print('break')
                break
            # else:
                # print('pass')
            if k == m-1:
                print('Yes')
                quit()
print('No')

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll = long long;
using R = long double;
const R EPS = 1e-9; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max<R>(x, 0.0));}

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

// Problem Specific Parameter:

//Appropriately Changed
using W = ll;
using edge = struct {int to, rev; W cap, flow, cost;};
using G = vector<vector<edge>>;

//Appropriately Changed
void add_edge(G &graph, int from, int to, W cap, W cost) {
	graph[from].push_back({to, int(graph[to].size()) , cap , 0 , cost});
	graph[to].push_back({from, int(graph[from].size()) - 1, 0 , 0, -cost});
}

// Description: ??°??????????????????????°??????¨???
// TimeComplexity: $ \mathcal{O}(FEV) $
// Verifyed: AOJ GRL_6_B

W primal_dual(G &graph, int s, int t, int f) {
	const W inf = 1LL << 50;
	W res = 0;
	while (f) {
		int n = graph.size(), update;
		vector<W> dist(n, inf);
		vector<int> pv(n, 0), pe(n, 0);
		dist[s] = 0;

		rep(loop, n) {
			update = false;
			rep(v, n)rep(i, graph[v].size()) {
				edge &e = graph[v][i];
				if (e.cap > e.flow and chmin(dist[e.to], dist[v] + e.cost)) {
					pv[e.to] = v, pe[e.to] = i;
					update = true;
				}
			}
			if (!update) break;
		}

		if (dist[t] == inf) return -1;

		W d = f;
		for (int v = t; v != s; v = pv[v]) chmin(d, graph[pv[v]][pe[v]].cap - graph[pv[v]][pe[v]].flow);
		f -= d, res += d * dist[t];

		for (int v = t; v != s; v = pv[v]) {
			edge &e = graph[pv[v]][pe[v]];
			e.flow += d;
			graph[v][e.rev].flow -= d;
		}
	}
	return res;
}

int main(void) {
	int v, e, f;
	cin >> v >> e >> f;
	G graph(v);

	rep(i, e) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		add_edge(graph, a, b, c, d);
	}

	cout << primal_dual(graph, 0, v - 1, f) << endl;
	return 0;
}

Measured memory_bytes: 3260
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Math;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine();
            var a = Console.ReadLine().Split().Select(long.Parse).ToList();

            a = a.OrderBy(x=>Abs(x)).ToList();

            Console.WriteLine(Abs(a.Last()) - Abs(a.First()));
        }
    }
}


Measured memory_bytes: 13524
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
	int n;
	cin >> n;
	vi l(n);
	rep(i, n) cin >> l[i];
	sort(l.begin(), l.end());

	ll ans = 0;
	for(int i = 0; i < n - 2; i++) {
		for(int j = i + 1; j < n - 1; j++) {
			auto ri = upper_bound(l.begin() + j + 1, l.end(), l[i] + l[j] - 1);
			auto li = lower_bound(l.begin() + j + 1, l.end(), l[j] - l[i] + 1);
			ans += ri - li;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
// Problem : A - Don't be late
// Contest : AtCoder - AtCoder Beginner Contest 177
// URL : https://atcoder.jp/contests/abc177/tasks/abc177_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//#pragma GCC optimize "trapv"//  WA to RE int!!
#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORR(i,n) for(int i=n;i>=0;i--)
#define pb push_back
#define vint vector<int>
#define sint set<int>
#define mint map<int,int>
#define pint pair< int,int >
#define int long long int 
#define test int tt1234; cin>>tt1234;while(tt1234--)
#define endl "\n"
#define SI(a,n) int a[n];FOR(i,n) cin>>a[i];
#define input(a,n) int n;cin>>n; SI(a,n)
#define all(zz) zz.begin(),zz.end()
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define error(x) cerr << #x <<" is " << x << endl;
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";
#define precision(x) cout<<fixed<<setprecision(x);
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define present(container, element) (container.find(element)!=container.end())
#define fint fast;test
#define set(a,x) memset(a,x,sizeof(a))
#define L(x)	((x)<<1)
#define R(x)	(((x)<<1)+1)
#define ft first
#define se second
#define MOD 1000000007
using namespace std;
template<typename... T> void rd(T&... args) { ((cin >> args), ...); }
template<typename... T> void pp(T... args) { ((cout << args << " "), ...); cout<<"\n"; }

void solve(){
	int d,t,s;
	rd(d,t,s);
	int time=ceil((d*1.0)/s)	;
	if(t>=time){
		pp("Yes");
	}
	else pp("No");
	return;	
}


int32_t main() {
    // fint{
    	fast;
    	solve();
    // }
    return 0;
}


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

using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int d = a%b;
	if (d == 0)
	{
		if (d != c) cout << "NO" << endl;
		else cout << "YES" << endl;
		return 0;
	}
	else
		while (d != c)
		{
			d = (d+a)%b;
			if (d == a%b)
			{
				cout << "NO" << endl;
				return 0;
			}
		}
	cout << "YES" << endl;
	return 0;
}


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

using namespace std;

#define llong long long int
#define ldouble long double
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) x.begin(), x.end()
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)

const static int MOD = 1000000000 + 7;
const static llong INF = 1LL << 60;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};

template<typename T> T my_gcd(T a, T b) {
    return (a ? my_gcd(b % a, a) : b);
}

template<typename T> T my_lcm(T a, T b){
	return a * b / my_gcd(a, b);	
}

struct UF {
    vector<int> par, sz;

    UF(int n) {
        par.resize(n);
        sz.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            sz[i] = 1;
        }
    }

    int find_root(int x) {
        return par[x] == x ? x : par[x] = find_root(par[x]);
    }

    bool same(int x, int y) {
        return find_root(x) == find_root(y);
    }

    void unite(int x, int y) {
        x = find_root(x);
        y = find_root(y);
        if (x == y) return;
        
        if (sz[x] < sz[y]) swap(x, y);
        sz[x] += sz[y];
        par[y] = x;
    }
};

const static int N = 55555;
int arr[N];
vector<int> primes;
void Eratosthenes(){
	for(int i = 0; i < N; i++){
		arr[i] = 1;
	}
	for(int i = 2; i < sqrt(N); i++){
		if(arr[i]){
			for(int j = 0; i * (j + 2) < N; j++){
				arr[i *(j + 2)] = 0;
			}
		}
    }

	for(int i = 2; i < N; i++){
		if(arr[i]){
            primes.push_back(i);
		}
	}
}

signed main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    Eratosthenes();

    vector<bool> check(N, false);
    rep(i, 11110) {
        check[5 * (i + 1) + 1] = true;
    }

    vector<int> ans;
    for (int i = 0; i < primes.size(); ++i) {
        if (check[primes[i]]) ans.push_back(primes[i]);
        if (ans.size() == n) break;
    }

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

    return 0;
}

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

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int a, b;
    cin >> a >> b;
    cout << max(a-2*b, 0) << endl;
}


Measured memory_bytes: 256
d,g=map(int,input().split())
pc=[list(map(int,input().split())) for _ in range(d)]

p_num=[]
for p,c in pc:
    p_num.append(p)

ans = 10**9
def dfs(i,cnt,point,rem_ans):
    global ans
    if i == d:
        if point < g:
            use = max(rem_ans)
            n = min(pc[use-1][0], -(-(g-point)//(use*100)))
            cnt += n 
            point += n * use * 100

        if point >= g:
            ans = min(ans,cnt)

    else:
        dfs(i+1,cnt,point,rem_ans)
        dfs(i+1,cnt+pc[i][0],point+pc[i][0]*(i+1)*100 + pc[i][1],rem_ans - {i+1})

dfs(0,0,0,set(range(1,d+1)))    
print(ans)


Measured memory_bytes: 3064
//2020-05-18

#include <iostream>
#include <vector>
using namespace std;


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

    int n;
    cin >> n;
    
    vector<int> hon = {2,4,5,7,9};

    
    if (find(hon.begin(),hon.end(), n%10) != hon.end()){
        cout << "hon";
    }
    else if (n%10 == 3){
        cout << "bon";
    }
    else{
        cout << "pon";
    }
    
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

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

	ll n, k;
	cin >> n >> k;
	
	vl a(n);
	FOR(i,0,n) cin >> a[i];

	vl s(n+1);
	FOR(i,0,n) s[i+1] = (s[i] + a[i] - 1) % k;
	
	ll res = 0;
	map<ll,ll> cnt;
	FOR(i,0,n+1) {
		if (i >= k) cnt[s[i-k]]--;
		res += cnt[s[i]];
		cnt[s[i]]++;
	}
	cout << res << endl;
}



Measured memory_bytes: 15872
def factorial(x, mod=10**9+7):
    v = 1
    for i in range(2, x+1):
        v *= i
        v %= mod
    return v


N, M = map(int, input().split())

if abs(N-M) > 1:
    print(0)
    exit()

mod = 10**9 + 7
if N == M:
    ans = (factorial(N) * factorial(M) * 2) % mod
else:
    ans = (factorial(N) * factorial(M)) % mod

print(ans)

Measured memory_bytes: 62892
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

ll M = 1000000007;

ll modpow(ll x,ll k){
	if(k == 0)return 1;
	ll ret = modpow(x,k/2);
	ret *= ret; ret %= M;
	if(k%2 == 1){ ret *= x; ret %= M; }
	return ret;
}

int main(){
	ll n,x,y,z;
	cin >> n >> x >> y >> z;
	
	int a[12];
	rep1(i,10){
		a[i] = 0;
		for(int j = i ; j <= x ; j ++){
			a[i] += 1 << (j-1);
		}
		for(int j = x+i ; j <= x+y ; j ++){
			a[i] += 1 << (j-1);
		}
		for(int j = x+y+i ; j <= x+y+z ; j ++){
			a[i] += 1 << (j-1);
		}
	}
	
	static ll ret = 0;
	static ll dp[42][1<<16] = {};
	dp[0][0] = 1;
	rep(ppp,n){
		rep(i,(1<<(x+y+z-1))){
			rep1(j,10){
				int nex = ((i<<j)+(1<<(j-1))) & a[j];
				if(nex >= (1<<(x+y+z-1))){
					ret += dp[ppp][i] * modpow(10,n-1-ppp);
					ret %= M;
				}
				else {
					dp[ppp+1][nex] += dp[ppp][i];
					dp[ppp+1][nex] %= M;
				}
			}
		}
	}
	
	cout << ret << endl;
}
				



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

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

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

	string s,t; cin >> s >> t;

	sort(s.begin(), s.end()); sort(t.begin(),t.end(), greater<char>());

	cout << (s<t ? "Yes": "No") << endl;

	return 0;

}


Measured memory_bytes: 256