akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

int n;
vector<vector<P>> vvp;

int main() {
	while (cin >> n&&n) {
		vvp.clear();
		rep(i, n + 1) {
			int m;
			cin >> m;
			ll x, y;
			ll px = 10000, py = 10000;
			vector<P> vp;
			rep(j, m) {
				cin >> x >> y;
				if (j != 0) {
					if (px == x) {
						if (py < y)vp.push_back(P(0, y - py));
						else vp.push_back(P(2, py - y));
					}
					else {
						if (px < x)vp.push_back(P(1, x - px));
						else vp.push_back(P(3, px - x));
					}
				}
				px = x, py = y;
			}
			vvp.push_back(vp);
			if (i == 0) {
				rep(j, vp.size()) {
					vp[j].first = (vp[j].first + 2) % 4;
				}
				reverse(ALL(vp));
				vvp.push_back(vp);
			}
		}
		//rep(i, vvp.size()) {
		//	cout << "!" << i << endl;
		//	rep(j, vvp[i].size()) {
		//		cout << vvp[i][j].first << " " << vvp[i][j].second << endl;
		//	}
		//	cout << endl;
		//}
		FOR(i, 2, vvp.size()) {
			if (vvp[0].size() != vvp[i].size())continue;
			bool f = 0;
			rep(k, 4) {
				bool f1 = 1, f2 = 1;
				rep(j, vvp[i].size()) {
					if ((vvp[0][j].first + k) % 4 != vvp[i][j].first
						|| vvp[0][j].second != vvp[i][j].second)f1 = 0;
				}
				rep(j, vvp[i].size()) {
					if ((vvp[1][j].first + k) % 4 != vvp[i][j].first
						|| vvp[1][j].second != vvp[i][j].second)f2 = 0;
				}
				if (f1 || f2)f = 1;
			}
			if (f)cout /*<< "!!!!!"*/ << i - 1 << endl;
		}
		cout << "+++++" << endl;
	}
}


Measured memory_bytes: 3028
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int h,n;
	vector<int> a;
	vector<int> b;
ll mp[10000+1][1000+1];
ll dp(int rh,int i){
	if(rh<=0) return 0;
	if(i==n and rh>0) return INT_MAX;
	if(mp[rh][i]!=-1) return mp[rh][i];
	mp[rh][i]=min(dp(rh,i+1),b[i]+dp(rh-a[i],i));
	return mp[rh][i];
}
int main(){
	memset(mp,-1,sizeof(mp));
	cin>>h>>n;
a.resize(n);
b.resize(n);
	for(int i=0;i<n;++i) cin>>a[i]>>b[i];
	cout<<dp(h,0);
	return 0;
}

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

int main(){
  int n,t;
  scanf("%d%d",&n,&t);
  vector<string> name;
  vector<int> stay;
  int prv = 0;

  for(int i=0;i<n;i++){
    int h1,m1,h2,m2;
    string name1, name2;
    scanf("%d:%d",&h1,&m1);
    m1 += h1*60;
    cin >> name1;

    scanf("%d:%d",&h2,&m2);
    m2 += h2*60;
    cin >> name2;

    if(i>0 && m1-prv>=t){
      name.push_back(name1);
      stay.push_back(m1-prv);
    }
    prv = m2;
  }

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

Measured memory_bytes: 1256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

struct edge {
    int from, to, cost;
};

int main() {
    vector<edge> edges;
    int n, m, r;
    cin >> n >> m >> r;
    rep(i, 0, m) {
        int s, t, d;
        cin >> s >> t >> d;
        edge tmp = {s, t, d};
        edges.push_back(tmp);
    }
    vector<int> dist(n, INF);
    dist[r] = 0;
    rep(v, 0, n) {
        for (auto e : edges) {
            if (dist[e.from] == INF) continue;
            if (dist[e.to] > dist[e.from] + e.cost) {
                if (v == n - 1) {
                    cout << "NEGATIVE CYCLE" << endl;
                    return 0;
                }
                dist[e.to] = dist[e.from] + e.cost;
            }
        }
    }
    rep(i, 0, n) {
        if (dist[i] == INF) cout << "INF" << endl;
        else cout << dist[i] << endl;
    }
    return 0;
}



Measured memory_bytes: 3176
#include <bits/stdc++.h>
#define rgi register int
using namespace std;
int n;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n;
	if(n==0)
		cout<<"0"<<endl;
	if(n&1)
		cout<<(n>>1)<<endl;
	else
		cout<<((n-1)>>1)<<endl;
	return 0;
}

Measured memory_bytes: 512
#define DEBUG 0

/**
 * File    : B.cpp
 * Author  : Kazune Takahashi
 * Created : 2019-5-26 23:44:12
 * Powered by Visual Studio Code
 */

#include <iostream>
#include <iomanip>   // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set>
#include <functional>
#include <random> // auto rd = bind(uniform_int_distribution<int>(0, 9), mt19937(10101010));
#include <chrono> // std::chrono::system_clock::time_point start_time, end_time;
// start = std::chrono::system_clock::now();
// double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end_time-start_time).count();
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

typedef long long ll;

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

