akhauriyash/Code-Regression huggingface dataset:
#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 INF (1LL<<59)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz size

void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_base::fixed); cerr.ios_base::setf(ios_base::fixed);}
void UNSETF() {cout.ios_base::unsetf(ios_base::fixed); cerr.ios_base::unsetf(ios_base::fixed);}

typedef long long ll;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<PII, int> PPII;
typedef pair<PLL, ll> PPLL;
typedef map<int, int> MII;

const int MOD = 1000000007;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct h_llint {
  static uint64_t splitmix64(uint64_t x) {    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

struct h_pair{
  size_t operator()(const PLL&x)const{
    return hash<ll>()(((ll)x.ff)^(((ll)x.ss)<<32));
  }
};

typedef map<ll, ll> MLL;
typedef map<PII, int> MPII;
typedef map<PLL, ll> MPLL;
typedef set<int> SI;
typedef set<ll> SL;
//ordered_set = order_of_key(.)
//ordered_set = find_by_order(.)
typedef ordered_set<int> OSI;
typedef ordered_set<ll> OSL;
typedef ordered_multiset<int> MOSI;
typedef ordered_multiset<ll> MOSL;
typedef unordered_map<ll, int, h_llint> UMLI;
typedef unordered_map<ll, ll, h_llint> UMLL;
typedef unordered_map<PLL, int, h_pair> UMPI;
typedef unordered_map<PLL, ll, h_pair> UMPL;

int ar[MV];
ll arr[MV];

void solve(int T)
{
	ll a,b,n;
	cin>>a>>b>>n;
	ll mn = min(n, b-1);
	cout<<((a * mn)/b)<<"\n";
	return;
}

int main(void)
{
	FLASH();
	//freopen("cowjog.in", "r", stdin);
	//freopen("cowjog.out", "w", stdout);
	int T;
	T = 1;

#ifndef ONLINE_JUDGE
	time_t time_t1, time_t2;
	time_t1 = clock();
#endif

	//cin>>T;
	while(T--)
	solve(T);

#ifndef ONLINE_JUDGE
	time_t2 = clock();
	SETF();
	cerr<<"Time taken: "<<setprecision(7)<<(time_t2 - time_t1)/(double)CLOCKS_PER_SEC<<"\n";
	UNSETF();
#endif

	return 0;
}

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

#ifdef ONLINE_JUDGE
    #undef DBG
#endif

#define sz(x) ((int) (x).size())
#define forn(i, n) for (int i = 0; i < n; ++i)
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fr first
#define sc second

using ll = long long;


const int N = 100100;
int n, m;
int a[N];


int main() {
    scanf("%d%d", &n, &m);
    forn(i, n) scanf("%d", &a[i]);
    multiset<int> setik;
    forn(i, n) setik.insert(a[i]);
    ll ans = 0LL;
    while (m > 0) {
        int mx = *setik.rbegin();
        setik.erase(prev(setik.end()));
        mx /= 2;
        m--;
        setik.insert(mx);

    }
    for (int el : setik)
        ans += el;
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 5376
n = int(input())
a = [int(x) for x in input().split()]

dir = 0
old = a[0]
ans = 1
for i in range(1, len(a)):
    now = a[i]
    if dir == 0:
        if old < now:
            dir = 1
        elif old > now:
            dir = -1
    elif dir == 1:
        if old > now:
            dir = 0
            ans += 1
    elif dir == -1:
        if old < now:
            dir = 0
            ans += 1
    old = now
print(ans)



Measured memory_bytes: 19940
#include <iostream>
using namespace std;
int main(void) {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = 0;
  for(int i = a; i <= b; i++) {
    if(c % i == 0)
      ans++;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3100
l = input()

stack1 = []
stack2 = []

all_area = 0

for val in range(len(l)):
    if l[val] == "\\":
        stack1.append(val)
    elif l[val] == "/" and stack1 != []:
        temp = stack1.pop(-1)
        all_area = all_area + (val - temp)
        each_area = val - temp
        while stack2 != [] and stack2[-1][0] > temp:
            each_area = each_area + stack2.pop(-1)[1]

        stack2.append([temp, each_area])
    else:
        pass

print(all_area)
print(len(stack2), end="")

for i in range(len(stack2)):
    print(" ", end="")
    print(stack2[i][1],end="")

print("")



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

int main(){
  int n;
  cin >> n;
  int tar = (n-1)/2 +1;
  vector<double> pn(3000);
  for(int i=0; i<n; ++i) cin >> pn[i];
  vector<double> dp(n,0);
  dp[0] = 1;
  for(int i=0; i<n; ++i) for(int j=min(i+1,tar); j>=0; --j){
    if(j == tar) dp[j] = dp[j] + dp[j-1] *pn[i];
    else if(j != 0) dp[j] = dp[j] *(1-pn[i]) +dp[j-1] *pn[i];
    else dp[j] = dp[j] *(1-pn[i]);
  }
  printf("%.10f\n",dp[tar]);
}

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

#define start          ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define nl            endl;
#define end_            system("pause");
#define sz(v)            ((int)((v).size()))
#define sc(x)            scanf("%d",&x)
#define sc2(x,y)         scanf("%d%d",&x,&y)
#define sc3(x,y,z)       scanf("%d%d%d",&x,&y,&z)
#define sc4(x,y,z,a)     scanf("%d%d%d%d",&x,&y,&z,&a)
#define sc5(x,y,z,a,b)   scanf("%d%d%d%d%d",&x,&y,&z,&a,&b)
#define sc6(x,y,z,a,b,c) scanf("%d%d%d%d%d%d",&x,&y,&z,&a,&b,&c)
#define scl(x)           scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define lp(i,n)        for(int i=0;i<n;i++)
#define lp1(i,f,l)     for(int i=f;i<l;i++)
#define R_(s)         freopen(s, "r", stdin)
#define W_(s)        freopen(s, "w", stdout)
#define R_W R_("input.txt"),W_("output.txt")
#define PI           acos(-1)
#define INF             1<<30
#define mp(a,b) make_pair(a,b)
typedef string            S;
typedef long long         ll;
typedef pair <int, int>   pii;
typedef pair<S, int>     si;
typedef pair<int, S>     is;
typedef pair<char, int>  chi;
typedef pair<S, S>       SS;
typedef vector<pii>        vii;
typedef vector<int>       vi;
typedef vector<vi>       vvi;
typedef vector<S>        vs;
typedef vector<ll>       vll;
typedef vector<vll>     vvll;
ll pw(ll b, ll p){ if (!p) return 1; ll sq = pw(b, p / 2); sq *= sq; if (p % 2) sq *= b; return sq; }
ll gcd(ll a, ll b)  { return (b == 0 ? a : gcd(b, a % b)); }
ll sd(ll x)  { return x<10 ? x : x % 10 + sd(x / 10); }
ll lcm(ll a, ll b){ return ((a*b) / gcd(a, b)); }
vector<ll> get_divisors(ll n){vector<ll> arr;ll i=1;for(i;i*i<=n;i++){if(n%i==0)arr.push_back(i),arr.push_back(n/i);}return arr;}
int dx[4]={0 , 1 , 0 , -1};
int dy[4]={1 , 0 , -1 , 0};
ll fac(ll n)
{
	int o=1;
	lp1(i,2,n+1)
		o*=i;
	return o;
}

int main()
{
    start;
	int arr1[7]={1,3,5,7,8,10,12},arr2[4]={4,6,9,11},arr3[1]={2},x,y;
	cin>>x>>y;
	if(x==y)
	{
		cout<<"Yes"<<endl;
		return 0;
	}
	if(x==2||y==2)
	{
		cout<<"No"<<endl;
		return 0;
	}
	int t=0;
	lp(i,7)
		if(arr1[i]==x||arr1[i]==y)
			t++;
	if(t==2)
	{cout<<"Yes"<<endl;return 0;}
	t=0;
	lp(i,4)
		if(arr2[i]==x||arr2[i]==y)
			t++;
	if(t==2)
	{cout<<"Yes"<<endl;return 0;}
	t=0;
	lp(i,1)
		if(arr3[i]==x||arr3[i]==y)
			t++;
	if(t==2)
	{cout<<"Yes"<<endl;return 0;}
	cout<<"No"<<endl;
	//end_;
}

Measured memory_bytes: 256
s = input()

s1 = int(s[:2])
s2 = int(s[2:])


if 1<=s1 and s1<=12 and 1<=s2 and s2<=12:
  ret="AMBIGUOUS"
elif 0<=s1 and s1<=99 and 1<=s2 and s2<=12:
  ret="YYMM"
elif 0<=s2 and s2<=99 and 1<=s1 and s1<=12:
  ret="MMYY"
else:
  ret="NA"


print(ret)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    long X = scanner.nextLong();
    long Y = scanner.nextLong();
    long Z = Y / X;
    int i = 0;
    while (Z > 0) {
      Z /= 2;
      i++;
    }
    System.out.println(i);
  }
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using boost::adaptors::reversed;
using boost::irange;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

int main() {
    ll N;
    cin >> N;
    if (N <= 999) cout << "ABC";
    else cout << "ABD";
//    N %= 999;
//    cout << setfill('0') << setw(3) << N;
    return 0;
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

            int n = arr[0];
            int k = arr[1];

            int[] w = new int[n];

            for (int i = 0; i < n; i++)
            {
                w[i] = int.Parse(Console.ReadLine());
            }

            int max = w.Max();
            int totalW = w.Sum();
            int p = Math.Max(totalW / k, max);
            int totalT = 0, wCnt = 0;

            while (true)
            {
                int[] t = new int[k];

                totalT = 0;
                wCnt = 0;

                for (int i = 0; i < k; i++)
                {
                    while (wCnt != n && (t[i] + w[wCnt]) <= p)
                    {
                        t[i] += w[wCnt];
                        totalT += w[wCnt];

                        wCnt++;
                    }
                }

                if (totalT != totalW) p++;
                else break;
            }

            Console.WriteLine(p);
        }
    }
}

Measured memory_bytes: 10616
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

using R = long double;
const R EPS = 1e-10;
int sgn(const R &r) { return (r>EPS) - (r<-EPS); }
int sgn(const R &a, const R &b) { return sgn(a-b); }

ll n, ans, x[16], y[16];
void dfs(vector<PII> v, vector<int> used, int last) {
    if((int)v.size() == n/2) {
        map<PII,ll> mp;
        for(auto p: v) {
            ll i = p.first, j = p.second;
            PII a;
            if(x[i] == x[j]) a = {INF, 1};
            else {
                ll g = __gcd(y[i]-y[j], x[i]-x[j]);
                a = {(y[i]-y[j])/g, (x[i]-x[j])/g};
            }
            mp[a]++;
        }
        ll ret = 0;
        for(auto p: mp) ret += p.second*(p.second-1)/2;
        chmax(ans, ret);
        return;
    }

    // last とペアにするやつを決める
    FOR(i, last+1, n) {
        if(used[i]) continue;
        v.emplace_back(last, i);
        used[last] = used[i] = true;
        int nlast = last+1;
        while(nlast<n && used[nlast]) nlast++;
        dfs(v, used, nlast);
        used[last] = used[i] = false;
        v.pop_back();
    }
}

int main(void) {
    cin >> n;
    REP(i, n) cin >> x[i] >> y[i];

    vector<PII> v;
    vector<int> used(n);
    dfs(v, used, 0);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3216
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        int ct = int.Parse(Console.ReadLine());
        Dictionary<string, int> string_set = new Dictionary<string, int>();
        for (var i = 0; i < ct; i++)
        {
            string s = Console.ReadLine();
            var ss = s.ToCharArray().ToList();
            ss.Sort();
            string input = string.Join("", ss);
            if (string_set.ContainsKey(input))
            {
                string_set[input]++;
            }
            else
            {
                string_set.Add(input, 0);
            }
        }
        long ans = 0;
        foreach (var v in string_set.Values)
        {
            ans += (long)v * (v+1) / 2;
        }
        Console.WriteLine(ans);
    }
}

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

int main() {
  int N, counts;
  int B = 1;
  cin >> N;
  vector<int> V(N);
  
  for (int i = 0; i < N; i++) {
    cin >> V.at(i);
  }
  
  for (int i = 0; i < N; i++) {
    B = V.at(B-1);
    counts++;
    if (B == 2) {
      break;
    }
  }
  
  if (counts == N) {
    cout << -1 << endl;
  }
  else {
    cout << counts << endl;
  }
}


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

  int ta, tb;
  int price=-1;
  for(int i=1; i<=1010; i++){
    ta=(int)(i*0.08);
    tb=(int)(i*0.10);
    if(a==ta && b==tb){
      price = i;
      break;
    }
  }
  
  cout << price << endl;
  
  return 0;
}

