akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*----------------------------------------*/

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  long long h, w; cin >> h >> w;
  if (h % 3 == 0 || w % 3 == 0) {
    cout << 0 << '\n';
    return 0;
  }
  long long ans = LINF, chocolate = h * w;
  FOR(i, 1, h) {
    long long a = w * i, b = (w / 2) * (h - i), c = chocolate - a - b;
    ans = min(ans, max({a, b, c}) - min({a, b, c}));
  }
  FOR(i, 1, w) {
    long long a = i * h, b = (w - i) * (h / 2), c = chocolate - a - b;
    ans = min(ans, max({a, b, c}) - min({a, b, c}));
  }
  ans = min({ans, w, h});
  cout << ans << '\n';
  return 0;
}


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

int main()
{
    int k,a,b,ct=0,i;
    scanf("%d%d%d",&k,&a,&b);
    
    for(i=a; i<=b; i++)
    {
        if(i%k==0)
        {
            printf("OK\n");
            ct=1;
            break;
        }
    }
    if(ct==0)
        printf("NG\n");
    
    return 0;
}


Measured memory_bytes: 3708
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;

#define _               ios_base::sync_with_stdio(0);cin.tie(0)
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define ll              long long
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define mk(arr,n,type)  type *arr=new type[n];
#define vpii            vector<pair<int,int> >
#define umii            unordered_map<int,int>
#define lli             list<int>
#define gcd(m,n)        __gcd(m,n)
#define mib             map<int,bool>