// const int C = 1e6+10;
// const ll M = 1000000007;

int N;
typedef tuple<string, int, int> res;
vector<res> V;

int main()
{
  cin >> N;
  for (auto i = 1; i <= N; i++)
  {
    string s;
    int p;
    cin >> s >> p;
    V.emplace_back(s, -p, i);
  }
  sort(V.begin(), V.end());
  for (auto i = 0; i < N; i++)
  {
    string s;
    int p, id;
    tie(s, p, id) = V[i];
    cout << id << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int num;
  int M;
  
  cin>>num;
  cin>>M;
  int hiretu[num];
  int sum=0;//合計値
  int kanou=0;
  for(int n=0;n<num;n++){
    cin>>  hiretu[n];
  	sum+=hiretu[n];
  }
  for(int i=0;i<num;i++){
     if(hiretu[i]>=sum/(M*4.0)&&kanou<M){
       kanou++;
     }
    if(kanou>=M){
       cout<<"Yes"<<endl;
       break;
     }
       
  }
  if(kanou<M){
    cout<<"No"<<endl;
  }
 
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)

typedef long long lint;

const lint MOD = (lint)1e9 + 7;

lint gcd(lint _a, lint _b) {
	return _b != 0 ? gcd(_b, _a % _b) : _a;
}

lint lcm(lint _a, lint _b) {
	return _a / gcd(_a, _b) * _b;
}

typedef pair< lint, lint > Val;

class SegTree {
private:
	int t_size;
	vector< Val > data;
	
	int right_t(int k) {
		return 2 * k + 2;
	}
	
	int left_t(int k) {
		return 2 * k + 1;
	}
	
public:
	SegTree(int size_) {
		t_size = 1;
		while (t_size < size_) t_size *= 2;
		data.assign(2 * t_size - 1, Val(1, 0));
	}
	
	Val calculation(Val v1, Val v2) {
		lint vf1 = v1.first, vf2 = v2.first;
		lint lcm_ = lcm(vf1, vf2);
		lint mul1 = lcm_ / vf1 % MOD, mul2 = lcm_ / vf2 % MOD;
		return Val(lcm_, (mul1 * v1.second + mul2 * v2.second) % MOD);
	}
	
	void update(int k, Val v) {
		k += t_size - 1;
		data[k] = v;
		
		while (k > 0) {
			k = (k - 1) / 2;
			data[k] = calculation(data[left_t(k)], data[right_t(k)]);
		}
	}
	
	Val query(int a, int b) {
		return query(a, b, 0, 0, t_size);
	}
	
	Val query(int a, int b, int k, int l, int r) {
		if (r <= a || b <= l) return Val(1, 0);
		if (a <= l && r <= b) return data[k];
		return calculation(query(a, b, left_t(k), l, (l + r) / 2),
						   query(a, b, right_t(k), (l + r) / 2, r));
	}
};

int main() {
	int N, Q;
	cin >> N >> Q;
	
	vector< int > p(N), x(N);
	
	for_(i,0,N) {
		cin >> p[i]; --p[i];
		x[i] = i;
	}
	
	SegTree segt(N);
	
	vector< int > hit(N, 0), sum(N, 0);
	
	for_(i,1,41) {
		vector< int > y(N);		
		for_(j,0,N) y[j] = p[x[j]];
		
		for_(j,0,N) {
			x[j] = y[j];
			sum[j] += x[j] + 1;
			
			if (x[j] == j && hit[j] == 0) {
				segt.update(j, Val(i, sum[j]));
				hit[j] = 1;
			}
		}
	}
	
	for_(i,0,Q) {
		int l, r;
		cin >> l >> r;
		
		Val ans = segt.query(l-1,r);
		
		cout << ans.second << endl;
	}
	
	return 0;
}

Measured memory_bytes: 7048
#include <bits/stdc++.h>
using namespace std;
#define MAX (1000000)

struct UF{
    int N, K;
    int p[MAX], rank[MAX];
    UF(int N, int K){
        this->N = N;
        this->K = K;
        for(int i = 0; i < N; i++){
            p[i] = i;
            rank[i] = 0;
        }
    }
    int find(int i){
        if(p[i] == i) return i;
        else return p[i] = find(p[i]);
    }
    bool same(int i, int j){
        return find(i) == find(j);
    }
    void unite(int i, int j){
        int x = find(i), y = find(j);
        if(x == y) return;
        if(rank[x] > rank[y]){
            p[y] = x;
        }else{
            p[x] = y;
            if(rank[x] == rank[y]) rank[y]++;
        }
    }
};

int main(void){
    int N, K, L;
    cin >> N >> K >> L;
    UF road(N, K), rail(N, L);
    for(int i = 0; i < K; i++){
        int p, q; cin >> p >> q;
        p--; q--;
        road.unite(p, q);
    }
    for(int i = 0; i < L; i++){
        int p, q; cin >> p >> q;
        p--; q--;
        rail.unite(p, q);
    }
    map<pair<int, int>, int> m;
    for(int i = 0; i < N; i++){
        pair<int, int> p = pair<int, int>(road.find(i), rail.find(i));
        if(m.find(p) == m.end()){
            m[p] = 1;
        }else{
            m[p]++;
        }
    }
    for(int i = 0; i < N; i++){
        if(i != 0) cout << " ";
        cout << m[pair<int, int>(road.find(i), rail.find(i))];
    }
    cout << endl;
}


Measured memory_bytes: 15104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

ll a, b, n;

int main() {
	fastio; cin >> a >> b >> n;
	ll mul = min(b-1, n);
	cout << (a*mul)/b;
}


Measured memory_bytes: 3616
import fractions
from collections import deque
import numbers as np


def main():
    n = int(input())
    p = list(map(int, input().split()))
    cnt = 0
    for i in range(1, n-1):
        if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Measured memory_bytes: 5600
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Graph vector<vector<int>>
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;

vector<ll> F, R;

ll power(ll m, ll n){
    if(n == 0) return 1;
    if(n % 2 == 1) return m * power(m, n - 1) % INF;
    ll tmp = power(m, n/2);
    return tmp * tmp % INF;
}

void fac(int N){
    F.assign(N + 1, 1);
    R.assign(N + 1, 1);
    for(ll i = 1; i <= N; i++){
        F[i] = F[i - 1] * i % INF;
        R[i] = power(F[i], INF - 2);
    }
}

ll com(ll m, ll n){
    if(m < 0 || n < 0 || m < n) return 0;
    ll tmp = F[m];
    tmp *= R[n];
    tmp %= INF;
    tmp *= R[m - n];
    tmp %= INF;
    return tmp;
}

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

    for(ll i = 1; i <= K; i++){
        cout << com(K - 1, i - 1) * com(N - K + 1, i) % INF << endl; 
    }
 
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            new ABC127().SolveB(new ConsoleInput(Console.In, ' '));
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
  class ABC127
    {
    	public void SolveB(ConsoleInput cin)
        {
            var r = cin.ReadInt;
            var d = cin.ReadInt;
            var x = new ArrayList();
            x.Add(cin.ReadInt);
            for (int i = 0; i < 10; i++)
            {
                x.Add((int)x[i] * r - d);
            }
            for(int i = 1; i <= 10; i++)
            {
                WriteLine(x[i]);
            }
            ReadLine();
        }
    }
}