Measured memory_bytes: 256
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            s[i][j] = 0
            left = max(0, j - 1)
            right = min(w - 1, j + 1)
            up = max(0, i - 1)
            down = min(h - 1, i + 1)
            for k in range(up, down + 1):
                for l in range(left, right + 1):
                    if s[k][l] == '#':
                        s[i][j] += 1

for row in s:
    print(''.join(list(map(str, row))))


Measured memory_bytes: 3064
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
                
#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pretime float(clock()-clk)/CLOCKS_PER_SEC
#define rep(i,a,b) for(i=a;i<=b;++i)
#define rev(i,a,b) for(i=a;i>=b;--i) 
#define max2(a,b) ((a)>(b)?(a):(b))   
#define min2(a,b) ((a)<(b)?(a):(b)) 
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define ll long long int 
#define ins insert
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define PI 3.14159265
#define mod 1000000007
#define inf 1000000000000000
#define bug(x) cerr<<#x<<" = "<<(x)<<'\n'

using namespace std;
typedef pair<ll,ll>     pll;
typedef pair<int,int>   pii;
typedef vector<ll>      vll;
typedef vector<int>      vi;
typedef vector< pll >  vpll;
typedef vector< pii >  vpii;
typedef set<ll>         sll;
typedef set<int>         si;
typedef set< pll >     spll;
typedef set< pii >     spii;
clock_t clk=clock();       

