akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        char[] c = sc.next().toCharArray();
        long r = 0;
        long g = 0;
        long b = 0;
        for (int i = 0; i < c.length; i++) {
            if (c[i] == 'R') r++;
            if (c[i] == 'G') g++;
            if (c[i] == 'B') b++;
        }

        //総数
        long ans = r*g*b;

        //(i,j,k)の中でiの位置を固定する。
        for (int st = 0; st < n - 2; st++) {
            //(i,j,k)の中でjの位置を固定する。つまりkの位置を決まる。
            for (int dist = 1; st + dist * 2 < n; dist++) {
                char i = c[st];
                char j = c[st + dist];
                char k = c[st + dist * 2];
                if (i != j && j != k && i != k) ans--;
            }
        }
        System.out.println(ans);
    }
}


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

const int N = 100233;
int n, color[N], deg[N], ban[N], val[N], f[N], ret;
vector<int> G[N];
char s[N];
void dfs(int x, int pre) {
  int mx = 0, smx = 0;
  for (auto y : G[x]) if (y != pre) {
    dfs(y, x);
    smx = max(smx, f[y]);
    if (smx > mx) swap(smx, mx);
  }
  ret = max(ret, mx + smx + val[x]);
  f[x] = val[x] + mx;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i++) {
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
    G[y].push_back(x);
    deg[x]++;
    deg[y]++;
  }
  scanf("%s", s + 1);
  queue<int> q;
  for (int i = 1; i <= n; i++) {
    color[i] = s[i] == 'W';
    if (!color[i] && deg[i] <= 1) {
      q.push(i);
    }
  }
  while (!q.empty()) {
    int x = q.front(); q.pop();
    ban[x] = 1;
    for (auto y : G[x]) if (!ban[y]) {
      if (--deg[y] == 1 && !color[y]) {
        q.push(y);
      }
    }
  }
  int ans = -2, all = 0;
  for (int i = 1; i <= n; i++) if (!ban[i]) {
    all++;
    ans += 2;
    if (deg[i] != 1 && color[i] ^ (deg[i] & 1)) {
      ans++;
      val[i] = 2;
    }
  }
  if (!all) return puts("0"), 0;
  else if (all == 1) return puts("1"), 0;
  dfs(1, 0);
  printf("%d\n", ans - ret);
}


Measured memory_bytes: 14720
#include <stdio.h>
int main(void)
{
	int S, h, m ,m2 , s, s2;
	scanf("%d", &S);
	h = S/60/60;
	m2 = S/60;
	m = m2 - h*60;
	s2 = S - h*60*60;
	s = s2 - m*60;
	printf("%d:%d:%d\n",h,m,s);
	return 0;
}

Measured memory_bytes: 1804
/*
	Copyright: razouq (c)
	Author: Anass BENDARSI
	Date: 12/05/2018 12:08:16
	flamers will **** you
*/
//#include<flamers.h>

#include "bits/stdc++.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#define ll long long
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define POB pop_back

using namespace std;
bool compare(pair<int, int> p1, pair<int, int> p2){
	 if(1) return true;
	 return false;
}

int main(){
//	freopen("input.in", "r", stdin);
//	freopen("output.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie();
	int x;
	cin>>x;
	int mx = 1;
	for(int i = 2; i <= 100; i++) {
		int z = i*i;
		while(z <= x) {
			if(z > mx) {
				mx = z;
			}
			z *= i;
		}
	}
	cout<<mx<<endl;
	return 0;
}


Measured memory_bytes: 256
p=lambda x:print(x,end=' ')
n=input();p(n+':')
n=int(n);s=n**.5
while n%2==0 and n>3:p(2);n//=2
d=3
while s>d and n>d:
 if n%d==0:p(d);n//=d
 else:d+=2
print(n)


Measured memory_bytes: 5632
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))

N=int(input())
A = list(map(int, input().split()))

tmp = A[0]
ans = 0

for i in range(1,N):
    if tmp > A[i]:
        ans += tmp - A[i]
    if tmp < A[i]:
        tmp = A[i]
    
print(ans)

Measured memory_bytes: 109700
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <list>
using namespace std;

#define MOD 1000000007
#define p(x) cout << x << endl;
#define el cout << endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

    int a, b;
    cin >> a >> b;

    int add = a + b;
    int sub = a - b;
    int mul = a * b;

    int num = max(add, sub);
    p(max(num, mul));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#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(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

int main() {
  int n;
  int a_max_num = 1000000;
  cin >> n;
  vector<int> data;
  vector<int> judge(a_max_num + 5, true);
  unordered_map<int, int> mp;

  REP(i, n) {
    int x;
    cin >> x;
    mp[x] += 1;
    data.push_back(x);
  }
  sort(ALL(data));

  REP(i, n) {
    if (!judge[data[i]]) continue;
    for (int j = 2 * data[i]; j < data[n - 1] + 5;) {
      if (j > data[n - 1]) {
        break;
      } else {
        judge[j] = false;
        j += data[i];
      }
    }
  }
  int ans = 0;
  for (auto x : data) {
    if (mp[x] == 1 && judge[x]) ans++;
  }
  cout << ans << endl;
}


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

using namespace std;

string ans;
int64_t n;

int main() {
    cin >> n;

    while (n) {
        n--;
        ans += char('a' + n%26);
        n /= 26;
    }

    reverse(ans.begin(), ans.end());
    cout << ans;
    return 0;
}