Measured memory_bytes: 11348
import java.io.*;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    /*public static StreamTokenizer in;
    static {
        try{
            in = new StreamTokenizer(new BufferedReader(new InputStreamReader(new BufferedInputStream(System.in))));
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    public static int nextInt() throws IOException{ in.nextToken(); return (int)in.nval; }*/
    public static void main(String[] args) throws IOException{
        Scanner sc=new Scanner(new BufferedInputStream(System.in));
        String a=sc.next();
        if(a.equals("ABC"))
            System.out.println("ARC");
        else System.out.println("ABC");

    }
}


Measured memory_bytes: 35664
n = gets.to_i

arr = gets.split.map(&:to_i)

puts arr.join(' ')

1.upto(n - 1) do |i|
  v = arr[i]
  j = i - 1

  while j >= 0 && arr[j] > v
    arr[j + 1] = arr[j]
    j -= 1
  end

  arr[j + 1] = v

  puts arr.join(' ')
end

Measured memory_bytes: 8748
#include<bits/stdc++.h>
using namespace std;
int n,k;
int dp[100];
int y;int ans=INT_MAX;
void fun(int i,int y)
{
    if(i==n) {

        ans=min(ans,y);

        return ;
    }

    fun(i+1,2*y);
    fun(i+1,y+k);

}