int main(){
  int n,w;
  cin >> n >> w;
  vpii items(n);
  for(int i = 0;i < n;i++){
    cin >> items[i].first >> items[i].second;
  }
  vector<ll> dp(100001, 1e18L);
  dp[items[0].second] = items[0].first;
  for(int i = 1;i < n;i++){
    ll v = items[i].first, c = items[i].second;
    for(int j = 100000;j >= c;j--){
      dp[j] = min(dp[j], dp[j - c] + v);
    }
    dp[c] = min(dp[c],v);
  }
  for(int j = 100000;j >= 0;j--){
    if(dp[j] <= w){
      cout << j << endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 1024
N,M=map(int, input().split())
A=list(map(int, input().split()))
if sum(A)%(4*M)==0:
  a=sum(A)//(4*M)
else:
  a=sum(A)//(4*M)
  a+=1
cnt=0
for i in A:
  if i>=a:
    cnt+=1
 
if cnt>=M:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
const int INF = 1001001001001001LL;


//(l, r]
vector<pair<int, int> > findminmax(vector<int> &vec, int l, int r){

    int sum = vec[r] - vec[l];
    int idx = upper_bound(vec.begin(), vec.end(), (vec[l] + sum / 2)) - vec.begin();

    vector<pair<int, int> >  res;
    //cout << l << " " << r << " " << idx << endl;
    //誤差+-1
    for(int k = -1; k <= 1; k++){
        int x = idx + k;
        int ma = vec[x] - vec[l];
        int mi = vec[r] - vec[x];
        if(x < l || r < x){
            continue;
            //cout << x << " " << l << " " << r << endl;
            //cout << ma << " " << mi << endl;
        }

        if(ma < mi) swap(ma, mi);

        //cout << l << " " << r << " " << mi << " " << ma << endl;
        res.push_back({mi, ma});
    }

    return res;
}

signed main(){

    int n; cin >> n;
    vector<int> acc(n + 1, 0);        //累積和
    acc[0] = 0;

    for(int i = 1; i <= n; i++){
        cin >> acc[i];
        acc[i] += acc[i - 1];
        //cout << acc[i] << " ";
    }
    //cout << endl;

    
    
    //cout << acc[4] - acc[2] << endl;
    //1-indexed
    //(l, r] := acc[r] - acc[l]
    int ans = INF;
    for(int t = 2; t <= n - 2; t++){

        auto va = findminmax(acc, 0, t);
        auto vb = findminmax(acc, t, n);

        
        for(int i = 0; i < va.size(); i++){
            for(int j = 0; j < vb.size(); j++){
                int ma = max(va[i].second, vb[j].second);
                int mi = min(va[i].first, vb[j].first);
                //cout << t << " " << ma << " " << mi << endl;
                ans = min(ans, ma - mi);
            }
        }

    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class DGreedyCustomers {
public:
    static constexpr int kStressIterations = 0;

    static void generateTest(std::ostream& test) {
    }

    void solve(std::istream& cin, std::ostream& cout) {
        int N;
        cin >> N;
        vector<int> A(N);
        REP(i, N) {
            cin >> A[i];
        }

        int cur = 2;
        int res = A[0] - 1;
        FOR(i, 1, N - 1) {
            if (A[i] > cur) {
                res += A[i] / cur;
                if (A[i] % cur == 0) {
                    res--;
                }
            } else if (A[i] == cur) {
                cur++;
            }
        }
        cout << res << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    DGreedyCustomers solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h> 
#define rep(i,n) for(int i=0; i<(n); ++i)
#define cout(x) cout<<x<<endl
#define all(v) v.begin(), v.end()
using namespace std;
//型エイリアス
using vi = vector<int>;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
const ll inf = 1e18;
const int N = 2e5 + 10;


int main(){
    int n;
    string s;
    cin >> n >> s;

    int ans = 0;
    for(int i = 1; i<n-1; ++i){
        string x = s.substr(0,i);
        string y = s.substr(i,n-i);

        set<char> x_set,y_set;
        rep(j,i) x_set.insert(x[j]);
        rep(k,n-i) y_set.insert(y[k]);

        int cnt = 0;
        for(auto l : x_set){
            for(auto m : y_set){
                if(l==m) ++cnt;
            }
        }
        if(ans<cnt) ans = cnt;
    }
    cout(ans);


    return 0;
}

Measured memory_bytes: 256
#include<iostream>

int main(){
  int N;
  bool check=false;
  std::cin>>N;
  
  for(int i=0;i<N;i++)
    for(int j=0;j<N;j++)
      if((4*i)+(7*j)==N)
        check=true;
  
  if(check) std::cout<<"Yes"<<std::endl;
  else std::cout<<"No"<<std::endl;
  
  return 0;
  }

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

int ruit(int n,int h){
  int a = 1;
  for(int i = 0;i < h;i++){
    a *= n;
  }
  return a;
}

int main(){
  int a;
  cin >> a;
  int digits = log10(a);
  int answer = 0;
  for(int i = 0;i <= digits;i += 2){
    if(i == digits){
      answer += (a - ruit(10,i) + 1);
    }else{
      answer += ruit(10,i + 1) - ruit(10,i);
    }
  }
  cout << answer;
}

Measured memory_bytes: 512
import java.io.IOException;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); //命令数
        ArrayDeque<Integer> list = new ArrayDeque<Integer>();
        //命令の読み込み
        for(int i=0; i<n; i++) {
            String com = sc.next();
            switch(com) {
                case "insert": list.push(Integer.parseInt(sc.next())); break;
                case "delete": list.remove(Integer.parseInt(sc.next())); break;
                case "deleteFirst": list.removeFirst(); break;
                case "deleteLast": list.removeLast(); break;
            }
        }
        int a = list.getFirst();
        int b = list.size()-1;
        StringBuilder sb = new StringBuilder();
        for(int i=0; i<b; i++) {
            sb.append(list.poll());
            sb.append(" ");
        }
        if(list.size()!=0) {
            System.out.print(sb);
            System.out.println(list.poll());
        } else {
            System.out.println(a);
        }
    }
}



Measured memory_bytes: 325780
#include <bits/stdc++.h>
const int mod=1e9+7;
int n,len,dp[5005][5005];char s[56000];
#define ll long long
ll qpow(int a, int b) {
	if (b==0) return 1;
	ll d=qpow(a,b>>1);d=(d*d)%mod;
	if (b&1) d=(d*(ll)a)%mod;
	return d;
}

int main() {
	scanf("%d%s",&n,s+1);
	dp[0][0]=1;len=std::strlen(s+1);
	for (int i=0;i<=n;++i) {
		for (int j=0;j<=i;++j) {
			dp[i+1][j+1]=(dp[i+1][j+1]+dp[i][j]*2)%mod;
			dp[i+1][j-(j>0?1:0)]=(dp[i+1][j-(j>0?1:0)]+dp[i][j])%mod;
		}
	}//printf("%d",dp[n][len]);
	printf("%lld",(ll)dp[n][len]*qpow(qpow(2,len),mod-2)%mod);
	return 0;
}

Measured memory_bytes: 96512
#include <iostream>
using namespace std;
 
int main(){
    int a,b,c;
    while(cin >> a >> b >> c){
        if(a==7 && b==c && c==5){
            cout << "YES" << endl;
        }else if(b==7 && a==c && c==5){
            cout << "YES" << endl;
        }else if(c==7 && b==a && a==5){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

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

int main (void) {
    long long A, B, N;
    cin >> A >> B >> N;

    long long x = min(B - 1, N);
    long long ans = (A * x) / B - A * (x / B);

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3520
#include<stdio.h>
#include<stdlib.h>

int compare_int(const void *a, const void *b)
{
    return *(int*)b - *(int*)a;
}

int main() {
  int n, i;
  int a[100010];
  int num[100010] = {};
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    num[a[i]] += 1;
  }
  int num_3[100010];
  for (i = 0; i < 100010; i++) {
    num_3[i] = num[i-1] + num[i] + num[i+1];
  }
  qsort(num_3, 100010, sizeof(int), compare_int);
  printf("%d", num_3[0]);
  return 0;
}


Measured memory_bytes: 1660
from collections import deque

n = int(input())
P = list(int(x) - 1 for x in input().split())
A = [0] * (n**2)
remain = [1] * (n**2)

for i in range(n**2):
    A[i] = min(i % n, n - (i % n) - 1, i // n, n - (i // n) - 1)

ans = 0
for i in range(n**2):
    ans += A[P[i]]
    remain[P[i]] = 0
    que = deque([P[i]])
    while que:
        k = que.popleft()
        if k % n != 0:  # left
            nk = k - 1
            if A[nk] > A[k] + remain[k]:
                A[nk] = A[k] + remain[k]
                que.append(nk)
        if n - (k % n) - 1 != 0:  # right
            nk = k + 1
            if A[nk] > A[k] + remain[k]:
                A[nk] = A[k] + remain[k]
                que.append(nk)
        if k // n != 0:  # up
            nk = k - n
            if A[nk] > A[k] + remain[k]:
                A[nk] = A[k] + remain[k]
                que.append(nk)
        if n - (k // n) - 1 != 0:  # down
            nk = k + n
            if A[nk] > A[k] + remain[k]:
                A[nk] = A[k] + remain[k]
                que.append(nk)

print(ans)


Measured memory_bytes: 110056
import java.util.*;

public class Main {
  public static void main(String[] args) {
    new Main().run();
  }

  private void run() {
    while(sc.hasNext()) {
      final int n = sc.nextInt();

      if(n == 0) break;

      int[] sales = new int[10];
      for(int i = 0; i < 10; i++) sales[i] = 0;

      for(int i = 0; i < n; i++) sales[sc.nextInt()]++;

      for(int i = 0; i < 10; i++) {
        if(sales[i] == 0) System.out.print("-");
        else for(int j = 0; j < sales[i]; j++) System.out.print("*");

        System.out.println();
      }
    }
  }

  private Scanner sc = new Scanner(System.in);
}

Measured memory_bytes: 13000
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)

using namespace std;

namespace mp = boost::multiprecision;

using ll = long long;
using Bint = mp::cpp_int;
ll mod = pow(10, 9) + 7;

int main() {
    // source
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans = 0;
    rep(i, n - 2) {
        if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))
n = int(input())
sheet = [
    [0,0,0],
    [0,0,0],
    [0,0,0],
]
for x in range(n):
    b = int(input())
    if b in a1:
        sheet[0][a1.index(b)] = 1
    elif b in a2:
        sheet[1][a2.index(b)] = 1
    elif b in a3:
        sheet[2][a3.index(b)] = 1
if (sum(sheet[0]) == 3 
    or sum(sheet[1]) == 3 
    or sum(sheet[2]) == 3
    or sheet[0][0] == sheet[1][0] == sheet[2][0] == 1
    or sheet[0][1] == sheet[1][1] == sheet[2][1] == 1
    or sheet[0][2] == sheet[1][2] == sheet[2][2] == 1
    or sheet[0][0] == sheet[1][1] == sheet[2][2] == 1
    or sheet[0][2] == sheet[1][1] == sheet[2][0] == 1):
    print('Yes')
else: print('No')


Measured memory_bytes: 3064
import sys
input = sys.stdin.readline

N = int(input())
ans = 0
for i in range(1, N+1):
    ans += i * (i + 1) // 2
for _ in range(N-1):
    u, v = map(int, input().split())
    if u > v:
        u, v = v, u
    ans -= (N - v + 1) * u
print(ans)



Measured memory_bytes: 73816
n = int(input())
numlist = []
i = 2
ans = 0

while i * i <= n + 1:
    count = 0
    while n % i == 0:
        count += 1
        n //= i
    i += 1
    if count != 0:
        numlist.append(count)
if n != 1:
    numlist.append(1)

while len(numlist) != 0:
    i = 1
    a = numlist.pop(0)
    while a - i >= 0:
        a -= i 
        i += 1
        ans += 1
print(ans)

Measured memory_bytes: 9208
#include <stdio.h>
#include <algorithm>
using namespace std;
long long a[10];
long long h[10];
int main(){
	long long n; scanf("%lld", &n);
	for(int i = 0; i < 5; i++) scanf("%lld", a + i);
	for(int i = 1; i < 5; i++) a[i] = min(a[i], a[i - 1]);
	long long T = 0;
	long long nn = n;
	while(n > 0){
		long long take = (n + a[0] - 1) / a[0];
		long long concluded = min(take * a[4], n);
		T += take + 4;
		n -= concluded;
		if (n > 0) {
			T -= 4;
		}
	}
	printf("%lld\n", T);
	return 0;
}


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

using namespace std;

int s[300][300];

void color_s(int wp_l, int hp_u, int wp_r, int hp_d, int num){
  for(int i = hp_u; i < hp_d; i++){
    for (int j = wp_l; j < wp_r; j++){
      s[i][j] = num;
    }
  }
  return;
}

int main(){
  for(int i = 0; i < 300; i++){
    for (int j = 0; j < 300; j++){
      s[i][j] = 0;
    }
  }

  int h, w, k;
  cin >> h >> w >> k;
  cin.ignore();
  char tmp_s;
  int num = 1;
  for (int i = 0; i < h; i++){
    for (int j = 0; j < w; j++){
      cin >> tmp_s;
      if(tmp_s == '#'){
        s[i][j] = num;
        ++num;
      }
    }
    cin.ignore();
  }


  bool first_found = false;

  int wp_l = 0, hp_u = 0;
  int wp_r = 1, hp_d = 1;

  int tmp_num = 1;
  bool colored = false;
  for (int i = 0; i < h; i++){
    colored = false;
    wp_l = 0;
    for(int j = 0; j < w; j++){
      if(s[i][j] != 0){
        tmp_num = s[i][j];
        color_s(wp_l, hp_u, j + 1, i + 1, tmp_num);
        wp_l = j + 1;
        colored = true;
      } else if ((j == w - 1) && (colored == true)){ // 最終列の場合かつ塗が出た場合、それまでで塗りつぶす
        color_s(wp_l, hp_u, w, i + 1, tmp_num);
      }
    }
    if(colored == true){
      hp_u = i + 1;
    }
  }

  for (int i = hp_u; i < h; i++){
    for(int j = 0; j < w; j++){
      s[i][j] = s[i-1][j];
    }
  }

L_END:
  for (int i = 0; i < h; i++){
    for (int j = 0; j < w; j++){
      printf("%3d ", s[i][j]);
    }
    cout << endl;
  }

  return 0;
}


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

using namespace std;

int main()
{
  int H, W; cin >> H >> W;
  vector<string> a(H);
  for (int i = 0; i < H; ++i) {
    cin >> a[i];
  }

  vector<bool> row(H), col(W);
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (a[i][j] == '#') {
        row[i] = true;
        col[j] = true;
      }
    }
  }

  for (int i = 0; i < H; ++i) {
    if (!row[i]) continue;
    for (int j = 0; j < W; ++j) {
      if (!col[j]) continue;
      cout << a[i][j];
    }
    cout << endl;
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#define L 100001

int main(){
  int N, i, k, a, min_sub = 0;
  int v[L] = {0};

  scanf("%d",&N);
  
  for(i=0;i<N;i++){
  	scanf("%d",&a);
    k = N;
    if(k >= L) 
      k = 100000;
    if(k < a)
      min_sub++;
    else 
      v[a] += 1;
  }
  
  for(i=1;i<=k;i++){
    if(v[i] > i)
      min_sub += v[i] - i;
    else if(v[i] < i)
      min_sub += v[i];
  }

  printf("%d\n",min_sub);

  return 0;
}



Measured memory_bytes: 512
#abc071_b
s=str(input())
s_l=set(s)
alphabet="abcdefghijklmnopqrstuvwxyz"
alpha_l=set(alphabet)
l=alpha_l-s_l
l=sorted(l)

if not l:
	print("None")
else:
	ans=l[0]
	print(l[0])



Measured memory_bytes: 3188
#include <stdio.h>

int main() {

	long long int n;
	scanf("%lld", &n);
	
	long long sum=0;	
	for(long long int i=1; i<=n; i++){
		if(i%3!=0 && i%5!=0){
			sum+=i;
		}
	}

	printf("%lld\n", sum);
	
    return 0;
}


Measured memory_bytes: 3220
import sys

input = sys.stdin.readline
MOD = 1000000007

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

if abs(A-B)%2 == 0:
    print(abs(A-B)//2)
else:
    if (A-1) < (N-B):
        print((A-1)+1+(B-A-1)//2)
    else:
        print((N-B)+1+(B-A-1)//2)

Measured memory_bytes: 3060
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let n: usize = read(&mut stdin_lock, &mut buf, b'\n');
    let mut hv = vec![0i32; n];
    for i in 0..n - 1 {
        hv[i] = read(&mut stdin_lock, &mut buf, b' ');
    }
    hv[n - 1] = read(&mut stdin_lock, &mut buf, b'\n');

    let mut ans = true;
    let mut p = hv[0];
    for i in 0..n {
        if hv[i] == p {
            continue;
        } else if hv[i] > p {
            p = hv[i] - 1;
        } else {
            ans = false;
            break;
        }
    }
    println!("{}", if ans { "Yes" } else { "No" });
}


Measured memory_bytes: 4352
// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 100000, MD = 1000000007;

int dd[N];

int main() {
	int n, k; cin >> n >> k;
	if (n == 1) {
		cout << k << '\n';
		return 0;
	}
	long long ans = (long long) k * (k - 1) % MD;
	while (--n) {
		int i, j; cin >> i >> j, i--, j--;
		if (++dd[i] >= 2)
			ans = ans * (k - dd[i]) % MD;
		if (++dd[j] >= 2)
			ans = ans * (k - dd[j]) % MD;
	}
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 4032
#include <iostream>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#define int long long
using namespace std;
signed main() {
	int D,T,S;
    cin>>D>>T>>S;

    if(T*S>=D){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3632
#include <cstdio>
#include <vector>
#include <cstring>
#include <functional>
#include <algorithm>
#include <math.h>
#include <bitset>
#include <set>
#include <queue>
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <complex>
#include <numeric>
#include <map>
#include <time.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<int,ull> piu;
typedef pair<ull,ull> puu;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef pair<pii,ll> ppl;
typedef pair<ll,pii> plp;
typedef pair<ll,pll> plP;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;
typedef pair<double,int> pdi;
typedef pair<int,double> pid;
typedef pair<double,pii> pdp;
typedef pair<double,double> pdd;
typedef pair<pdd,double> pd3;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
#define repn(i,a,n) for (int (i) = (a); (i) < (n); (i)++)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define SORT(x) sort((x).begin(),(x).end())
#define SORTN(x,n) sort((x),(x)+(n))
#define ERASE(x) (x).erase(unique((x).begin(),(x).end()),(x).end())
#define COUNT(x,c) count((x).begin(),(x).end(),(c))
#define REMOVE(x,c) (x).erase(remove((x).begin(),(x).end(),(c)),(x).end())
#define REVERSE(x) reverse((x).begin(),(x).end())
#define FORIT(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))-(x).begin()
#define lb(x,a) lower_bound((x).begin(),(x).end(),(a))
#define LBN(x,a,n) lower_bound((x),(x)+(n),(a))-(x)
#define lbN(x,a,n) lower_bound((x),(x)+(n),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))-(x).begin()
#define ub(x,a) upper_bound((x).begin(),(x).end(),(a))
#define BS(x,a) binary_search((x).begin(),(x).end(),(a))
#define BS2(x,n,a) binary_search((x),(x)+(n),(a))
#define NB(x) (((x)&~((x)+((x)&-(x))))/((x)&-(x))>>1)|((x)+((x)&-(x)))
#define NP(x) next_permutation((x).begin(),(x).end())
#define MM(x,p) memset((x),(p),sizeof(x))
#define SQ(x) (x)*(x)
#define SC(c1,c2) strcmp(c1,c2)==0
#define mp make_pair
#define INF (1<<29)
#define INFL (1LL<<61)
#define fi first
#define se second
#define EPS 1e-9
#define MOD 1000000007
#define MIN(x,a) x=min(x,a)
#define MAX(x,a) x=max(x,a)
#define madd(x,a) x=(x+a)%MOD
#define msub(x,a) x=(x+MOD-a)%MOD
#define OUTPUT(x) rep(__,x.size())printf("%d%c",x[__],__+1==x.size()?'\n':' ')

int H,W;

int main()
{
	scanf("%d%d",&H,&W);
	int res=min(H,W);
	rep(_,2)
	{
		if(H%3==0)res=0;
		if(H%3!=0)
		{
			repn(i,1,W)
			{
				ll s1=ll(H/3)*W;
				ll s2=ll(H-H/3)*i;
				ll s3=ll(H-H/3)*(W-i);
				ll mi=min(s1,min(s2,s3));
				ll ma=max(s1,max(s2,s3));
				if(res>ma-mi)res=ma-mi;
				s1=ll(H/3+1)*W;
				s2=ll(H-H/3-1)*i;
				s3=ll(H-H/3-1)*(W-i);
				mi=min(s1,min(s2,s3));
				ma=max(s1,max(s2,s3));
				if(res>ma-mi)res=ma-mi;
			}
		}
		swap(H,W);
	}
	printf("%d\n",res);
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(100005)

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

E = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    E[A].append(B)
    E[B].append(A)

visited = [False for _ in range(N)]
ans = []

def dfs(p, one):
    if visited[p]:
        return False
    visited[p] = True
    if not one:
        ans.append(p+1)
    for i in E[p]:
        if dfs(i, one):
            break
    if one:
        ans.append(p+1)
    return True

dfs(0, True)
for i in E[0]:
    if dfs(i, False):
        break
print(len(ans))
for i in ans:
    print(i)

Measured memory_bytes: 104660
#include <stdio.h>
#define c(a,b) ((a)>(b)?(a):(b))
int main (void){
	int W,H,N,n,m,i,p,q,d=0;
	scanf("%d %d %d",&W,&H,&N);
	scanf("%d %d",&n,&m);
	for(i=1;i<N;i++,n=p,m=q){
		scanf("%d %d",&p,&q);
		if((p-n)*(q-m)>0)d+=c(abs(p-n),abs(q-m));
		else d+=abs(p-n)+abs(q-m);
	}
	printf("%d\n",d);
	return 0;
}


Measured memory_bytes: 2036
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        E solver = new E();
        solver.solve(1, in, out);
        out.close();
    }

    static class E {
        static long MOD = (long) (1e9 + 7);
        private static int MAX = (int) (2 * 1e5 + 1);
        private static long[] xs = new long[MAX + 1];
        private static long[] ys = new long[MAX + 1];

        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();

            long ans = 0;
            long max = Math.min(k, n - 1);
            for (int i = 0; i <= max; i++) {
                ans += comb(n, i) * comb(n - 1, i);
                ans %= MOD;
            }
            out.println(ans);
        }

        private long comb(int n, int r) {
            if (r < 0 || r > n) return 0;
            if (xs[0] == 0) {
                xs[0] = 1;
                for (int i = 1; i <= MAX; i++) {
                    xs[i] = xs[i - 1] * i % MOD;
                }
                long inv = modpow(xs[MAX]);
                ys[MAX] = inv;
                for (int i = MAX; i >= 1; i--) {
                    inv = inv * i % MOD;
                    ys[i - 1] = inv;
                }
            }
            return xs[n] * (ys[r] * ys[n - r] % MOD) % MOD;
        }

        private long modpow(long a) {
            return modpow(a, MOD - 2);
        }

        private long modpow(long a, long n) {
            long r = 1;
            while (n > 0) {
                r = r * ((n % 2) != 0 ? a : 1) % MOD;
                a = a * a % MOD;
                n >>= 1;
            }
            return r;
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 23636
fun main(args: Array<String>) {
    Program().solve()
}

class Program {
    fun solve() {
        val sc = MyScanner()
        val (n, m) = sc.intList()
        val a = Array(m) { 0 }
        val c = Array(m) { 0 }
        for (i in 0 until m) {
            a[i] = sc.nextInt()
            val b = sc.nextInt()
            for (j in 0 until b) {
                c[i] = c[i] or (1 shl (sc.nextInt() - 1))
            }
        }

        val target = (1 shl n)
        val dp = Array(target) { Long.MAX_VALUE }
        dp[0] = 0
        for (i in 0 until m) {
            for (j in target - 1 downTo 0) {
                if (dp[j] == Long.MAX_VALUE) continue
                dp[j or c[i]] = Math.min(dp[j or c[i]], dp[j] + a[i])
            }
        }

        println(if (dp[target - 1] == Long.MAX_VALUE) -1 else dp[target - 1])
    }
}


class MyScanner() {
    private var index = 0
    private var line = listOf<String>()

    fun next(): String {
        while (line.size <= index) {
            line = readLine()!!.split(' ')
            index = 0
        }
        return line[index++]
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextDouble() = next().toDouble()
    fun nextCharArray() = next().toCharArray()
    fun nextChar() = next()[0]

    fun strList(): List<String> {
        index = line.size
        return readLine()!!.split(' ')
    }

    fun intList() = strList().map { it.toInt() }
    fun longList() = strList().map { it.toLong() }
    fun doubleList() = strList().map { it.toDouble() }
}

Measured memory_bytes: 51124
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;$n:expr) => {
        (0..$n).map(|_| scan!()).collect::<Vec<_>>()
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn dfs(graph: &[Vec<i64>], n: usize, visited: &mut Vec<bool>) {
    visited[n] = true;

    for &m in graph[n].iter() {
        if m >= 0 && !visited[m as usize] {
            dfs(graph, m as usize, visited)
        }
    }
}

fn all_visit(graph: &[Vec<i64>]) -> bool {
    let mut visited = (0..graph.len()).map(|_| false).collect();
    dfs(&graph, 0, &mut visited);

    for v in visited.into_iter() {
        if !v {
            return false;
        }
    }
    true
}

fn main() {
    let (n, m) = scan!(usize, usize);

    let mut graph: Vec<Vec<_>> = (0..n).map(|_| Vec::new()).collect();
    for _ in 0..m {
        let (a, b) = scan!(usize, i64);
        graph[a - 1].push(b - 1);
        graph[(b - 1) as usize].push(a as i64 - 1);
    }

    let mut ans = 0;
    for i in 0..graph.len() {
        for j in 0..graph[i].len() {
            let n = graph[i][j];
            graph[i][j] = -1;
            if !all_visit(&graph) {
                ans += 1
            }
            graph[i][j] = n;
        }
    }
    println!("{}", ans)
}


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

P f(int x) {
  int a = x % 10;
  int b = 0;
  while(x) {
    b = x;
    x /= 10;
  }
  return P(a, b);
}

int main() {
  int N;
  cin >> N;
  map<P, int> freq;
  for (int i = 1; i <= N; i++) {
    P p = f(i);
    freq[p]++;
  }
  ll ans = 0;
  for (int i = 1; i <= N; i++) {
    P p = f(i);
    P q(p.second, p.first);
    ans += freq[q];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <cstdlib>

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

int main() {
	int n, a; cin >> n >> a;
	int x[n], y[n], X=a;
	for(int i = 0; i < n; i++) {
		cin >> x[i];
		X = max(X, x[i]);
		y[i] = x[i]-a;
	}
	long long int dp[n][2*n*X+1] = {};
	for(int j = 0; j < n; j++) {
		for(int t = 0; t < 2*n*X+1; t++) {
			if(j == 0) {
				if(t == n*X) dp[j][t]++;
				if(t == n*X+y[j]) dp[j][t]++;
			}
			if(j > 0 && t - y[j] >= 0 && t - y[j] <= 2*n*X) dp[j][t] = dp[j-1][t] + dp[j-1][t-y[j]];
			else if(j > 0 && t-y[j] < 0) dp[j][t] = dp[j-1][t];
			else if(j > 0 && t-y[j] > 2*n*X) dp[j][t] = dp[j-1][t];
			//print(n, X);
		}
	}
	cout << dp[n-1][n*X] - 1 << endl;
}

Measured memory_bytes: 2176
import numpy as np

N,D=map(int, input().split())
S = []
for _ in range(N):
    S.append(list(map(int, input().split())))
x=0
S=np.array(S)
for i in range(N):
    for j in range(i):
        t=np.linalg.norm(S[i]-S[j])
        if t == int(t):
            x+=1      
print(x)

Measured memory_bytes: 18604
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner(System.in);
		in.nextInt();
		int m = in.nextInt();
		int city[][] = new int[m][4]; // 0:id, 1:pref, 2:year, 3:number
		int id = 0;
		for ( int c[] : city ) {
			c[0] = id++;
			c[1] = in.nextInt();
			c[2] = in.nextInt();
		}
		in.close();

		// pref, yearでソート
		Arrays.sort(city, (c1, c2) -> {
			return (c1[1] != c2[1]) ? c1[1] - c2[1] : c1[2] - c2[2];
		});

		// ナンバリング
		city[0][3] = 1;
		for ( int i = 1; i < m; i++ ) {
			city[i][3] = (city[i][1] == city[i - 1][1] ? city[i - 1][3] + 1 : 1);
		}

		// idでソート
		Arrays.sort(city, (c1, c2) -> {
			return c1[0] - c2[0];
		});

		// 整形して出力
		DecimalFormat df = new DecimalFormat("000000");
		StringBuilder sb = new StringBuilder();
		for ( int c[] : city ) {
			sb.append(df.format(c[1])).append(df.format(c[3])).append("\n");
		}
		System.out.println(sb);
	}
}


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

using ll = long long;
template <typename T> constexpr T inf = numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity() : numeric_limits<T>::max() / 4;

#define REP(i, stop) FOR(i, 0, stop)
#define FOR(i, start, stop) for (ll i = start, i##_len = stop; i < i##_len; ++i)
#define RREP(i, n) for (ll i = n; i-- > 0;)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define COMP(key) [](const auto& a, const auto& b) { return a.key < b.key; }

template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& a) { return is >> a.first >> a.second; }
template<typename T> istream& operator>>(istream& is, vector<T>& a) { for (T& x : a) is >> x; return is; }

template<typename T> using pop_max = std::priority_queue<T>;
template<typename T> using pop_min = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T> void LOG(const T& x) { cerr << x << "\n"; }
template<typename T> void LOG(const vector<T>& a) { for (const T& x : a) cerr << x << " "; cerr << "\n"; }
template<typename T> void LOG(const vector<vector<T>>& a) { for (const auto& x : a) LOG(x); }
template<typename T, std::size_t S> void LOG(const T (&a)[S]) { REP(i, S) cerr << a[i] << " "; cerr << "\n"; }
template<typename T, std::size_t S, std::size_t R> void LOG(const T (&a)[S][R]) { REP(i, S) { REP(j, R) cerr << a[i][j] << " "; cerr << "\n"; } }

ll ceil(ll a, ll b) { return a > 0 ? (a - 1) / b + 1 : a / b; }
ll gcd(ll a, ll b) { while (b != 0) { ll t = b; b = a % b; a = t; } return a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll gcd(const vector<ll>& v) { return accumulate(v.begin(), v.end(), 1LL, static_cast<ll(*)(ll, ll)>(gcd)); }
ll lcm(const vector<ll>& v) { return v.empty() ? 0LL : accumulate(v.begin() + 1, v.end(), v[0], static_cast<ll(*)(ll, ll)>(lcm)); }
ll pow(ll x, ll y, ll z) { ll a = 1; while (y > 0) { if (y & 1) a = a * x % z; x = x * x % z; y /= 2; } return a; }
ll inv(ll x, ll m) { return pow(x, m - 2, m); }

template<typename T> bool chmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<typename T> bool chmin(T& x, const T& y) { return x > y ? x = y, true : false; }

struct InitCpp { InitCpp() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_cpp;

const ll INF = inf<ll>;
using P = pair<ll, ll>;
const ll M = 1000000007;
signed main() {
    ll a,b,m;
    cin>>a>>b>>m;
    vector<ll> A(a),B(b);
    cin>>A>>B;
    ll ma=A[0];
    REP(i,a)chmin(ma,A[i]);
    ll mb=A[0];
    REP(i,b)chmin(mb,B[i]);
    ll ans=ma+mb;
    REP(_,m){
        ll x,y,c;
        cin>>x>>y>>c;
        chmin(ans,A[x-1]+B[y-1]-c);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const int N = 2002;
const int val[3] = {5,3,2};

int idol[N][3];

double dp2[N][N];
// i回以上アピールをする確率
double p[N];

double dp[N][3];

double E[3][N];

int main(){
    int n,m;
    cin >>n >>m;
    rep(i,n)rep(j,3) cin >>idol[i][j];

    dp2[0][0] = 1;
    rep(i,m){
        rep(j,i+1){
            dp2[i+1][j+1] += dp2[i][j]/3;
            dp2[i+1][j] += dp2[i][j]*2/3;
        }
    }

    rep(i,m+1) p[i] = dp2[m][i];
    for(int i=m-1; i>=0; --i) p[i] += p[i+1];

    rep(i,3){
        rep(j,m+1){
            int appeal = j*idol[0][i];

            // 最下位になる確率
            double worst = 1;
            for(int k=1; k<n; ++k){
                // num*idol[k][i]>=appeal
                int num = (appeal+idol[k][i]-1)/idol[k][i];
                if(num>m) worst *= 0;
                else worst *= p[num];
            }

            // 3位以内に入れる確率
            memset(dp,0,sizeof(dp));
            dp[1][0] = 1;
            for(int k=1; k<n; ++k){
                int num = (appeal+idol[k][i]-1)/idol[k][i];
                double win = 0;
                if(num<=m) win = p[num];
                rep(r,3){
                    if(r+1<3) dp[k+1][r+1] += dp[k][r]*win;
                    dp[k+1][r] += dp[k][r]*(1-win);
                }
            }

            E[i][j] = (dp[n][0]+dp[n][1]+dp[n][2])*val[i] - worst;
        }
    }


    double ans = -1234567;
    rep(i,m+1)rep(j,m+1){
        int k = m-i-j;
        if(k<0) continue;
        ans = max(ans, E[0][i]+E[1][j]+E[2][k]);
    }
    printf("%.15f\n", ans);
    return 0;
}



Measured memory_bytes: 25956
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)
#define PI (3.14159265358979323846)
using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

int N;
vector<pair<Int,Int>> XY;

double solve(void) {
    double ans = 0;
    double pi = acos(-1.0);
    for(int theta = 0;theta <= 360*2;theta++) {
        Int X = 0;
        Int Y = 0;
        for(int i = 0;i < N;i++) {
            double xcos = cos(theta*pi/360);
            double ysin = sin(theta*pi/360);
            if(xcos*XY[i].first+ysin*XY[i].second > 0) {
                X += XY[i].first;
                Y += XY[i].second;
            }
        }
        ans = max(ans, sqrt(X*X+Y*Y));
    }

    return ans;
}

int main(void) {
    cin>>N;

    for(int i= 0;i < N;i++) {
        double x,y;
        cin>>x>>y;
        XY.push_back({x,y});
    }

    cout<<fixed<<setprecision(18);
    cout<<solve()<<endl;

    return 0;
}





Measured memory_bytes: 1144
/**
 * C - Multiple Gift
 * https://atcoder.jp/contests/abc083/tasks/arc088_a
 **/
#include<iostream>
#include <cmath>
#include <limits>
 
using namespace std;
 
int main() {
    long long X, Y;
    cin >> X >> Y;
    cout << floor(log2((long double)Y/(long double)X)+1) << endl;
}

Measured memory_bytes: 384
#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#define ll long long int
#define hell 1000000007LL
using namespace std;
ll power(ll x, ll y){ 
    if(y==0)
     return 1;
    else
    {
        ll p=power(x,y/2);
        if(y%2==0)
         return (p*p)%hell;
        else
        return (x*((p*p)%hell))%hell;
    }}
ll gcd(ll x,ll y)
{
    if(y==0)
     return x;
    else
    return gcd(y,x%y);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(20);
    ll n;
    cin>>n;
    ll a[n],c=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        if(i%2==0&&a[i]%2==1)
        c++;
    }
    cout<<c;}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); i++)
#define FI first
#define SE second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define TS to_string
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define SP(x) setprecision((ll)x)


ll INF = 1e9;
ll NIL = -1;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "Yes" << endl;}
void no(){ cout << "No" << endl;}

//-----------------------------------------
ll n, k;
vll dp;
vll h;

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

    cin >> n >> k;
    vll z(n,0);
    dp = h = z;

    REP(i,n){
        cin >> h[i];
        dp[i] = LINF;
    }

    dp[0] = 0;

    REP(i,n){
        REP(j,k){
            if(i+j<n) dp[i+j+1] = min(dp[i+j+1],dp[i] + abs(h[i+j+1]-h[i]));
        }
    }

    cout << dp[n-1] <<endl;


    
    return 0;
}



Measured memory_bytes: 5580
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()


int main(){
    int n,k;
    cin>>n>>k;
    rep(i,n){
        int a;
        cin>>a;
    }
 
    if(n==k){
        cout<<1<<endl;
        return 0;
    }
 
    int ans=0;
    int r=0;
    while(r<n-1){
        ans++;
        r+=k-1;
    }
    cout<<ans<<endl;
}



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

#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define pb  push_back
#define clr(a, n) memset(a, n, sizeof a)

typedef vector<int> vi;
typedef long long ll;
const int mod = 1e9+7;
const int N = 3e5 + 9;
const int MAXNODES = 1e5+9;

ll rec(ll x) {
	if(x == 1)
		return 1;
	return 2 * rec(x / 2) + 1;
}

int main() {

	ll h;
	cin >> h;
	cout << rec(h) << "\n";
	return 0;
}


Measured memory_bytes: 256
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
def do():
    a,b,c = STRM()
    A,B,C=a.upper(),b.upper(),c.upper()
    print(A[0]+B[0]+C[0])
    
if __name__ == '__main__':
    do()

Measured memory_bytes: 3060
n=int(input())
ab=[list(map(int, input().split())) for _ in range(n)]

cnt=0
for i in range(n):
    a=ab[n-i-1][0]
    b=ab[n-i-1][1]
    a+=cnt
    amari=a%b
    if amari!=0:
        cnt+=b-amari
print(cnt)

Measured memory_bytes: 27044
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        
        for (int i = 1; i <= n; i++) {
            int x = i;
            if (x % 3 == 0) {
                System.out.printf(" %d", i);
                continue;
            }
            while (x > 0) {
                boolean endFlag = false;
                if (x % 10 == 3) {
                    System.out.printf(" %d", i);
                    endFlag = true;
                }
                if (endFlag) break;
                x /= 10;
            }
        }
    	System.out.printf("\n");           
    }
}


Measured memory_bytes: 39060
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44

using namespace std;



int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int n, k;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n >> k;

    if(k == 1) {
        cout << 0;
    }
    else {
        cout << (n - k);
    }

    //cin.close();
    //cout.close();
    return 0;
}


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

int num,ban[10];

main()
{
	int k;
	scanf("%d %d",&num,&k);
	for(int i=0;i<k;i++)
	{
		int a;
		scanf("%d",&a);
		ban[a]=1; 
	}
	for(int i=num;i<=1000000;i++)
	{
		int nw=i,ck=1;
		while(nw>0)
		{
			if(ban[nw%10]==1)
			{
				ck=0;
				break;
			}
			nw/=10;
		}
		if(ck==1)
		{
			printf("%d",i);
			return 0;
		}
	}
}

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

if (n >= 400) and (n < 600):
  print(8)
if (n >= 600) and (n < 800):
  print(7)
if (n >= 800) and (n < 1000):
  print(6)
if (n >= 1000) and (n < 1200):
  print(5)
if (n >= 1200) and (n < 1400):
  print(4)
if (n >= 1400) and (n < 1600):
  print(3)
if (n >= 1600) and (n < 1800):
  print(2)
if (n >= 1800) and (n < 2000):
  print(1)

Measured memory_bytes: 9156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define pf push_front
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 

int main() {
	int n;
	cin >> n;
	vector<int> d(n);
	forn(i, n) cin >> d[i];
	int sum = 0;
	forn(i, n) {
		for(int j = i+1; j < n; j++) {
			sum += d[i]*d[j];
		}
	}
	cout << sum << endl;
	return 0;
}



Measured memory_bytes: 3596