Measured memory_bytes: 3600
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int i;
        int[] array = new int[2];
        
        i = 1;
        int x;
        int y;
        while (i != 0) {
            for (i = 0; i < 2; i++) {
                array[i] = sc.nextInt();
            }
            if(array[0] == 0 && array[1] == 0) break;
            for(x=0;x<array[0];x++){
                for(y=0;y<array[1];y++){
                    System.out.print("#");
                }
                System.out.println("");
            }
            System.out.println("");
        }
        sc.close();
    }
}


Measured memory_bytes: 35196
N = int(input())
A = list(map(int,input().split()))
k = []
ans = 0
for i in range(N):
    if A[i]%2 == 0:
        k.append(A[i])
for j in range(len(k)):
    if k[j]%3 == 0 or k[j]%5 == 0:
        ans += 1
if ans == len(k):
    print("APPROVED")
else:
    print("DENIED")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
//#define PI 3.141592653589
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "0" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl

 
signed main(void){
    int N;
    cin >> N;
    cout <<(N+1)/2 << endl;
    
    return 0;
}



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

typedef long long ll;
typedef pair<int,int> ii;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int r; cin>>r;
	if(r<1200) cout << "ABC" << endl;
	else if(r<2800) cout << "ARC" << endl;
	else cout << "AGC" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

string s;
int N, a, b, cnt, dob;

int main()
{
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> s;
        int sz = s.size();
        b += s[0] == 'B';
        a += s[sz - 1] == 'A';
        if (s[0] == 'B' && s[sz - 1] == 'A')
            a--, b--, dob++;

        for (int j = 0; j + 1 < sz; j++)
            cnt += (s[j] == 'A' && s[j + 1] == 'B');
    }
    if (dob > 0 && (a > 0 || b > 0))
        a++, b++;
    if (dob >= 2)
        cnt += dob - 1;
    cnt += min(a, b);
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <climits>

constexpr int SINT_MAX = std::numeric_limits<int>::max();
constexpr int SINT_MIN = std::numeric_limits<int>::min();

#define YesNo(b) ((b) ? "Yes" : "No")
#define YESNO(b) ((b) ? "YES" : "NO")

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;



int main()
{
    int K, A, B;
    cin >> K >> A >> B;
    
    bool ans = false;
    for (int i = A; i <= B; i++)
    {
        if (i % K == 0) ans = true;
    }
    
    cout << (ans ? "OK" : "NG") << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
const ll INF = 9223372036854775807;

int main() {
  int a,b;cin >> a >> b;
  bool TF = false;
  rep(i,a+1) {
    if(i*2+(a-i)*4 == b) TF = true;
  }
  if(TF) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3640
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K,sum=0;
  cin >> A >> B >> K;
  while(K!=sum){
      sum +=1;
      if(sum%2==1){
        if(A%2==1){
          A=A-1;
        }
        B=B+A/2;
        A=A/2;
      }if(sum%2==0){
        if(B%2==1){
          B=B-1;
        }
        A=A+B/2;
        B=B/2;
      }
  }
  cout << A << ' ' << B << endl;
}

Measured memory_bytes: 256
//IOI 2021
//labriz kon code ra, ham paye ie AC manam, AC age yari kone ta sob man code miznm :)
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 2 * 100 * 1000 + 17;

ll n, k, a[MAXN];

ll DC(int l, int r) {
	if (l + 1 == r)
		return (a[l] >= k);
	int mid = (l + r) / 2;
	ll res = DC(l, mid) + DC(mid, r);
	vector<ll> part1, part2;
	ll sum = 0;
	for (int i = mid - 1; i >= l; i--)
		sum += a[i], part1.pb(sum);
	sum = 0;
	for (int i = mid; i < r; i++)
		sum += a[i], part2.pb(k * (i - mid + 1) - sum);
	sort(part2.begin(), part2.end());
	for (int i = 0; i < part1.size(); i++) {
		int ind = upper_bound(part2.begin(), part2.end(), part1[i] - k * (i + 1)) - part2.begin();
		res += ind;
	}
	return res;
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> k;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	cout << DC(1, n + 1) << endl;
	return 0;
}


Measured memory_bytes: 4168
import sys
#sys.exit()
#sorted( ,reverse=True)
X = int(input())
#S,T = map(int, input().split())
#A = list(map(int, input().split()))
#print(N)
#print(S,T)
#print(A)
#print('Yes')
#print('No')

cnt = 0
m = 100 
while m < X:
    m = int(m) * 1.01
    cnt += 1
 
print(cnt)



Measured memory_bytes: 9160
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uint = unsigned int;
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rep1(i,n) for(int i=1;i<=int(n);i++)
#define per(i,n) for(int i=int(n)-1;i>=0;i--)
#define per1(i,n) for(int i=int(n);i>0;i--)
#define all(c) c.begin(),c.end()
#define si(x) int(x.size())
#define pb emplace_back
#define fs first
#define sc second
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
template<class T,class U> void chmax(T& x, U y){if(x<y) x=y;}
template<class T,class U> void chmin(T& x, U y){if(y<x) x=y;}
template<class T> void mkuni(V<T>& v){sort(all(v));v.erase(unique(all(v)),v.end());}
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

#ifdef LOCAL
#define show(x) cerr << "LINE" << __LINE__ << " : " << #x << " = " << (x) << endl
void dmpr(ostream& os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
	os<<t<<" ~ ";
	dmpr(os,args...);
}
#define shows(...) cerr << "LINE" << __LINE__ << " : ";dmpr(cerr,##__VA_ARGS__)
#define dump(x) cerr << "LINE" << __LINE__ << " : " << #x << " = {";  \
	for(auto v: x) cerr << v << ","; cerr << "}" << endl;
#else
#define show(x) void(0)
#define dump(x) void(0)
#define shows(...) void(0)
#endif

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);		//DON'T USE scanf/printf/puts !!
	cout << fixed << setprecision(20);

	string s; cin >> s;
	cout << s.substr(0,3) << endl;
}