int main()
{

cin>>n>>k;

fun(0,1);
cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m; cin >> n >> m;
  int count=0;
  for(int i=0; i<m; i++){
    int data; cin >> data;
    count += data;
  }
  if(count>n) cout << -1 << endl;
  else cout << n-count << endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    int n;
    cin >> n;
    VI a(n), b(n), c(n-1);
    REP(i,n) a[i] = in() - 1;
    REP(i,n) b[i] = in();
    REP(i,n-1) c[i] = in();
    int ans = 0;
    REP(i,n) ans += b[a[i]];
    REP(i,n-1){
        if (a[i] + 1 == a[i + 1]) ans += c[a[i]];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#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/operators.hpp>
#include <boost/dynamic_bitset.hpp>
namespace adaptor = boost::adaptors;
using index_t = std::size_t;

namespace lib
{
	using graph_t = std::vector<std::set<index_t>>;
	template<class T>using weighted_graph_t = std::vector<std::map<index_t, T>>;

	struct max_t
	{
		template<class T>T operator()(T&& lhs, T&& rhs)const
		{
			return std::max(lhs, rhs);
		}
	};
	struct min_t
	{
		template<class T>T operator()(T&& lhs, T&& rhs)const
		{
			return std::min(lhs, rhs);
		}
	};

	template<class T>auto order_by(T func)
	{
		return [=](auto&& lhs, auto&& rhs)
		{
			return func(lhs) < func(rhs);
		};
	}

	template<class T>constexpr auto max_v = std::numeric_limits<T>::max();
	template<class T>constexpr auto min_v = std::numeric_limits<T>::min();
}

void Main()
{
	int K, A, B;
	std::cin >> K >> A >> B;
	for (auto i = A; i <= B; ++i)
	{
		if (i % K == 0)
		{
			std::cout << "OK" << std::endl;
			return;
		}
	}
	std::cout << "NG" << std::endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Measured memory_bytes: 3640
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <map>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
#define MOD 1000000007
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> p;
typedef vector<int> vi;
typedef map<string,int> ms;
int n,m,tmp=0,ans=0;
string tmp2;
ms blue;
ms red;
int main(int argc,char const* argv[])
{
  cin >> n;
  for(int i=0;i<n;i++)
    {
      string s;
      cin >> s;
      blue[s]++;
    }
  cin >> m;
  for(int i=0;i<m;i++)
    {
      string s;
      cin >> s;
      red[s]++;
    }
  for(auto itr=blue.begin();itr!=blue.end();itr++)
    {
      tmp2=itr->first;
      tmp=itr->second;
      auto itr2=red.find(tmp2);
      if(itr2 !=red.end())
	{
	  tmp-=red[tmp2];
	}
      if(tmp>ans) ans=tmp;
    }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
	#include<iostream>
	#include<map>
	#include<set>
	#include<vector>
	#include<cstring>
	#include<cassert>
	#include<sstream>
	#include<cmath>
	#include<algorithm>
	#include<queue>	
	#include<limits>
	#include<ctime>
	#include<stack>	
	#include<bits/stdc++.h>
	#include<string>
	#include<stdlib.h>
	#include<stdio.h>
		
	typedef long long ll;
	using namespace std;
	const ll x=1000000007;
	int mod(ll a){
		return a%x;
	}
	
	int main(){
		string s;
		ll k;
		cin>>s>>k;
		if(s[0]!='1'){
			cout<<s[0];
		}
		else{
			ll count=0,i=0;
			while(s[i]=='1'){
				count++;
				i++;
			}
			if(count>=k){
				cout<<'1';
			}
			else{
				cout<<s[i];
			}
		}
	}


Measured memory_bytes: 3632
import sys

h, w = map(int, input().split())
a_list = []

for i in range(h):
    tmp = input()
    if '#' in tmp:
        a_list.append(list(tmp))

del_list = []

for i in range(w):
    tmp = ''
    for j in a_list:
        tmp += j[i]
    if not '#' in tmp:
        del_list.append(i)

for i in del_list[::-1]:
    for j in range(len(a_list)):
        a_list[j].pop(i)

for i in a_list:
    print(''.join(i))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

int p[200001];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	string s; cin>>s; int n = s.length();
	for(int i=0;i<n;i++)
	{
		p[i] = s[i]-'0';
		if(i>0) p[i]^=(s[i-1]-'0');
	}
	p[n] = s[n-1]-'0';
	int lo = 1; int hi=n;int ans=1;
	while(lo<=hi)
	{
		int k=(lo+hi)>>1;

		deque<int> c1,c2;
		for(int i=0;i<=n;i++)
		{
			if(p[i])
			{
				if(i<=n-k) c1.pb(i);
				else c2.pb(i);
			}
		}
		bool pos=1;
		while(c2.size()>0)
		{
			if(c2.back()>=k)
			{
				c2.pop_back();
				if(!c1.empty())
				{
					if(c1.front()==0) c1.pop_front();
					else c1.push_front(0);
				}
				else
				{
					c1.push_front(0);
				}
			}
			else break;
		}
		if(c1.size()<c2.size()) pos=0;
		if(c1.size()>=c2.size())
		{
			while(c1.size()>c2.size()) c1.pop_back();
			int mn=int(1e9);
			for(int i=0;i<c1.size();i++)
			{
				mn=min(c2[i]-c1[i],mn);
			}
			//cerr<<k<<' '<<mn<<'\n';
			if(mn<k)
			{
				pos=0; 
			}
		}
		if(pos)
		{
			ans=k; lo=k+1;
		}
		else
		{
			hi=k-1;
		}
	}
	cout<<ans<<'\n';
}


Measured memory_bytes: 1016
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <limits.h>
#include <stdio.h>
using namespace std;
 
int main()
{
    long long int a,b,c,d;
    cin >> a >> b >> c >> d;
    
    /*
    int a[n];
    std::vector<int> v;
    for(int i=0; i<n; i++){
        int tmp;
        cin >> tmp;
        a[i] = tmp;
    }
    */

    if(a >= 0 && c >= 0){
        cout << b*d << endl;
    }else if(a >= 0 && d >= 0){
        cout << b*d << endl;
    }else if(a >= 0){
        cout << a*d << endl;
    }else if(c >= 0 && b >= 0){
        cout << b*d << endl;
    }else if(c >= 0){
        cout << b*c << endl;
    }else if(b >= 0 && d >= 0){
        if(a*c < b*d){
            cout << b*d << endl;
        }else{
            cout << a*c << endl;
        }
    }else if(b >= 0){
        cout << a*c << endl;
    }else{
        cout << a*c << endl;
    }
    
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long

const long long MOD = 1000000007;

int main(){
  int n,m;
  cin >> n;
  vector<int> s(n),l(n),p(n);
  rep(i,n) cin >> s.at(i) >> l.at(i) >> p.at(i);

  cin >> m;
  int mw=0;
  vector<int> w(m);
  rep(i,m){
      cin >> w.at(i);
      mw = max(mw,w.at(i));
  }

  vector<vector<int>> dp(n+1,vector<int>(mw+1,0));

  rep(i,n){
      rep(j,mw+1){
        if(j<s.at(i)) dp.at(i+1).at(j) = dp.at(i).at(j);
        else{
            for(int k=s.at(i);k<=l.at(i);k++){
                if(j<k) break;
                else dp.at(i+1).at(j) = max(dp.at(i+1).at(j),max(dp.at(i).at(j),dp.at(i+1).at(j-k)+p.at(i)));
            }
        }
      }
  }

  bool ans = true;
  rep(i,m){
      if(dp.at(n).at(w.at(i))==0) ans=false;
  }

  if(ans){
      rep(i,m) cout << dp.at(n).at(w.at(i)) << endl;
  }
  else cout << -1 << endl;

}



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

int main()
{
	int N;
	cin >> N;
	string s;
	while (N != 0) {
		if (abs(N) & 1) {
			s.push_back('1');
			--N;
		}
		else {
			s.push_back('0');
		}
		N /= -2;
	}
	if (s.empty()) s.push_back('0');
	reverse(s.begin(), s.end());
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 256
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int n;//候補者の数
int p;//石の数
int A[100];
int turn;
int ans;
int main()
{
  while(cin>>n>>p,n||p){
    turn = 0;
    ans = 0;
    int sum =p;
    fill(A,A+100,0);
    while(1){
      turn =turn%n;
      if(A[turn]==sum){
	ans = turn;
	break;
      }
      if(p>0){
	A[turn] +=1;
	p--;
	turn++;
	continue;
      }else if(p==0){
	p +=A[turn];
	A[turn] = 0;
	turn++;
	continue;
      }
      
    }
    cout <<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}
int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    rep(i,n)cin >> a[i];
    auto b = a;
    sort(a.begin(),a.end());
    if(a[n-1] == a[n-2]){
        rep(i,n)cout << a[n-1] << "\n";
        return 0;
    }
    rep(i,n)cout << (b[i]==a[n-1] ? a[n-2] :a[n-1]) << "\n";
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF INT_MAX 
int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if((a==b)&&(b==c)&&(c==a)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

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

int main(){
    int n;
    cin>>n;
    vector<int>a(n);
    int mx=-1e9,mn=1e9,it1=0,it2=0;
    rep(i,n){
        cin>>a[i];
        if(mx<a[i]){
            mx=a[i];
            it1=i;
        }
        if(mn>a[i]){
            mn=a[i];
            it2=i;
        }
    }
    vector<P>ans;
    if(abs(mx)>=abs(mn)){
        rep(i,n)ans.push_back(P(it1+1,i+1)),a[i]+mx;
        rep(i,n-1)a[i+1]+=a[i],ans.push_back(P(i+1,i+2));
    }
    else{
        rep(i,n)ans.push_back(P(it2+1,i+1)),a[i]+mn;
        for(int i=n-1; i>0; --i)a[i]+=a[i+1],ans.push_back(P(i+1,i));
    }
    cout<<ans.size()<<endl;
    rep(i,ans.size())cout<<ans[i].first<<" "<<ans[i].second<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int a,b,c,x,y;
int main()
{
    scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
    int ans=1e9;
    for(int i=0;i<=max(x,y);i++)
    {
        ans=min(ans,2*i*c+max(0,x-i)*a+max(0,y-i)*b);
    }
    printf("%d\n",ans);
}


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

long long int A, B, C, D;

int main(){
    scanf("%lld%lld%lld", &A, &B, &C);
    D = max({A, B, C});
    cout << ((3 * ((A ^ B ^ C ^ D) & 1)) + 3 * D - A - B - C) / 2 << endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC push_options
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
#include <xmmintrin.h>
#include <immintrin.h>
using namespace::std;
__attribute__((constructor))void init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// typedef mp::number<mp::cpp_dec_float<0>> cdouble;
// typedef mp::cpp_int cint;
template<typename T>using pbds=__gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T>using pbds_map=__gnu_pbds::tree<T,T,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T,typename E>using hash_map=__gnu_pbds::gp_hash_table<T,E>;
template<typename T>using pqueue =__gnu_pbds::priority_queue<T, greater<T>,__gnu_pbds::rc_binomial_heap_tag>;
typedef long long lint;
#define INF (1LL<<60)
#define IINF (1<<30)
#define LINF (9223372036854775807LL)
#define EPS (1e-10)
#define endl ('\n')
//#define MOD 1000000007LL
#define MOD 998244353LL
//#define MOD 18446744069414584321ULL
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
template<typename T>inline void numout(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i<INF/2?i:"INF";f=1;}cout<<endl;}
template<typename T>inline void numout2(T t){for(auto i:t)numout(i);}
template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}
template<typename T>inline void output2(T t){for(auto i:t)output(i);}
template<typename T>inline void _output(T t){bool f=0;for(lint i=0;i<t.size();i++){cout<<f?"":" "<<t[i];f=1;}cout<<endl;}
template<typename T>inline void _output2(T t){for(lint i=0;i<t.size();i++)output(t[i]);}
#define rep(i,n) for(lint i=0;i<lint(n);++i)
#define repi(i,a,b) for(lint i=lint(a);i<(lint)(b);++i)
#define rrep(i,n) for(lint i=lint(n)-1;i>=0;--i)
#define rrepi(i,a,b) for(lint i=lint(b)-1;i>=lint(a);--i)
#define irep(i) for(lint i=0;;++i)
#define all(n) begin(n),end(n)
#define dist(a,b,c,d) sqrt(pow(a-c,2)+pow(b-d,2))
inline lint gcd(lint A,lint B){return B?gcd(B,A%B):A;}
inline lint lcm(lint A,lint B){return A/gcd(A,B)*B;}
// inline cint cgcd(cint A,cint B){return B?cgcd(B,A%B):A;}
// inline cint clcm(cint A,cint B){return A/cgcd(A,B)*B;}
bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
const vector<lint> dx={1,0,-1,0,1,1,-1,-1};
const vector<lint> dy={0,1,0,-1,1,-1,1,-1};
#define SUM(v) accumulate(all(v),0LL)
auto call=[](auto f,auto... args){return f(f,args...);};

int main(){
    lint a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    cout<<c*60+d-a*60-b-e<<endl;
}

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

int main(){

    ll x;
    cin >> x;
    ll ans = 0;
    ll yokin = 100;
    while (yokin < x){
        yokin += yokin/100;
        ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3624
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define all(a) (a).begin(), (a).end()
 
 
int main() {
  string S;
  cin >> S;
  if((S[0] == S[1] and S[1] == S[2])
  or (S[1] == S[2] and S[2] == S[3])){
    cout << "Yes" << endl;
  }else cout << "No" << endl;
}

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

int main(){
    int a,b;
    cin >> a >> b ;
    cout << a*b << endl;


 return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define re return 0

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

template<typename T>
void maxi(T &a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T &a, T b) {
	a = min(a, b);
}

int main() {
	ll A, B, C;
	ll X, Y;
	ll ans = 10000000000000;
	cin >> A >> B >> C >> X >> Y;
	int N = 2 * max(X, Y);
	rep(N) {
		ans=min(ans, (ll)i * 2 * C + max((ll)0, (X - i)*A) + max((ll)0, (Y - i)*B));
	}
	say(ans);
}

Measured memory_bytes: 256
import itertools
import math


def calc_diff(a, b):
    x = (a[0] - b[0])
    y = (a[1] - b[1])
    return math.sqrt(x**2 + y**2)


N = int(input())
A = [list(map(int, input().split())) for i in range(N)]
pairs = list(itertools.product(A, A))
pairs = [calc_diff(p[0], p[1]) for p in pairs]
ans = sum(pairs) / 2 * 2 / N
print(ans)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,n,m) for(int i=n;i<int(m);i++)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
using namespace std;
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
 
int vx[]={0,0,-1,1};
int vy[]={1,-1,0,0};
int dx[]={1,0,-1,1,-1,1,0,-1};
int dy[]={1,1,1,0,0,-1,-1,-1};
 
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}

int main(){
	int s,w;
	cin>>s>>w;
	if(s<=w)cout<<"unsafe"<<endl;
	else cout<<"safe"<<endl;
	return 0;
}

Measured memory_bytes: 3636
N = int(input())
A = sorted([int(i) for i in input().split()])

ans = 0
diff = 0
for i in range(N):
    x = min(A[-1] - A[i], A[i])
    if x > diff:
        diff = x
        ans = A[i]
        
print(A[-1], ans)

Measured memory_bytes: 14052
#include<bits/stdc++.h>
using namespace std;
int n;
double a[1010];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	sort(a+1,a+n+1);
	double ans=a[1];
	for(int i=2;i<=n;i++)
	{
		ans=(ans+a[i])/2;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
// AOJ Volume 0 Problem 0008

#include <stdio.h>

#define GET_FLG(n)  (flg_prime[((n) / 2) - 1])
#define SET_FLG(n)  (flg_prime[((n) / 2) - 1] = 1)


char flg_prime[1000000 / 2];

int main(void)
{
    int i;
    int j;
    int n;
    int c;
    
    for (i = 3; i <= 999999; i++){
        if (GET_FLG(i) == 0){
            j = i * 2;
            while (j <= 999999){
                if (j % 2 != 0){
                    SET_FLG(j);
                }
                j += i;
            }
        }
    }

    while (scanf("%d", &n) != EOF){
        if (n < 2){
            printf("0\n");
            continue;
        }
        if (n == 2){
            printf("1\n");
            continue;
        }

        c = 1;
        for (i = 3; i <= n; i += 2){
            if (GET_FLG(i) == 0){
                c++;
            }
        }
        printf("%d\n", c);
    }
    
    return (0);
}


#if 0
int isprime(int n)
{
    int i;

    if (n == 2){
        return (1);
    }

    if (n % 2 == 0){
        return (0);
    }

    for (i = 3; i * i <= n; i += 2){
        if (n % i == 0){
            return (0);
        }
    }
    return (1);
}

int main(void)
{
    int n;
    int i;
    int c;
    
//    while (scanf("%d", &n) != EOF){
    scanf("%d", &n);
        if (n == 2){
            printf("1\n");
            return (0);
        }

        c = 1;
        for (i = 3; i <= n; i+=2){

//            printf("%d - %d\n", i, isprime(i));
            c += isprime(i);
        }

        printf("%d\n", c);
// }

    return (0);
}
#endif

Measured memory_bytes: 0
n = int(input())
a = sorted([int(i) for i in input().split()], reverse=True)
ans = 0
t = n - 1 # 何回心地よさを足すことができるか
for i, v in enumerate(a):
  lim = 1 if i == 0 else 2 # 初回だけ1回足せる、それ以外は2回
  for j in range(lim):
    if t > 0:
      ans += a[i]
      t -= 1
print(ans)


Measured memory_bytes: 31588
def readinput():
    n,m=list(map(int,input().split()))
    a=[]
    for _ in range(m):
        a.append(int(input()))
    return n,a

def main(n,a):
    MOD=10**9+7

    nroute=[0]*(n+2)
    nroute[0]=0
    nroute[1]=1
    nroute[2]=1
    for i in range(3,n+2):
        nroute[i]=(nroute[i-1]+nroute[i-2])%MOD
    #print(nroute)
    
    subn=[]
    i=0
    for j in a:
        subn.append((i,j-1))
        i=j+1
    subn.append((i,n))
    #print(subn)

    nways=1
    for i,j in subn:
        l=j-i+1
        nways=nways*nroute[l]%MOD

    return nways

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)



Measured memory_bytes: 30272
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) throws Exception {
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        int[] P = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); 
        
        int count = 0;
        for(int i = 1; i < N - 1; i++){
            if ( P[i-1] < P[i] && P[i] < P[i+1] ) count++;
            if ( P[i-1] > P[i] && P[i] > P[i+1] ) count++;
        }
        
        System.out.println(count);

    }
}


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

using ll = long long;
#define double long double
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define repr(i, a, b) for (auto i = (a); i < (b); ++i)
#define itr(x, c) for (auto&& x : (c))
#define updatemax(t, v) ((t) = std::max((t), (v)))
#define updatemin(t, v) ((t) = std::min((t), (v)))
#define endl _endl
const char _endl = (cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout.precision(16), '\n');

const string Yes = "Yes";
const string No = "No";
int main() {
  ll d, t, s;
  cin >> d >> t >> s;
  cout << (d <= t * s ? Yes : No) << endl;
}


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

int main() {
	int N, K, X, Y,A,Q;
	int answer = 0;

	cin >> N >> K >> X >> Y;
	A = K - N;
	if (A==0||A<=0) {
		answer = K*X+(N - K)*Y;
	}else { answer = N*X; }

	cout << answer << endl;

	cin >> Q;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
A = [0] + A
dp0 = [0]*(N+1)
dp1 = [0]*(N+1)
dp0[2] = A[1]+A[2]
dp1[2] = -A[1]-A[2]
for i in range(3,N+1):
  dp0[i] = max(dp0[i-1],dp1[i-1])+A[i]
  dp1[i] = max(dp0[i-1]-2*A[i-1],dp1[i-1]+2*A[i-1])-A[i]
print(max(dp0[N],dp1[N]))


Measured memory_bytes: 15868
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;


int main() {
	complex<long double>cmpmp;
	const long long int mod = 1000000007;
	map<long long int, long long int>mp;
	//cout << fixed << setprecision(10);
	long long int N, A, B, h[200] = {}, left = 0, right = 1000000000, bomb, sum[15] = {};
	string str;
	cin >> h[0]>>h[1]>>h[2];
	A = h[2];
	sort(h, h + 3);
	if (h[1] == A) { cout << "Yes"; }
	else { cout << "No"; }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;
ll mod = 1e9+7;


int main(){
    string s;
    cin>>s;
    int n = s.size();
    vector<vector<ll> > dp(n+1,vector<ll>(13,0) );
    dp[0][0] = 1;
    int tmp = 1;
    for(int i=0;i<n;i++){
	if(s[n-1-i] == '?'){
	    for(int j=0;j<10;j++){
		for(int k=0;k<13;k++){
		    dp[i+1][ (j*tmp+k)%13] += dp[i][k];
		    dp[i+1][(j*tmp+k)%13] %= mod;
		}
	    }
	}else{
	    int j = s[n-1-i]-'0';
	    for(int k=0;k<13;k++){
		dp[i+1][(j*tmp+k)%13] += dp[i][k];
		dp[i+1][(j*tmp+k)%13] %= mod;
	    }
	}
	tmp*=10;
	tmp%=13;
    }
    cout<<dp[n][5]<<endl;
    return 0;
}


Measured memory_bytes: 13696
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
long long n;
int main() {
	cin >> n;
	long long Y1 = n / 11; Y1 *= 2;
	long long Y2 = n % 11;
	if (Y2 >= 1)Y1 += 1;
	if (Y2 >= 7)Y1 += 1;
	cout << Y1 << endl;
	return 0;
}

Measured memory_bytes: 764
#!/usr/bin/ruby

N = gets.chomp.to_i
L = gets.chomp.split(" ").map(&:to_i)

s = 1
b = 0
L.each_with_index{|n,index|
  if n == s
    s+=1
    next
  end

  b+=1
}

if s == 1
  puts -1
else
 puts b
end


Measured memory_bytes: 16772
#include <bits/stdc++.h>
#include <unistd.h>
using i64 = std::int64_t;
namespace io { constexpr int is = 1 << 17; char ib[is], *ip = ib + is, it; inline char getc() { if (ip == ib + is) { read(STDIN_FILENO, ib, is); ip = ib; } return *ip++; } inline i64 scan() { i64 r = 0; if (ip + 16 > ib + is) while ((it = getc()) & 16) r = r * 10 + it - '0'; else while ((it = *ip++) & 16) r = r * 10 + it - '0'; return r; } constexpr int os = 1 << 17; char ob[os], *op = ob, ot; inline void putc(const char c) { *op++ = c; if (op == ob + os) { write(STDOUT_FILENO, ob, os); op = ob; } } /* x shoud be greater than or equal to zero */ inline void print(i64 x) { char d[20]; int i = 0; while (true) { d[i] = x % 10 + 48; x /= 10; ++i; if (x <= 0) break; } while (i--) { putc(d[i]); } } inline void flush() { write(STDOUT_FILENO, ob, op - ob); } }
signed main() {
  i64 n = io::scan();
  i64 c = 0;
  i64 m = n;
  for (int i = 0; i < n; i++) {
    i64 x = io::scan();
    if (x <= m) {
      c++;
      m = x;
    }
  }
  io::print(c);
  io::flush();
}


Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
//ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
int main() {
	map<int, int>mp;
	int N, M, v;
	cin >> N;
	rep(i, 0, N)cin >> v, mp[v]++;
	cin >> M;
	rep(i, 0, M)cin >> v, mp[v]--;
	for (auto it : mp) {
		if (it.second < 0) {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}

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

int main(){
  string s;
  cin >> s;
  bool answer = false;
  for(int i = 0; i < s.size() - 1; i++){
    if(s[i] == s[i + 1]){
      cout << "Bad" << endl;
      return 0;
    }
  }
  cout << "Good" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include<vector>
#include<iomanip>
#include<map>
#include <queue>
#include<cmath>

using namespace std;

using ll = long long int; 

void prime(vector<int> &num, int n){
    for(int i=0;i<=n;i++){
        num[i] = 1;
    }
    num[0] = 0;
    num[1] = 0;
    num[2] = 1;

    for(int i=2;i<=sqrt(n);i++){
        if(num[i] == 1){
            for(int j=2;j<=n/i;j++){
                num[i*j] = 0;
            }
        }
    }
}


ll gcd(ll a, ll b) {
  ll tmp;
  if ( b > a) {
    tmp = a;
    a = b;
    b = tmp;
  }
  while (a % b !=0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return b;
}
 
ll lcm(ll a, ll b) {
  return a * b / gcd(a, b);
}

int main(void){

    ll n,l;
    cin>>n>>l;
    vector<ll> a(n);
    ll sum = 0;
    ll piv = -1;

    for(ll i=0;i<n;i++){
      ll x;
      cin>>x;
      a[i] = x; 
      if(i>0) sum = a[i] + a[i-1];
      if(sum >= l) piv = i;
    }

    if(piv == -1){
      cout<<"Impossible"<<endl;
      return 0;
    }else{
      cout<<"Possible"<<endl;
      for(int i=1;i<piv;i++){
        cout<<i<<endl;
      }
      for(int i=n-1;i>piv;i--){
        cout<<i<<endl;
      }
    }
    cout<<piv<<endl;

    return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
struct edge { ll s, t, x; };
typedef pair<ll, ll> P;
typedef pair<ll,P> event;
#define MOD 1000000007
const int MAX = 510000;


int main(){
  ll n,k;
  cin>>n>>k;
  if(k%2==1){
    ll g=n/k;
    cout<<g*g*g;
  }
  else{
    ll g=n/k;
    ll h=(2*n)/k;
    h-=g;
    cout<<h*h*h+g*g*g;
  }
  
}


Measured memory_bytes: 3540
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll n,x;
  cin >> n >> x;
  vector<ll> a(n), v(n);
  for(int i=0;i<n;i++) {
    cin >> a[i];
    v[i] = a[i];
  }

  ll ans = 1e9 * 2100;
  for(int k=0;k<n;k++) {
    ll k_ans = 0;
    for(int i=0;i<n;i++) {
      if(i-k < 0) {
        v[i] = min<ll>(v[i], a[n+i-k]);
      } else {
        v[i] = min<ll>(v[i], a[i-k]);
      }

      k_ans += v[i];
    }
    ans = min<ll>(ans, k_ans + k * x);
  }
  cout << ans << endl;


}


Measured memory_bytes: 256