ll i,j,k;
void solve(void);

int main()
{
  speedio;
   int t=1;  
  // cin>>t;
   while(t--)
     solve();

  return 0;
}
// #define cerr if(0)cerr

ll ncr[2005][2005];

ll compute(ll n,ll r)
{
	if(n<0 || r<0 || n<r) return 0;
	if(n==r || r==0) return 1;
	if(ncr[n][r]!=0) return ncr[n][r];

	return ncr[n][r]=(compute(n-1,r)+compute(n-1,r-1))%mod;
}
void solve()
{
   ll n,k; cin>>n>>k;

   rep(i,1,k)
   {
   	ll ans=0;
   	ans=(ans+compute(n-k,i-1))%mod;
   	ans=(ans+compute(n-k,i))%mod;
   	ans=(ans*compute(k-1,i-1))%mod;
   	cout<<ans<<'\n';
   }
}

Measured memory_bytes: 30208
// inputに入力データ全体が入る
function Main(input) {
	tmp = input.split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	var a = parseInt(tmp[0], 10);
	var b = parseInt(tmp[1], 10);
  
    var array = [String(a).repeat(b), String(b).repeat(a)];

    //出力
	console.log(array.sort()[0]);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))
#define iter(v,ite) for(auto ite=(v).begin();ite!=(v).end();ite++)
#define mimunum(v,x) distance((v).begin(),lower_bound((v).begin(),(v).end(),x))