Measured memory_bytes: 3624
package main
import (
  "fmt"
  "sort"
)
func main() {
  var n,p int
  fmt.Scan(&n)
  tree := make([][]int,n)
  for i:=1;i<n;i++ {
    fmt.Scan(&p)
    tree[p-1] = append(tree[p-1],i)
  }
  x := make([]int,n)
  for i:=0;i<n;i++ { fmt.Scan(&x[i]) }
  d := Depths{Depth{0,0}}
  for i:=0;i<n;i++ {
    for _,e := range tree[d[i].i] {
      d = append(d,Depth{e,d[i].d+1})
    }
  }
  sort.Sort(sort.Reverse(d))
  rem := make([]int,n)
  Outside:
  for i:=0;i<n;i++ {
    v := d[i].i
    dp := make([]bool,x[v]+1)
    dp[0] = true
    s := 0
    for _,e := range tree[v] {
      nxt := make([]bool,x[v]+1)
      s += rem[e]+x[e]
      for j:=min(rem[e],x[e]);j<x[v]+1;j++ {
        if j-rem[e] >= 0 && dp[j-rem[e]] { nxt[j] = true }
        if j-x[e] >= 0 && dp[j-x[e]] { nxt[j] = true }
      }
      dp = nxt
    }
    for j:=x[v];j>-1;j-- {
      if dp[j] {
        rem[v] = s-j
        if rem[v] < 0 { rem[v] = 0 }
        continue Outside
      }
    }
    fmt.Println("IMPOSSIBLE")
    return
  }
  fmt.Println("POSSIBLE")
}
func min(n,m int) int {
  if n < m { return n }
  return m
}
type Depth struct { i,d int }
type Depths []Depth
func(d Depths) Len() int { return len(d) }
func(d Depths) Swap(i,j int) { d[i],d[j] = d[j],d[i] }
func(d Depths) Less(i,j int) bool { return d[i].d < d[j].d }

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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

struct Vertex
{
    vector<int> node;
    vector<int> two;
    vector<int> three;
};

Vertex V[100005];
//bool U[100005];
ll A[100005];
ll B[100005];
bool U[100005][3];

int main()
{
    ll N, M;
    cin >> N >> M;
    REP(i, M)
    {
        ll a, b;
        cin >> a >> b;
        V[--a].node.push_back(--b);
    }
    ll S, T;
    cin >> S >> T;
    S--;
    T--;
    REP(i, N)
    {
        A[i] = INF;
    }

    memset(U, 0, sizeof(U));
    queue<pll> q;
    q.push(pll(S, 0LL));
    while (!q.empty())
    {
        pll t = q.front();
        q.pop();
        if (A[t.first] <= t.second)
            continue;
        A[t.first] = t.second;
        if (t.first == T)
            break;

        queue<pll> p;
        p.push(pll(t.first, 0LL));
        while (!p.empty())
        {
            pll s = p.front();
            p.pop();
            if (U[s.first][s.second])
                continue;
            U[s.first][s.second] = true;
            REP(i, V[s.first].node.size())
            {
                int n = V[s.first].node[i];
                ll cost = s.second + 1;
                if (cost == 3)
                {
                    if (A[n] > t.second + 1)
                        q.push(pll(n, t.second + 1));
                    continue;
                }
                p.push(pll(n, cost));
            }
        }
    }

    if (A[T] == INF)
        cout << -1 << endl;
    else
        cout << A[T] << endl;
    return 0;
}

Measured memory_bytes: 11520
//"BISMILLAHIR RAHMANIR RAHIM"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
const long long M = 1e8 ;
int main()
{
    string s;
    cin>>s;
    ll i,sa=0,mx=0,r;
    for(i=0;i<3;i++){

        while(s[i]=='R' && i<3)
        {
            i++;
            sa++;
        }
         mx= max(sa,mx);
      sa=0;
        if(i==3)
            break;

    }
   cout<<mx<<endl;
    return 0;
}



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

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;

ll INF = (1ll << 32);
double EPS = 1e-4;

int main() {
  ll N, M;
  cin >> N >> M;

  vi a(M), b(M);
  for (ll i = 0; i < M; i++) {
    cin >> a[i] >> b[i];
    a[i] -= 1;
    b[i] -= 1;
  }

  vvi v1(N), v2(N);
  for (ll i = 0; i < M; i++) {
    v1[a[i]].push_back(i);
    v2[b[i]].push_back(i);
  }

  ll cnt = 0;
  unordered_set<ll> s;
  for (ll i =  0; i < N; i++) {
    if (i == 0) {
      for (auto j: v1[0]) {
        s.insert(j);
      }
    } else if (i == N - 1) {
      bool ok = true;
      for (auto j: v2[i]) {
        if (s.find(j) != s.end()) {
          ok = false;
        }
      }
      if (!ok) {
        cnt += 1;
      }
    } else {
      bool ok = true;
      for (auto j: v2[i]) {
        if (s.find(j) != s.end()) {
          ok = false;
        }
      }
      if (!ok) {
        s.clear();
        cnt += 1;
      }
      for (auto j: v1[i]) {
        s.insert(j);
      }
    }
  }

  cout << cnt << endl;
}

Measured memory_bytes: 13688
#include<iostream>
#include<cstdio>
#include<cstring>
typedef long long ll;
const int N=100500;
ll s[N];
ll ans;
int n;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%lld",s+i);
	for(int i=1,j;i<=n;i=j+1)
	{
		ll tmp=s[i];
		for(j=i;j<n && s[j+1];)
			tmp+=s[++j];
		ans+=tmp/2;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <set>
#include <map>
#include <vector>

int main(){
  int n,q;
  std::cin >> n >> q;
  std::string s;
  std::cin >> s;
  std::vector<std::pair<int,int>> qarray;
  for(int i=0;i<q;++i){
  int l,r;
  std::cin >> l >> r;
     qarray.push_back({l - 1,r - 1});
   }
  
  std::vector<size_t> acpos;
    size_t c = 0;
    while(1){
    	c = s.find("AC",c);
    	if(c >= s.size()){
    		break;
    	}
        acpos.push_back(c);
       c = c+1;
    }
  
  
  for(auto q:qarray){
    auto a = std::lower_bound(acpos.begin(),acpos.end(),q.first);
    auto b = std::upper_bound(acpos.begin(),acpos.end(),q.second - 1);
    std::cout << (b - a) << std::endl;
  }
}

Measured memory_bytes: 2612
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    int k;
    cin >> k;

    queue<long> q;
    for (int i : irange(1, 10)) q.push(i);

    long x;
    while (k--) {
        x = q.front();
        q.pop();
        if (x % 10 != 0) q.push(10 * x + x % 10 - 1);
        q.push(10 * x + x % 10);
        if (x % 10 != 9) q.push(10 * x + x % 10 + 1);
    }
    cout << x << endl;
}


Measured memory_bytes: 1792
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int A = Integer.parseInt(sc.get());
		int B = Integer.parseInt(sc.get());
		int H = Integer.parseInt(sc.get());
		int M = Integer.parseInt(sc.get());
		long minutes = H * 60L + M;
		double degH = minutes / 12.;
		double degM = minutes;
		var deg = Math.abs(degH - degM) * Math.PI / 30;
		var x2 = A * A + B * B - 2 * A * B * Math.cos(deg);
		System.out.printf("%.11f", Math.pow(x2, 0.5));
		System.out.println();
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

Measured memory_bytes: 34648
/**
 *    created by : PawPaw       
**/

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

#define F(i,a,b) for(int i = (int)(a); i <= (int)(b); i++)
#define RF(i,a,b) for(int i = (int)(a); i >= (int)(b); i--)

double dist(double ax, double ay, double bx, double by){
  return sqrt(pow(ax-bx, 2) + pow(ay-by, 2));
}

int solve(){
  int n, p[8], x[8], y[8];
  bool isFirst = true;
  double average;
  cin >> n;
  iota(p, p+n, 0);
  F(i,0,n-1) cin >> x[i] >> y[i];
  do{
    F(i,1,n-1){
      if(isFirst){ 
        average = dist(x[p[i]], y[p[i]], x[p[i-1]], y[p[i-1]]);
        isFirst = false;
      }
      else average += dist(x[p[i]], y[p[i]], x[p[i-1]], y[p[i-1]]);
    }
  } while(next_permutation(p, p+n));
  long long fact = 1;
  F(i, 1, n) fact *= i;
  cout << fixed << setprecision(6) << average/fact << endl;
  return 0;
}

void fun(){
  int t = 1;
  // cin >> t;
  while(t--) solve();
} 

int main(){
  ios::sync_with_stdio(false); 
  cin.tie(0);
  // #ifndef ONLINE_JUDGE
  //   freopen("fi", "r", stdin);
  //   freopen("fo", "w", stdout);
  //   clock_t startClock, endClock;
  //   startClock = clock();
  // #endif

  fun();

  // #ifndef ONLINE_JUDGE
  //   endClock = clock(); 
  //   cout << "Time taken by program is : " << fixed <<  double(endClock - startClock) / double(CLOCKS_PER_SEC) << setprecision(5) << " sec " << endl; 
  // #endif
  
  return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python

n = int(input())

if n%2 == 1:
    print(0)
    exit()

mp = tmp = 0 
while True:
    if 5**tmp > n:
        break
    mp = tmp 
    tmp += 1

ans = 0 
for i in range(1, mp+1):
    ans += n//(2*(5**i))

print(ans)


Measured memory_bytes: 9032
#include <bits/stdc++.h>
constexpr int DEBUG = 0;
using ll = long long;
using namespace std;

struct S {
    int n;
    string str;
    S(int _n, string _str) {
        n = _n;
        str = _str;
    }
};
bool comp(const S &a, const S &b) {
    if (a.n != b.n)
        return a.n > b.n;
    else
        return a.str < b.str;
}

int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    for (int i = 0; i < n; i++)
        cin >> s[i];
    
    sort(s.begin(), s.end());
    vector<S> vs;
    int count = 1;
    string pred = s[0];
    for (int i = 1; i < n; i++) {
        if (s[i] == pred) {
            count++;
        }
        else {
            vs.push_back(S(count, s[i-1]));
            count = 1;
            pred = s[i];
        }
    }
    vs.push_back(S(count, s[n-1]));
    sort(vs.begin(), vs.end(), comp);
    
    if (DEBUG >= 1) {
        for (int i = 0; i < vs.size(); i++)
            cout << vs[i].n << " " << vs[i].str << endl;
    }
    
    for (int i = 0; i < vs.size(); i++) {
        if (vs[i].n == vs[0].n)
            cout << vs[i].str << endl;
        else
            break;
    }

    return 0;
}