int n,m;
lli d[200005];
lli t[200005];
int main(void){
	scanf("%d",&n);
	rep(i,n)scanf("%lld",&d[i]);
	scanf("%d",&m);
	rep(i,m)scanf("%lld",&t[i]);
	sort(d,d+n);
	sort(t,t+m);
	int x=0,o=0;
	rep(i,m){
		while(x<n){
			if(d[x]==t[i]){
				o++;
				break;
			}
			x++;
		}
		x++;
	}
	puts((o==m)?"YES":"NO");
	
	return 0;
}






Measured memory_bytes: 3328
def partition(A, p, r):
	x = A[r]
	i = p - 1
	for j in range(p, r):
		if A[j] <= x:
			i += 1
			A[i], A[j] = A[j], A[i]
	A[i + 1], A[r] = A[r], A[i + 1]
	return i + 1


if __name__ == "__main__":
	n = int(input())
	A = list(map(int, input().split()))
	q = partition(A, 0, n-1)
	A[q] = '[' + str(A[q]) + ']'
	print(' '.join(map(str, A)))


Measured memory_bytes: 16388
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout << fixed
#define endl '\n'

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

void solve(istream& cin, ostream& cout) {
  int n, m;
  cin >> n >> m;

  vector<vector<int>> tbl(200000);
  REP(i, n) {
    int a, b;
    cin >> a >> b;
    tbl[a - 1].push_back(b);
  }

  // pair の1つめの要素に従って降順に
  priority_queue<int, vector<int>, less<int>> pq;
  ll ans = 0;
  REP(i, m) {
    EACH(b, tbl[i]) pq.push(b);
    if (pq.empty()) continue;
    ans += pq.top();
    pq.pop();
  }
  cout << ans << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
  return 0;
}
#endif


Measured memory_bytes: 8064
import math
n,d = map(int, input().split())
X=[input().split() for _ in range(n)]
ans=0
for i in range(n):
    for j in range(i+1, n):
        calc=0
        for k in range(d):
            calc += (int(X[i][k])-int(X[j][k]))**2
        calc = math.sqrt(calc)
        if calc.is_integer():
            ans+=1
print(ans)

Measured memory_bytes: 3064
fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    println(if(getAns()) "Yes" else "No")
}

fun getAns():Boolean {
    val numbers = readLine()!!.split(" ").map { it.toLong() }.toMutableList()
    for(i in (0 until numbers.size - 1).reversed()) {
        if(numbers[i] > numbers[i+1]) {
            if(numbers[i] - numbers[i+1] > 1) {
                return false
            }
            numbers[i]--
        }
    }
    return true
}


Measured memory_bytes: 57084
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    //https://atcoder.jp/contests/abc177
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            //// 文字列の入力
            //string s = Console.ReadLine();

            //// 整数の入力
            //long n = long.Parse(Console.ReadLine());

            //// 文字列配列の入力
            //string[] inputStrArray = Console.ReadLine().Split(' ');

            // 整数配列の入力
            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

            string result = "No";

            var d = inputLongArray[0];
            var t = inputLongArray[1];
            var s = inputLongArray[2];

            if (d <= t * s) result = "Yes";
            


            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 28200
#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int INF = 1 << 28;

int h, w;
int grid[1000][1000];
int br[1000][1000];

bool check(int x, int y, int t)
{
	int cnt = 0;
	for (int dir = 0; dir < 8; dir++){
		int nx = x + dx[dir];
		int ny = y + dy[dir];
		if (br[nx][ny] <= t) cnt++;
	}
	return cnt >= grid[x][y];
}

int main()
{
	cin >> h >> w;
	for (int i = 0; i < h; i++){
		for (int j = 0; j < w; j++){
			char c;
			cin >> c;
			if (c != '.'){
				grid[i][j] = c - '0';
				br[i][j] = INF;
			}
		}
	}
	
	typedef tuple<int, int, int> Tp;
	queue<Tp> q;
	
	for (int i = 0; i < h; i++){
		for (int j = 0; j < w; j++){
			if (br[i][j] < INF) continue;
			if (check(i, j, 0)){
				br[i][j] = 1;
				q.push(Tp(i, j, 1));
			}
		}
	}
	
	int res = 0;
	while (q.size()){
		int x, y, t;
		tie(x, y, t) = q.front(); q.pop();
		for (int dir = 0; dir < 8; dir++){
			int nx = x + dx[dir];
			int ny = y + dy[dir];
			if (br[nx][ny] < INF) continue;
			if (check(nx, ny, t)){
				br[nx][ny] = t + 1;
				q.push(Tp(nx, ny, t + 1));
			}
		}
		res = t;
	}
	
	cout << res << endl;
	
	return 0;
}

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

using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;

#define sz(x) (int)(x).size()
#define HOGE cout << "hoge" << endl;

template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}

const int INF = 1e15;