Measured memory_bytes: 17908
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <queue>
#include <utility>
using namespace std;
int main() {
	string S;
	while(cin>>S) {
		int J=0,I=0;
		for(int i=0;i<S.size()-2;i++) {
			if(S[i+1]!='O'||S[i+2]!='I') continue;
			if(S[i]=='J') {
				J++;
			}else if(S[i]=='I') {
				I++;
			}
		}
		printf("%d\n%d\n",J,I);
	}
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
const int N=3e5+5;
char s[N];
ull base=233,inv=7204522363551799129,f[N];
ull x=1,y,ans=0;
int n;
unordered_map<ull,int>mp;
int main()
{
	scanf("%d",&n);
	scanf("%s",s+1);
	for(int i=1;i<=n;i++)
    {
        f[i]=f[i-1];
        if(s[i]=='+') f[i]+=x;
        if(s[i]=='-') f[i]-=x;
        if(s[i]=='>') x*=base;
        if(s[i]=='<') x*=inv;
        mp[f[i]]++;
    }
    x=1;
	for(int i=1;i<=n;i++)
	{
		ans+=mp[f[n]*x+y];
		if(s[i]=='+') y+=x;
		if(s[i]=='-') y-=x;
		if(s[i]=='>') x*=base;
		if(s[i]=='<') x*=inv;
		mp[f[i]]--;
	}
	printf("%llu",ans);
}


Measured memory_bytes: 22132
#include<bits/stdc++.h>
//#include<inttypes.h>//__int64,__int128..
#define MAX_N 100005
//vector&pair
#define pb push_back
#define mp make_pair
//math
#define sq(x) ((x)*(x))
#define abs(x) ((x)>0?(x):(-(x)))//Regardless of type
//for pair
#define fi first
#define se second
//infinit
#define LL_inf (1LL<<60)
#define full_inf 0x7fffffff
#define half_inf 0x3fffffff
//MOD
#define MOD 1000000007LL
using namespace std;
//type
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pil;
typedef long double LD;
int f(int x){return x?f(x/10)+x%10:0;}
int main(){
	int n,i,j,ans=100005;
	scanf("%d",&n);
	for(i=1;i<n;i++){
		j=n-i;
		ans=min(ans,f(i)+f(j));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

S = list(input())[::-1]
leng = len(S)
mod = 10**9+7

old_dp = [0]*13
old_dp[0] = 1

for i in range(leng):
    dp = [0]*13
    if S[i]!='?':
        d = int(S[i])
        d = d*pow(10, i, 13)
        for j in range(13):
            dp[j] += old_dp[(j-d)%13]
            dp[j] %= mod
    else:
        for d in range(10):
            d = d*pow(10, i, 13)
            for j in range(13):
                dp[j] += old_dp[(j-d)%13]
                dp[j] %= mod
    old_dp = dp

print(dp[5])

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

const static int MAX = 100; 

int main(){
    int n, key, array[MAX], j;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> array[i];
    }
    for(int i=1;i<n;i++){
        for(int k=0;k<n-1;k++){
            cout << array[k] << " ";
        }
        cout << array[n-1] << endl;

        key = array[i];
        j = i - 1;
        while(j>=0 && key<array[j]){
            array[j+1] = array[j];
            j -- ;
        }
        array[j+1] = key;
    }
    for(int k=0;k<n-1;k++){
        cout << array[k] << " ";
    }
    cout << array[n-1] << endl;
    return 0;
}


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__;
const ll MOD = 1000000007;
const int MAX = 200000;

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

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    int N,M; cin >> N >> M;
    cout << N*(N-1)/2 + M*(M-1)/2 << endl;
    return 0;
}


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

using namespace std;

int main()
{
	string s;
	int k;
	cin >> s >> k;
	vector<string> v, w;
	for (int i = 0; i < s.length(); i++)
		v.push_back(s.substr(i));
	sort(v.begin(), v.end());
	for (int i = 0; i < min(k, (int)v.size()); i++) {
		for (int j = 1; j <= min(k, (int)v[i].length()); j++)
			w.push_back(v[i].substr(0, j));
	}
	sort(w.begin(), w.end());
	unique(w.begin(), w.end());
	cout << w[k - 1] << endl;
	return 0;
}


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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
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; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;
const ll m=1LL<<32;



int main(){

  ll n;cin>>n;

  set<ll>ans;
  for(ll i=2;i*i<=n-1;i++){
    if((n-1)%i==0)ans.insert(i),ans.insert((n-1)/i);
  }

  ans.insert(n-1);
  set<ll>se;
  for(ll i=2;i*i<=n;i++){
    if(n%i==0)se.insert(i),se.insert(n/i);
  }
  se.insert(n);

  for(auto s:se){
    ll k=n;
    while(k%s==0){
      k/=s;
    }
    if(k%s==1)ans.insert(s);
  }

  out(ans.size()+(n==2?-1:0));




  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> P;
map <int,int> mp;
vector<int> V;
list<int> L;
stack<int> S;
queue<int> Q;
deque<int> dq;
#define INF (1<<30)
#define INFLL (1ll<<60)
#define EPS (1e-10)
static const int MAX=100000;
static const int MOD=1e9+7;
static const int NMAX=50;
static const int MMAX=50;
int sx,sy,tx,ty;
int main(){
    cin.tie(0);  ios::sync_with_stdio(false);
    
    cin>>sx>>sy>>tx>>ty;
    int dy=ty-sy;
    int dx=tx-sx;
    
    for(int i=0;i<dy;i++)cout<<'U';
    for(int i=0;i<dx;i++)cout<<'R';
    for(int i=0;i<dy;i++)cout<<'D';
    for(int i=0;i<dx;i++)cout<<'L';
    cout<<'L';
    for(int i=0;i<dy+1;i++)cout<<'U';
    for(int i=0;i<dx+1;i++)cout<<'R';
    cout<<'D';
    cout<<'R';
    for(int i=0;i<dy+1;i++)cout<<'D';
    for(int i=0;i<dx+1;i++)cout<<'L';
    cout<<'U'<<"\n";;
    
    
    return 0;
}


Measured memory_bytes: 256
n = int(input())
hl = list(map(int, input().split()))
hl.insert(0, 1)

cnt = 0
l = 1
r = n
while True:
    if sum(hl) == 1:
        break
    for i in range(1, n + 1):
        if hl[i] >= 1:
            l = i
            break
    for j in range(l, n + 1):
        if hl[j] == 0:
            r = j -1
            break
        if not 0 in hl[l:]:
            r = n
    if l == r:
        hl[l] -= 1
    else:
        for k in range(l, r+1):
            hl[k] -= 1
    cnt += 1
print(cnt)


Measured memory_bytes: 3064
#include <stdio.h>

int main(void){
    int d;
    scanf("%d", &d);
    printf("Christmas");
    if(d < 25){
        printf("%s", (d == 24)? " Eve" : (d == 23)? " Eve Eve" : " Eve Eve Eve");
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("myfile.in","r",stdin);freopen ("myfile.out","w",stdout);
#define mod 1000000007
#define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(int i=x;i<=y;i++)
using namespace std;
 
ll n,m,ar[N],sum;
 
 
int main()
{
	fast;
	cin>>ar[1]>>ar[2]>>ar[3];
	if(ar[3]>min(ar[1],ar[2]) && ar[3]<max(ar[1],ar[2]))
		cout<<"Yes";
	else
		cout<<"No";
 
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long maxIndex = 0;
        long maxValue = 0;
        int n = Integer.valueOf(sc.nextLine().replaceAll(" ", ""));
        for (int i = 0; i < n; i++) {
            String str = sc.nextLine();
            String[] split = str.split(" ");
            long a = Long.valueOf(split[0]);
            long b = Long.valueOf(split[1]);
            if (maxIndex < a) {
                maxIndex = a;
                maxValue = b;
            }
        }
        System.out.println(maxIndex + maxValue);
    }
}


Measured memory_bytes: 119136
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define debug(x) cout << #x << " = " << x << '\n'
#define debug_arr(a , n) for(int i = 0 ; i < n ; i++)cout << a[i] << " "
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define vll vector<ll> 
#define inf 1000000000
#define mod 1000000007

const int max_n = 1e5 + 9;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
ll power(ll a , ll b)
{
    ll prod = 1;
    while(b)
    {
        if(b&1)
        prod = (prod*a)%mod;
        a = (a*a)%mod;
        b >>= 1;
    }
    return prod;
}
int main()
{
    ll n;
    cin >> n;
    ll a[n];

    map<ll , ll> m1 , m2;
    for(int i = 0 ; i < n ; i++){
        cin >> a[i];
        for(ll j = 0 ; j < 60 ; j++){
            if(a[i] & (1ll << j)){
                m1[j]++;
            }
            else m2[j]++;
        }
    }
    ll carry = 0 , number = 0 , i = 0;
    for(i = 0 ; i < 60 ; i++){
        ll num = m1[i] * m2[i];

        if((carry + num)%2 != 0){
            number = (number%mod + power(2 , i))%mod;
        }
        carry = (carry + num)/2;
    }
    while(carry){
        if(carry%2){
            number = (number%mod + power(2 , i))%mod;
            
        }
        i++;
            carry /= 2;
    }
    cout << number << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
int ans;
ll n;
void dfs(ll x){

    string s = to_string(x);
    bool ok[3] = {false, false, false};
    rep(i, s.length()){
        if(s[i] == '3'){
            ok[0] = true;
        }
        if(s[i] == '5'){
            ok[1] = true;
        }
        if(s[i] == '7'){
            ok[2] = true;
        }
    }
    if(ok[0] && ok[1] && ok[2] && x <= n){
        ans++;
    }
    if(x <= 1e9){
        dfs(10*x + 3);
        dfs(10*x + 5);
        dfs(10*x + 7);
    }
}

int main() {

    cin >> n;

    dfs(0);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int a[200005],d[200005],n,m,x;
bool cmp(int i,int j){
	return a[i]>a[j];
}
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;++i){
		scanf("%d",&x); ++a[x]; d[i]=i;
	}
	sort(d+1,d+n+1,cmp); x=0;
	for (int i=m+1;i<=n;++i) x+=a[d[i]];
	printf("%d\n",x);
	return 0;
}

Measured memory_bytes: 1792
s={}
j=[]

while 1:
    try:
        n,k=map(str,raw_input().split())
        if s.has_key(n):
            s[n].append(int(k))
        else:
            s[n]=[int(k)]
            j.append(n)
    except:
        break
j.sort()
for i in j:
    print i
    s[i].sort()
    print ' '.join(map(str,s[i]))

Measured memory_bytes: 6392
N = input()
A = list(map(int,input().split()))
c = 0
d = -1
while c>d:
  d+=1
  for i in A:
    if i%2 == 0:
      continue
    else :
      print(c)
      break
  else :
    A=list(map(lambda x :x/2,A))
    c += 1



Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  int a=0,b=0;
  for(int i=0;i<s.size();i++){
    if(s[i]=='0'){
      if(i%2==0){
        a++;
      }else{
         b++;
       }
    }else{
       if(i%2==0){
         b++;
       }else{
         a++;
        }
     }
  }
  cout<<min(a,b)<<endl;
  return 0;
}

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

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = int_fast64_t;
using pll = pair<ll,ll>;
constexpr ll INF = 1LL<<60;
constexpr ll MOD = 1e9+7;
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}
#if loc||local
void dump(){cerr<<endl;}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){cerr<<h<<", ";dump(forward<Ts>(t)...);}
#else
void dump(){}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){}
#endif
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T> ostream &operator<<(ostream& os,vector<T>const& v){for(auto const& vi:v)os<<vi<<" ";return os;}
template<class T,class U> ostream &operator<<(ostream& os,pair<T,U>const& p){os<<p.first<<","<<p.second;return os;}
template<class T>vector<T> vec(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto vec(size_t a, Ts... ts){return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...));}

template<class T>
struct culsum_2D {
  int h,w;
  vector<vector<T>> sum;
  culsum_2D(vector<vector<T>>const& a){
    h = a.size();
    w = a[0].size();
    sum.resize(h+1,vector<T>(w+1));
    for(int i=0;i<h;++i)
      for(int j=0;j<w;++j)
        sum[i+1][j+1] = a[i][j];
    for(int i=0;i<h;i++)
      for(int j=0;j<w;j++)
        sum[i+1][j+1] += sum[i+1][j]+sum[i][j+1]-sum[i][j];
  }
  T get(int sy,int sx,int ty,int tx){
    assert(0<=sy&&0<=sx);
    assert(ty<=h&&tx<=w);
    assert(sy<=ty&&sx<=tx);
    return sum[ty][tx]-sum[ty][sx]-sum[sy][tx]+sum[sy][sx];
  }
};

signed main(){

  int n,m,q;
  cin>>n>>m>>q;
  vector<vector<ll>> a(n,vector<ll>(n));
  rep(i,m){
    int l,r;cin>>l>>r;
    l--;r--;
    a[l][r]++;
  }
  culsum_2D<ll> sum(a);
  vector<int> ans(q);
  rep(i,q){
    int p,q;cin>>p>>q;
    p--;q--;
    ans[i] = sum.get(p,p,q+1,q+1);
  }
  for(auto x:ans)cout<<x<<endl;

}