int main(){
    ll N;
    cin >> N;
    vector<ll> a(N);
    REP(i,N) cin >> a[i];
    
    ll sum = 0;
    REP(i,N) sum += a[i];
    
    
    ll x =0;
    ll ans = INF;
    REP(i,N-1){
        x += a[i];
        ans = min(ans,abs(sum-2*x));
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<iomanip>
#define pi 3.14159265358979323846
#define ill long long int
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
  ill n, k, x, y, sum;
  cin >> n >> k >> x >> y;
  if(n <= k){
    cout << n * x << "\n";
    return 0;
  }
  n -= k;
  y = y * n;
  x = x * k;
  cout << x + y << "\n";
}
  

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    string a, b;
    cin>>a>>b;
    if(a==b){
        string A=a;
        reverse(A.begin(), A.end());
        if(a==A){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }else if(a[0]==b[2]&&a[1]==b[1]&&a[2]==b[0]){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
}


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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define INF 999999999
#define MOD 1000000007

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int iy[]={0, 0, 1, -1};
int ix[]={1, -1, 0, 0};

long long int n, m, ans;

int main(){
	cin >> n;
	ans = 1000;
	for(long long int i = 1;i <= sqrt(n);i++){
		if(n%i == 0){
			ans = min((double)ans, log(max(i, n/i))/log(10)+1);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
//3*3の2次元配列A
//vector<vector<int>> A(3, vector<int>(3));

void solve(){
    float a, b;
    cin >> a >> b;
    float i = 1;
    while(true){
        if(floor(i*0.08) == a && floor(i*0.1) == b){
            cout << int(i) << endl;
            exit(0);
        }
        i++;
        if(i>100*b){
            cout << -1 << endl;
            exit(0);
        }
    }
}

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

Measured memory_bytes: 256
inputNumbers=input()
N=int(inputNumbers.split(" ")[0])
X=int(inputNumbers.split(" ")[1])
Y=int(inputNumbers.split(" ")[2])

result = []
for k in range(1,N):
    result.append(0)

allBranchLength=[]

for i in range(1, N+1):
    for j in range(i+1,N+1):

        if i <= X:
            if j <= X:
                length = j - i
                result[length - 1] += 1

            if j > X and j < Y:
                length = X - i + min(j-X, Y-j+1)
                result[length - 1] += 1

            if j >= Y:
                length = (X - i) + 1 + (j - Y)
                result[length - 1] += 1

        if i > X and i < Y:
            if j > X and j < Y:
                length = min( (i - X) + 1 + (Y - j) , j - i )
                result[length - 1] += 1

            if j >= Y:
                length = min( (i - X) + 1 + (j - Y) , j - i )
                result[length - 1] += 1
                
        if i >= Y:
            if j >= Y:
                length = j - i
                result[length - 1] += 1


#for i in range(len(allBranchLength)):
#    result[allBranchLength[i][1] - 1] += 1

for i in range(len(result)):
    print(result[i])



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

void Grading(int m, int f, int r) {
  int score = m + f;
  if(m == -1 || f == -1) {
	cout << "F" << endl;
  }
  else if(score >= 80) {
	cout << "A" << endl;
  }
  else if(score >= 65 && score < 80) {
	cout << "B" << endl;
  }
  else if(score >= 50 && score < 65) {
	cout << "C" << endl;
  }
  else if(score >= 30 && score < 50) {
	if(r >= 50) {
	  cout << "C" << endl;
	}
	else {
	  cout << "D" << endl;
	}
  }
  else {
	cout << "F" << endl;
  }
}

int main() {
  int m, f, r;
  while(cin >> m >> f >> r) {
	if(m == -1 && f == -1 && r == -1) {break;}
	Grading(m, f, r);
  }
  return 0;
}

Measured memory_bytes: 3060
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    private static long[] data;
    private static long[] Pdata;
    public struct Pair<T> { public T x, y; public Pair(T x, T y) { this.x = x; this.y = y; } }
    public static void Solve()
    {
        int N = NextInt();
        long X = NextLong();
        data = new long[60];
        Pdata = new long[60];
        data[0] = 1;
        Pdata[0] = 1;
        for (int i = 0; i <= 50; i++)
        {
            data[i + 1] = data[i] * 2 + 3;
            Pdata[i + 1] = Pdata[i] * 2 + 1;
        }
        Console.WriteLine(Christmas(N, X));
    }
    public static long Christmas(long n, long x)
    {
        //レベル0バーガーはパティなので
        if (n == 0) return 1;
        //前のレベルバーガーを計算
        long h = data[n - 1];
        long p = Pdata[n - 1];
        //Bしか食べれない
        if (x == 1) return 0;
        //前のレベルの半分も食べれない
        else if (x <= h + 1) return Christmas(n - 1, x - 1);
        //ちょうど半分
        else if (x == h + 2) return p + 1;
        //半分以上食べれる
        else if (x <= h * 2 + 2) return p + 1 + Christmas(n - 1, x - h - 2);
        //全部食べる
        else return 2 * p + 1;
    }
    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static char NextChar() { Confirm(); return char.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;

int main() {
  vi a(3);
  vb is_odd(3, false);
  cin >> a[0] >> a[1] >> a[2];
  int odd = 0, even = 0, res = 0;
  rep(i, 3) {
    if(a[i] % 2 == 0)
      even++;
    else {
      odd++;
      is_odd[i] = true;
    }
  }
  if(odd == 2) {
    res++;
    rep(i, 3) if(is_odd[i]) a[i]++;
  } else if(even == 2) {
    res++;
    rep(i, 3) if(is_odd[i] == false) a[i]++;
  }
  int m = *max_element(all(a));
  rep(i, 3) res += (m - a[i]) / 2;
  cout << res << endl;
}

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

using namespace std;
//using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



int main(){
  
  int n;
  cin >> n;
  vector<pair<ll,int>> pp,pm,mp,mm;
  rep(i,n){
    ll x,y;cin >> x >> y;
    pp.push_back(make_pair(x+y,i));
    pm.push_back(make_pair(x-y,i));
    mp.push_back(make_pair(-x+y,i));
    mm.push_back(make_pair(-x-y,i));
  }
  sort(ALL(pp));
  sort(ALL(mp));
  sort(ALL(pm));
  sort(ALL(mm));
  ll res  = 0;
  rep(i,n){
    pair<ll,int> k = mm.back();
    if(pp[i].second == k.second)k = mm[n-2];
    res = max(res,pp[i].first+k.first);
  }
  rep(i,n){
    pair<ll,int> k = mp.back();
    if(pp[i].second == k.second)k = mp[n-2];
    res = max(res,pm[i].first+k.first);
  }
  cout << res << "\n";


  return 0;
}

Measured memory_bytes: 15972
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    cout << std::fixed << std::setprecision(10);
    lli n;
    cin>>n;
    vi a(n);
    rep(i,n){
        cin>>a[i];
    }
    sort(all(a));
    reverse(all(a));
    lli m=a[0];
    for(lli i=1;i<n;i++){ 
        m-=a[i];
    }
    Yes(m<0);
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007
#define ff first
#define ss second
#define pb push_back
#define N 100005

ll inv[N], fac[N], finv[N];

void make()
{
	fac[0] = fac[1] = 1;
	inv[1] = 1;
	finv[1] = finv[0] = 1;
	for(int i = 2; i < N; ++i)
	{
		fac[i] = i * fac[i - 1] % MOD;
		inv[i] = MOD - MOD/i * inv[MOD % i] % MOD;
		finv[i] = inv[i] * finv[i - 1] % MOD;
	}
}

ll C(ll n, ll k)
{
	if(n < k || n < 0) return 0;
	return fac[n] * finv[n - k] % MOD* finv[k] % MOD;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int a, b, t;
	cin >> a >> b >> t;
	int ans = (t / a) * b;
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

  template <typename number>
pair<number, number> extended_euclid(number a, number b)
{
  number r0, r1, a0, a1, b0, b1;
  r0 = a; r1 = b;
  a0 = 1; a1 = 0;
  b0 = 0; b1 = 1;
  while (r1>0) {
    number q1 = r0 / r1;
    number r2 = r0 % r1;
    number a2 = a0 - q1 * a1;
    number b2 = b0 - q1 * b1;
    r0 = r1 ; r1 = r2;
    a0 = a1 ; a1 = a2;
    b0 = b1 ; b1 = b2;
  }
  number c = r0;
  a = a0; //x
  b = b0; //y
  return  {a, c};
}

ll calc(ll x) {
  return x * x * x * x * x;
}

int main()
{
  ll x;
  cin >> x;
  for(ll i = 0; i <= 1000; i++) {
    ll a5 = calc(i);
    ll b5 = a5 - x;
    if(b5 < 0) {
      for(ll j = 0; j <= 1000; j++){
        if(b5 == calc(-j)) {
          cout << i << " " << -j << endl;
          return 0;
        }
      }
    }else{
      for(ll j = 0; j <= 1000; j++){
        if(b5 == calc(j)) {
          cout << i << " " << j << endl;
          return 0;
        }
      }
    }
  }
}


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

using namespace std;
typedef long long ll;

const int N = 1e5 + 10;

vector<vector<int> > graph;
bool res = true;
bool used[N];

void dfs(int v, int par) {
    for (int u : graph[v]) {
        if (u == par)
            continue;
        dfs(u, v);
    }
    if (!used[v]) {
        if (par == v || used[par])
            res = false;
        used[par] = true;
        used[v] = true;
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    int n;
    cin >> n;
    graph.resize(n);
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    dfs(0, 0);
    if (res) {
        cout << "Second\n";
    } else {
        cout << "First\n";
    }
    return 0;
}


Measured memory_bytes: 5888
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(int)(m);(i)<(int)(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

ll gcd(ll x, ll y) { return (y ? gcd(y, x % y) : x); }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

int main() {
	init();

	int a, b; cin >> a >> b;
	cout << gcd(a, b) << "\n";

	return 0;
}


Measured memory_bytes: 3164
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <vector>



int t;
std::vector<int> balls(10);


int dfs(int d,int a,int b)
{
  if(d==10)
    {
      return 1;
    }

  //

  if(balls[d] > a   )
    {
      if(dfs(d+1,balls[d],b) == 1 )
        return 1;
    }

  if(balls[d] > b)
    {
      if( dfs(d+1,a,balls[d]) == 1)
        return 1;
    }

  return 0;
}

int main(int argc,char* argv[])
{
  //freopen("in.txt","r",stdin);
  std::cin>>t;
  while(t--)
    {
      for(int i = 0 ; i < 10 ; i++)
        std::cin >> balls[i];
      if(dfs(0,0,0) == 1 )
        std::cout<<"YES"<<std::endl;
      else
        std::cout<<"NO"<<std::endl;
    }
  return 0;
}

Measured memory_bytes: 1184
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 500000
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
	int a,b;
	cin>>a>>b;
	a--;
	int ans=(b-2)/a;
	ans++;
	if(b==1)ans=0;
	OUT(ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
constexpr ll INF = 1ll<<60;

int main(int argc, char **argv)
{
	ll N; cin >> N;
	vector<string> Sv(N);
	for (ll i = 0; i < N; ++i)
	{
		cin >> Sv[i];
		sort(Sv[i].begin(), Sv[i].end());
	}

	map<string, ll> m;
	for (ll i = 0; i < N; ++i)
		++m[Sv[i]];
	ll res{0};
	for (auto &e : m)
	{
		// std::cout << e.first << std::endl;
		res += e.second * (e.second - 1) / 2;
	}
	std::cout << res << std::endl;
}


Measured memory_bytes: 18176
N = int(input())
P = list(map(int,input().split()))
cnt = 0
repeat = True

while repeat:
    for i in range(N):
        if P[i] % 2 == 1:
            repeat = False
            break
        else:
            P[i] = P[i] // 2
    cnt += 1

cnt -= 1
print(cnt)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


struct Edge {
	int to,id;
};
vector<vector<Edge>> g;
vector<int>ans;
void dfs(int v,int c = -1,int p = -1) {
	int k = 1;
	rep(i,g[v].size()) {
		int u = g[v][i].to,ei = g[v][i].id;
		if(u == p) continue;
		if(k==c)k++;
		ans[ei] = k;k++;
		dfs(u,ans[ei],v);
	}
}
int main() {
	int n;
	cin >> n;
	g.resize(n);
	ans.resize(n);
	rep(i,n-1) {
		int a,b;
		cin >> a >> b;
		a--;b--;
		g[a].push_back(Edge{b,i});
		g[b].push_back(Edge{a,i});
	}
	dfs(0);
	int maxv = 0;
	rep(i,n-1) {
		maxv = max(maxv,(int)g[i].size());
	}
	cout << maxv << endl;
	rep(i,n-1) cout << ans[i] << endl;

}

Measured memory_bytes: 11052
#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
string a;
cin>>a;
for(int i=0;i<a.size();i+=2)
cout<<a[i];
system("pause");
return 0;
}

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

constexpr int k(int n) { return (n==0) ? 1 : n*k(n-1); }
const int INF = 0x3f3f3f3f3f3f3f3fLL;

int N, M, R;
int dp[202][202];
int r[9];

signed main() {
  
  cin>>N>>M>>R;
  int a,b,c;
  rep(i,N+1) {
    rep(j, N+1) {
      dp[i][j] = i==j ? 0 : INF;
    }
  }
  
  rep(i, R)cin>>r[i];
  
  rep(i, M) {
    cin>>a>>b>>c;
    dp[a][b] = c;
    dp[b][a] = c;
  }
  
  for_(k, 1, N+1) {
    for_(i, 1, N+1) {
      for_(j, 1, N+1)dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
    }
  }
  
  int s = INF, t;
  
  rep(i, k(R)) {
    t = 0;
    for_(j, 1, R)t += dp[r[j-1]][r[j]]; 
    s = min(s, t);
    
    next_permutation(r, r+R); 
  }
  
  cout<<s<<endl;
  
  return 0;
}



Measured memory_bytes: 512
n = int(input())
s = input()

score_list = [0 for i in range(n+2)]
score_list[0] = sum([1 if _s == "#" else 0 for _s in s])

score_list[n+1] = n - score_list[0]
 
for i in range(1, n+1):
    if s[i-1] == ".":
        score_list[i] = score_list[i-1] + 1
    else:
        score_list[i] = score_list[i-1] - 1

max_score = max(score_list)
print(n - max_score)


Measured memory_bytes: 11468
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long a = s.nextLong(), b=s.nextLong(), x=s.nextLong();
		
		long start=0, end=0, ans=0;
		if (a%x==0) {
			start = a;
		}else {
			start = (x - a%x)+a;
		}
		end = b - (b%x);
		
		if (start<=b && end>=a) {
			start /= x;
			end /= x;
			ans = end-start+1;
		}
		
		System.out.println(ans);
		s.close();
	}
}

Measured memory_bytes: 23764
R=[]
for _ in range(3):
    R.extend(list(map(int,input().split())))
c1=R.count(1)
c2=R.count(2)
c3=R.count(3)
c4=R.count(4)
if c1==3 or c2==3 or c3==3 or c4==3:
    print('NO')
else:
    print('YES')

Measured memory_bytes: 3064
w, h, n = map(int, input().split())
wl, hl = 0, 0
wr, hr = w, h
for _ in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        wl = min(max(wl, x), wr)
    elif a == 2:
        wr = max(min(wr, x), wl)
    elif a == 3:
        hl = min(max(hl, y), hr)
    elif a == 4:
        hr = max(min(hr, y), hl)

ans = (hr - hl) * (wr - wl)
print(ans)


Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)
#define index_of(as, x) \
  distance(as.begin(), lower_bound(as.begin(), as.end(), x))

#define rep(i,n) for(auto i=0; i<(n); i++)

const int mod = 1000000007;

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

  long k, a, b;
  cin >> k >> a >> b;

  if (a+2 > b || a >= k) {
    cout << k + 1 << endl;
  } else {
    long res = k-a+1;
    if (res%2) {
      cout << a + 1 + (res/2) * (b-a) << endl;
    } else {
      cout << a + (res/2) * (b-a) << endl;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; ++i)
#define all(a) (a).begin(), (a).end()
template <typename Monoid>
struct SegmentTree {
  using F = function<Monoid(Monoid, Monoid)>;

  int sz;
  vector<Monoid> seg;

  const F f;
  const Monoid M1;

  SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while (sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }

  void set(int k, const Monoid &x) { seg[k + sz] = x; }

  void build() {
    for (int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while (k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }

  Monoid query(int a, int b) {
    Monoid L = M1, R = M1;
    for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if (a & 1) L = f(L, seg[a++]);
      if (b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }

  Monoid operator[](const int &k) const { return seg[k + sz]; }

  template <typename C>
  int find_subtree(int a, const C &check, Monoid &M, bool type) {
    while (a < sz) {
      Monoid nxt = type ? f(seg[2 * a + type], M) : f(M, seg[2 * a + type]);
      if (check(nxt))
        a = 2 * a + type;
      else
        M = nxt, a = 2 * a + 1 - type;
    }
    return a - sz;
  }

  template <typename C>
  int find_first(int a, const C &check) {
    Monoid L = M1;
    if (a <= 0) {
      if (check(f(L, seg[1]))) return find_subtree(1, check, L, false);
      return -1;
    }
    int b = sz;
    for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if (a & 1) {
        Monoid nxt = f(L, seg[a]);
        if (check(nxt)) return find_subtree(a, check, L, false);
        L = nxt;
        ++a;
      }
    }
    return -1;
  }

  template <typename C>
  int find_last(int b, const C &check) {
    Monoid R = M1;
    if (b >= sz) {
      if (check(f(seg[1], R))) return find_subtree(1, check, R, true);
      return -1;
    }
    int a = sz;
    for (b += sz; a < b; a >>= 1, b >>= 1) {
      if (b & 1) {
        Monoid nxt = f(seg[--b], R);
        if (check(nxt)) return find_subtree(b, check, R, true);
        R = nxt;
      }
    }
    return -1;
  }
};

int N;
vector<int> h, a;

int main() {
  cin >> N;
  h.resize(N), a.resize(N);
  rep(i, N) cin >> h[i];
  rep(i, N) cin >> a[i];

  SegmentTree<ll> seg(
      N + 1, [](ll a, ll b) { return max(a, b); }, 0);

  rep(i, N) {
    ll v = max(seg[h[i]], seg.query(0, h[i]) + a[i]);
    seg.update(h[i], v);
  }

  cout << seg.query(1, N + 1) << endl;
  return 0;
}


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

#define ll long long
#define pb push_back
#define eb emplace_back
//#define st first
#define sc second

using namespace std;

const ll mod = 1e9 + 7;
const int e = 1e5 + 69;
const int base = 311;

// dung inverse module de tinh nCk
// 72
// cach tao hoan vi tu n so : n*(n+1)/2;

//vector<pair<ll,ll>>adj[e];

ll Pow(ll n, ll dem)
{
    if(dem == 0) return 1;
    if(dem == 1) return n ;
    ll t = Pow(n, dem/2);
    if(dem % 2 == 0) return (t*t);
    else return ((t * t) * n);
}

/*ll C(ll k, ll n)
{
    if(k == 0) return 1;
    if(n < k) return 0;
    return (gt[n]%mod * (igt[k]%mod * igt[n-k]%mod)%mod)%mod;
}*/

int n, m, k;

struct kien
{
    ll x, y;
};
kien a[e];

bool lf(kien p, kien q)
{
    return p.y < q.y;
}

int main()
{
   cin >> n;
   map<ll,ll>kt;
   ll maxx = 0;
   for(int i=1; i<=n; i++)
   {
       ll x;
       cin >> x;
       kt[x] ++;
       kt[x-1] ++;
       kt[x+1] ++;
       maxx = max(maxx, kt[x]);
       maxx = max(maxx, kt[x-1]);
       maxx = max(maxx, kt[x+1]);
   }
   cout << maxx;
}
/*

*/


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

int main(){
	string s,t;
  	cin>>s;
  	int n=s.size();
  	t=s;
  	reverse(s.begin(),s.end());
  	if(s!=t){
      cout<<"No"<<endl;
      return 0;
    }else{
    	string u=s.substr(0,(n-1)/2);
      	string v=s.substr((n+3)/2-1);
      	string U=u,V=v;
      	reverse(u.begin(),u.end());
      	reverse(v.begin(),v.end());
      	if(u==U&&v==V)cout<<"Yes"<<endl;
      	else cout<<"No"<<endl;
    }
  return 0;
}

Measured memory_bytes: 256