Measured memory_bytes: 5248
package main

import (
	"fmt"
)

var N int
var A []int

func main() {
	fmt.Scanf("%d", &N)

	A = make([]int, N+2)

	for i := 1; i < N+1; i++ {
		fmt.Scanf("%d", &A[i])
	}

	s := make([]int, N+1)
	for i := 1; i < N+1; i++ {
		s[i] = s[i-1] + Abs(A[i-1]-A[i])
	}

	for i := 1; i < N+1; i++ {
		var ans int
		if i == N {
			ans = s[N]
			ans += Abs(A[N-1]) - (s[N] - s[N-1])
		} else {
			ans = s[i-1] + (s[N] - s[i+1]) + Abs(A[i-1]-A[i+1])
			ans += Abs(A[N])
		}
		fmt.Println(ans)
	}
}

func Abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func Max(x, y int) int {
	if x > y {
		return x
	}
	return y
}


Measured memory_bytes: 6528
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    N,M=map(int,readline().split())
    if N==1 and M==1:
        print(1)
    elif N==1 or M==1:
        print(max(N,M)-2)
    else:
        print((N-2)*(M-2))
if __name__=="__main__":
    main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int d, t, s;
  cin >> d >> t >> s;
  int n = s * t;
  if(n >= d) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3632
e=(0..n=gets.to_i).map{[]}.to_a;(n-1).times{|i|a,b=gets.split.map &:to_i;e[a]<<i;e[b]<<i};c=e.map(&:size).max;a=[0]*(n-1);(1..n).each{|v|u={};e[v].map{|j|u[a[j]]=1};t=1;e[v].map{|j|1>a[j]&&(t+=1until u[t].nil?;a[j]=t;t+=1)}};p c;a.map{|i|p i}

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

int main(){

    long N,K;
    cin >> N >> K;

    if(N>K){
        if(N%K==0){
            cout << 0 << endl;
            return 0;
        }
        
        // 右隣最近傍
        N = N%K+K;
        
    }else if(N==K){
        cout << 0 << endl;
        return 0;
    }

    long prevN = N;
    long tmpN=N;

    while(1){
        tmpN = max(tmpN-K,K-tmpN);
        if(tmpN>=prevN){
            cout << prevN << endl;
            return 0;
        }
        prevN = tmpN;
    }
    

    return 0;
}


Measured memory_bytes: 256
package main
 
import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "sort"
)
 
var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  var line, buffer []byte
  var isPrefix bool = true
  var err error
  for isPrefix {
    line, isPrefix, err = reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
  }
  return string(buffer)
}
func NextInt() int {
  var n int
  n, _ = strconv.Atoi(NextLine())
  return n
}
func NextIntVec() []int {
  L := strings.Split(NextLine(), " ")
  N := make([]int, len(L))
  for i := range N {
    N[i], _ = strconv.Atoi(L[i])
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func Output() {
  _ = writer.Flush()
}

func GCD(a, b int) int {
  if a < b { a, b = b, a}
  if b == 0 { return a }
  return GCD(b, a % b)
}

func main() {
  NK := NextIntVec()
  N, K := NK[0], NK[1]
  A := NextIntVec()
  sort.Ints(A)
  D := A[0]
  if 1 < N {
    for i := 1; i < N; i++ {
      D = GCD(D, A[i] - A[i - 1])
    }
  }
  ans := "IMPOSSIBLE"
  for _, a := range A {
    if a < K { continue }
    if (a - K) % D == 0 {
      ans = "POSSIBLE"
      break
    }
  }
  Write(ans)
  Output()
}

Measured memory_bytes: 6016
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

int main()
{
    string S;
    cin >> S;
    if(S == "Sunny") cout << "Cloudy" << endl;
    else if(S == "Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
}

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

int main()
{
    string s;
    cin >> s;
    int sz = s.size();
    if(s[0] != 'A') return cout << "WA\n", 0;
    int cnt = 0;
    for(int i = 1; i < sz; ++i)
    {
        if(isupper(s[i]))
        {
            if(i == 1 || i == sz - 1 || s[i] != 'C') return cout << "WA\n", 0;
            ++cnt;
        }
    }
    if(cnt != 1) return cout << "WA\n", 0;
    cout << "AC\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define REV(v) reverse(v.begin(), v.end());
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, start, stop) for (ll i = start; i < stop; i++)
#define FORR(i, start, stop) for (ll i = start; i > stop; i--)
#define SORT(v, n) sort(v, v + n);
#define SORTR(v, n) sort(v, v + n,greater<ll>());
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.begin(), v.end(),greater<ll>());
#define REMOVE(v,n) remove(vector<ll> v,v+v.size(),ll n)
#define ERASE(v,n) v.erase(v.begin()+n);
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
#define V(v,i,j) vector(v.begin() + i, v.begin() + j)
#define INSERT(va,vb) va.insert(va.end(), vb.begin(), vb.end())
using namespace std;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
const int MOD = 1000000007;
void chmin(int &a, int b) { if (a > b) a = b; }

//vector< vector<int> > v (size1, vector<int>(size2) );



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,K;
    cin>>N>>K;
    ll b,c;
    ll ans=0;
    FOR(b,K+1,N+1){
        c=N/b;
        if(c*b+K>N)ans+=c*(b-K);
        else ans+=c*(b-K)+N-K-c*b+1;
        if(K==0)ans--;
        //cout<<ans<<endl;
    }
    cout<<ans<<endl;
    

    return 0;
}

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

#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define vi vector<int>

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cerr << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << endl
#define debug_4(x1, x2, x3, x4) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5) cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#define debug(...) CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) (__VA_ARGS__)

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


void Main() {
  int n, m;
  cin >> n >> m;
  int ans = 1;
  int k = 1;
  for(;k*k<=m;++k) {
    if (m % k != 0) continue;
    if (k >= n) ans = max(ans, m/k);
    if (m/k >= n) ans = max(ans, k);
  }
  cout << ans << endl;
}

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


Measured memory_bytes: 256
N, X = map(int, input().split())
A = [int(a) for a in input().split()]

s = sum(A)
if s == X:
    print(N)
else:
    ans = 0
    A = sorted(A)
    for i in range(N-1):
        if sum(A[:i+1]) <= X:
            ans = i+1
            
    print(ans)


Measured memory_bytes: 38512
#include <iostream>
#include <cmath>
#include <cstdio>
#include  <cstdlib>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
typedef long long lint;
#define SZ(x) ((int)(x).size())
int main()
{
	string s;
	cin >> s;
	int c = 0;
	rep(i, s.length()) {
		if (s[i] == '+') c++;
		else c--;
	}
	cout << c << endl;
	return 0;
}


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

int main(){
  int a, b; cin >> a >> b;
  
  int count = 0;
  for(int i = a; i <= b; i++){
    if(i % 10 == i / 10000 && (i / 10) % 10 == (i / 1000) % 10) count++;
  }
  cout << count << endl;
}

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

int main() {
  string s;
  cin >> s;
  int size = s.size();
  for(int i=0; i<size/2;i++){
    if(s.at(i)!=s.at(size-i-1)){
      cout << "No" << endl;
      return 0;
    }
    else if(s.at(i)!=s.at((size-1)/2-i-1)){
      cout << "No" << endl;
      return 0;
    }
  }
      cout << "Yes" << endl;
  return 0;
}
      






Measured memory_bytes: 256
def main():
    S = input()
    T = input()
    st = {}
    ts = {}
    for i in range(97, 97 + 26):
        st[chr(i)] = ""
        ts[chr(i)] = ""
    for s, t in zip(S, T):
        if st[s] == "":
            st[s] = t
        if ts[t] == "":
            ts[t] = s
        if not st[s] == t or not ts[t] == s:
            print("No")
            break
    else:
        print("Yes")


if __name__ == '__main__':
    main()

Measured memory_bytes: 3632