akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)           //1LL<<63でオーバーフロー
#define inf (1<<29)             //1<<29でオーバーフロー

int main(int argc,char* argv[]){
    int n,m,c;
    cin >> n >> m >> c;

    vector<int> b(m);
    for(auto &x:b)
        cin >> x;
    
    vector<vector<int>> a(n,vector<int>(m));
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin >> a[i][j];
        }
    }

    int ans=0;
    for(int i=0;i<n;i++){
        int sum=0;
        for(int j=0;j<m;j++){
            sum+=a[i][j]*b[j];
        }
        if(sum+c>0) ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3636
# 2019/12/7

n=int(input())
a,b=map(int,input().split())
p=list(map(int,input().split()))

f,s,t=0,0,0
for e in p:
    if e<=a:f+=1
    elif b+1<=e:t+=1
    else:s+=1
print(min(f,s,t))

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

long long int n;
int num[8]={0,1,2,3,5,7,8,9};

int main(void){
	while(1){
		scanf("%lld",&n);
		if(n==0)break;
		string str;
		while(n>0){
			int s=num[n%8];
			str+=s+'0';
			n=n/8;
		}
		reverse(str.begin(),str.end());
		cout << str << endl;
	}
    return 0;
}

Measured memory_bytes: 1208
# -*- coding: utf-8 -*-

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

s_set = list(set(s))
ans = 0
for card in s_set:
    count = s.count(card) - t.count(card)
    ans = max(count, ans)

print(ans)


Measured memory_bytes: 3060
N = int(input())
A = list(map(int, input().split()))

MAX = max(A)

# remap
AR = [0] * (MAX+1)
V = [False] * (MAX+1)
for i in range(N): AR[A[i]] += 1
pairwise, setwise = True, True

# sieve
for i in range(2, MAX+1):
    if V[i]: continue
    cnt, j = 0, i
    while j < MAX+1:
        cnt += AR[j]
        V[j] = True
        j += i
    if cnt > 1: pairwise = False
    if cnt == len(A): setwise = False

if pairwise:
    print('pairwise coprime')
elif setwise:
    print('setwise coprime')
else:
    print('not coprime')

Measured memory_bytes: 196904
# coding: utf-8
# Your code here!
N=int(input())

if N==2:
    print(2)
    exit()

for i in range(N,10**5+10):
    flag=True
    for j in range(2,-int((-(i**0.5)//1))+1):
        if i%j==0:
            flag=False
            break
    if flag:
        print(i)
        exit()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
int main() {
  int N, K;
  cin >> N >> K;
  vector<char> D(K);
  REP(i, K) cin >> D[i];
  for (int i = N;; i++) {
    string s = to_string(i);
    bool ok = true;
    REP(j, s.size()) REP(k, K) {
      if (s[j] == D[k]) ok = false;
    }
    if (ok) {
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3580
program main
 implicit none

 integer*16 R,G,B,N,N1,N2,i,j,k,l,cnt

 read(*,*) R,G,B,N

 cnt = 0
 k = N / R
 do i=0,k
  N1 = N - i*R
  l = N1 / G
  do j=0,l
   N2 = N1 - j*G
   if(mod(N2,B) == 0) then
    cnt = cnt + 1
   end if
  end do
 end do

 write(*,*) cnt
end program main

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

#define ll long long int
#define maximum 0x7f

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

int n;

int main()
{
    ll W,V=0;
    int ans=0;
    cin>>n>>W;
    ll w[n];
    int v[n];
    for(int i=0; i<n; i++)
    {
        cin>>w[i]>>v[i];
        V+=v[i];
    }
    ll dp[V+1];
    memset(dp,maximum,sizeof dp);
    dp[0]=0;
    for(int i=0;i<n;i++)
    {
        for(int j=V;j>=v[i];j--)
        {
            if(dp[j-v[i]]+w[i]<dp[j]&&dp[j-v[i]]+w[i]<=W)
            {
                dp[j]=dp[j-v[i]]+w[i];
                ans=max(ans,j);
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct edge {
	int to, cost;
	edge(int to_, int cost_) : to(to_), cost(cost_) {};
};
bool operator<(const edge& e1, const edge& e2) {
	return e1.cost < e2.cost;
}
using namespace std;
template<class Type>
std::vector<Type> shortest_path_dijkstra(std::vector<std::vector<edge> > &G, int s) {
	std::priority_queue<edge> que; que.push(edge(s, 0));
	std::vector<Type> ret(G.size(), std::numeric_limits<Type>::max()); ret[s] = 0;
	while (!que.empty()) {
		edge u = que.top(); que.pop();
		for (edge e : G[u.to]) {
			if (ret[e.to] > ret[u.to] + e.cost) {
				ret[e.to] = ret[u.to] + e.cost;
				que.push(edge(e.to, -ret[e.to]));
			}
		}
	}
	return ret;
}
std::vector<int> shortest_path_tree(std::vector<std::vector<edge> > &G, int s) {
	std::priority_queue<edge> que; que.push(edge(s, 0));
	std::vector<long long> ret(G.size(), std::numeric_limits<long long>::max()); ret[s] = 0;
	std::vector<int> res(G.size());
	while (!que.empty()) {
		edge u = que.top(); que.pop();
		for (edge e : G[u.to]) {
			if (ret[e.to] > ret[u.to] + e.cost) {
				ret[e.to] = ret[u.to] + e.cost;
				res[e.to] = u.to;
				que.push(edge(e.to, -ret[e.to]));
			}
		}
	}
	return res;
}
int n, a, b, w;
int main() {
	cin >> n;
	vector<vector<edge> > G(n);
	for (int i = 1; i < n; i++) {
		cin >> a >> b >> w;
		G[a].push_back(edge(b, w));
		G[b].push_back(edge(a, w));
	}
	vector<int> v1 = shortest_path_dijkstra<int>(G, 0);
	int pos1 = max_element(v1.begin(), v1.end()) - v1.begin();
	vector<int> v2 = shortest_path_dijkstra<int>(G, pos1);
	int pos2 = max_element(v2.begin(), v2.end()) - v2.begin();
	vector<int> v3 = shortest_path_dijkstra<int>(G, pos2);
	vector<int> v4 = shortest_path_tree(G, pos1);
	vector<int> path = { pos2 };
	int pos = pos2;
	while (pos != pos1) {
		pos = v4[pos];
		path.push_back(pos);
	}
	vector<int> v5 = v2;
	for (int i = 0; i < n; i++) v5[i] = max(v5[i], v3[i]);
	for (int i = 0; i < n; i++) cout << v5[i] << endl;
	return 0;
}

Measured memory_bytes: 3956
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <numeric>
#include <iomanip>
#include <climits>
#include <cstring>
#include <cmath>

using namespace std;

#define int long long
#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 rrep(i, n) for (int i=(int)(n)-1;i>=0;--i)
#define rrep1(i, n) for (int i=(int)(n);i>=1;--i)
#define range(i, l, r) for (int i=l;i<(int)(r);++i)
#define rrange(i, l, r) for (int i=(int)(r)-1;i>=l;--i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using vi=vector<int>;
using pii=pair<int, int>;
using vpii=vector<pii>;
using ll=long long;

constexpr int TEN(int n){return n==0?1:10*TEN(n-1);}
template<typename T>bool chmin(T&a,T b){return a>b?(a=b,1):0;}
template<typename T>bool chmax(T&a,T b){return a<b?(a=b,1):0;}
int read(){int a;scanf("%lld",&a);return a;}

const long double pi = acos(-1);
constexpr int inf = 3*TEN(18) + 10;

int N, M;
vi G[100010];
int color[100010];

signed main()
{
	cin >> N >> M;

	rep(i, M) {
		int a, b; cin >> a >> b;
		--a, --b;
		G[a].PB(b);
		G[b].PB(a);
	}

	memset(color, -1, sizeof color);
	queue<int> q;
	q.push(0);
	color[0] = 1;
	int counter[2] = {0, 0};
	counter[1]++;

	bool is_bipartite = true;

	while (q.size()) {
		int cur = q.front(); q.pop();

		for (int nxt : G[cur]) {
			if (color[nxt] != -1) {
				if (color[cur] == color[nxt]) {
					is_bipartite = false;
					goto out;
				}
			} else {
				color[nxt] = !color[cur];
				counter[color[nxt]]++;
				
				q.push(nxt);
			}
		}
	}
out:;

	if (is_bipartite) {
		cout << counter[0] * counter[1] - M << endl;
	} else {
		cout << N * (N - 1) / 2 - M << endl;
	}
}




Measured memory_bytes: 10940
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		long k = scn.nextLong();

		long sum = 0;
		int[] as = new int[n];
		int[] bs = new int[n];
		for(int i=0;i<n;i++){
			int a = Integer.parseInt(scn.next());
			int b = Integer.parseInt(scn.next());
			as[i] = a;
			bs[i] = b;
		}


		Integer[] indexes = new Integer[as.length];
		for (int i = 0; i < indexes.length; i++) {
			indexes[i] = i;
		}

		Arrays.sort(indexes, new Comparator<Integer>() {
			@Override
			public int compare(Integer i1, Integer i2) {
				return Double.compare(as[i1], as[i2]);
			}
		});



		for(int i=0;i<n;i++){
			sum += bs[indexes[i]];
			if(sum >= k){
				System.out.println(as[indexes[i]]);
				break;
			}
		}
	}
}


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

int main() {
  int N;
  cin >> N;
  if (N%10==0 || N%10==1 || N%10==6 || N%10==8){
    cout << "pon";
  }
  if (N%10==3){
    cout << "bon";
  }
  if (N%10==2 || N%10==4 || N%10==5 || N%10==7 || N%10==9){
    cout << "hon";
  }
}

Measured memory_bytes: 3632
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN = 100000;

int n;
int a[2 * MAXN];

void run() {
	scanf("%d", &n); REP(i, 2 * n) scanf("%d", &a[i]);
	sort(a, a + 2 * n); reverse(a, a + 2 * n);
	double ret = 0; REP(i, 2 * n) ret += 1.0*(2 * n - i - 1) / (2 * n - 1)*a[i];
	printf("%.15lf\n", ret);
}

int main() {
	run();
	return 0;
}


Measured memory_bytes: 1024
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == i*500 + j*100 + 50*k:
                cnt+=1
print(cnt)

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

int main(void) {
    string S; cin >> S;
    if(S[2]==S[3] && S[4]==S[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

#define rep(i,j,n) for(int i=j;i<n;++i)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(), i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 1e9 + 7;

typedef long long i64;
typedef pair<int, int> pi;

template <class T> using vt = vector<T>;
template <class T> using vvt = vector<vector<T>>;

i64 gcd(i64 n, i64 m) {return (m == 0? n : gcd(m, n % m));}
i64 lcd(i64 n, i64 m) {return (n / gcd(n, m) * m);}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

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

  int n;
  cin >> n;
  vt<int> b(n);
  rep(i, 0, n) cin >> b[i];

  deque<int> ans;
  for(int i = n; i > 0; --i) {
    for(int j = i; j > 0; --j) {
      if(b[j - 1] == j) {
        ans.push_front(j);
        b.erase(b.begin() + (j - 1));
        break;
      }
    }
  }

  if(ans.size() != n) return cout << -1 << endl, 0;
  rep(i, 0, n) cout << ans[i] << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<cstdio>
#include<cstdlib>
#define reep(n1,n2,n3) for(int n1=n3;n1<n2;n1++)
#define rep(n1,n2) reep(n1,n2,0)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define INF 1e9
using namespace std;
typedef long long int lint;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int,int> > vp;
typedef pair<int,int> pi;
typedef pair<int,pair<int,int> > pii;
typedef vector<string> vs;
const double PI  = acos(-1.0);
int main(){
    int s=0,t=0;
    rep(i,4){
        int a;
        cin>>a;
        s+=a;
    }
    rep(i,4){
        int a;
        cin>>a;
        t+=a;
    }
    cout<<(s>=t?s:t)<<endl;
}

Measured memory_bytes: 1160
#include <iostream>
 
using namespace std;
int main() {
    long long N;
    long long A[100001];
    long long B[100000];
    cin >> N;
    for (int i=0; i<N+1; i++) cin >> A[i];
    for (int i=0; i<N; i++) cin >> B[i];
 
    long long x = 0;
    for (int i=0; i<N; i++) {
        if (A[i] < B[i]) {
            x += A[i];
            B[i] -= A[i];
        } else {
            x += B[i];
            B[i] = 0;
        }
        if (A[i+1] < B[i]) {
            x += A[i+1];
            A[i+1] = 0;
        } else {
            x += B[i];
            A[i+1] -= B[i];
        }
    }
    cout << x << endl;
    return 0;
}
 

Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {
	void run() {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		char[] c = sc.next().toCharArray();
		int x = 0;
		int max = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] == 'I') {
				x++;
			} else {
				x--;
			}
			max = Math.max(max, x);
		}
		System.out.println(max);
	}

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


Measured memory_bytes: 9044
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)    \
  for (auto v : (V)) { \
    cerr << v << " ";  \
  }                    \
  cerr << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
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;
}
template <class T> using vec = std::vector<T>;
template <class T> void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int X, A, B;
  cin >> X >> A >> B;
  print((X - A) % B);
}

Measured memory_bytes: 256
pub mod fenwick_tree {
    use std::ops::AddAssign;
    use std::ops::Sub;
    //Binary Indexed Tree
    pub struct FenwickTree<T> {
        values: Vec<T>,
        init_value: T,
    }

    impl<T: Copy + Clone + AddAssign + Sub<Output = T>> FenwickTree<T> {
        pub fn new(n: usize, init_value: &T) -> FenwickTree<T> {
            FenwickTree {
                values: vec![init_value.clone(); n + 1],
                init_value: init_value.clone(),
            }
        }
        //[l, r)
        pub fn query(&self, l: usize, r: usize) -> T {
            self.sum(r) - self.sum(l)
        }
        //[0, i)
        pub fn sum(&self, i: usize) -> T {
            let mut result = self.init_value;
            let mut x = i as i32 - 1;
            while x >= 0 {
                result += self.values[x as usize];
                x = (x & (x + 1)) - 1;
            }
            result
        }

        pub fn add(&mut self, i: usize, x: &T) {
            let mut index = i;
            while index < self.values.len() {
                self.values[index] += *x;
                index |= index + 1;
            }
        }
    }
}

fn solve() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let p: Vec<usize> = sc.vec(n);
    let mut bit = fenwick_tree::FenwickTree::new(200010, &0);
    let mut result = 0;
    for (idx, x) in p.iter().enumerate() {
        bit.add(*x, &1);
        if bit.sum(200009) - bit.sum(*x) == idx + 1 {
            result += 1;
        }
    }
    println!("{}", result);
}

fn main() {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024) // 64MB
        .spawn(|| solve())
        .unwrap()
        .join()
        .unwrap();
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 12668
/*
* @Author: windystreet
* @Date:   2018-08-05 20:55:05
* @Last Modified by:   windystreet
* @Last Modified time: 2018-08-05 21:04:25
*/
#include<bits/stdc++.h>

using namespace std;

#define X first
#define Y second
#define eps  1e-5
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;

const int maxn = 1e5+2;
const int INF  = 1<<30;
const int mod  = 1e9+7;

void solve(){
	string  s;
	cin>>s;
	int flag = 1;
	int cnt1 =0;
	int cnt2 = 0;
	int len = s.size();
	if(s[0]!='A'){cout<<"WA";return;}
	for(int i = 2;i<len;i++){
		if(s[i]=='C'){
			cnt1++;
		}
	}
	if(cnt1!=1)flag=0;
	for(int i=1;i<=len;i++){
		if(isupper(s[i])){
			cnt2++;
		}
	}
	if(s[len-1]=='C')flag=0;
	if(cnt2!=1)flag=0;
	if(flag){
		cout<<"AC\n";
	}else{
		cout<<"WA\n";
	}

    return;
}

int main()
{
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    ios::sync_with_stdio(false);
    int t = 1;
    //scanf("%d",&t);
    while(t--){
    //    printf("Case %d: ",cas++);
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#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;

int main()
{
    string S;
    cin >> S;

    //! 偶数を黒
    ll min = INF;

    {
        ll m = 0;
        REP(i, S.length())
        {
            if ((S[i] - '0') == i % 2)
                m++;
        }
        min = std::min(min, m);
    }

    {
        ll m = 0;
        REP(i, S.length())
        {
            if ((S[i] - '0') != i % 2)
                m++;
        }
        min = std::min(min, m);
    }
    cout << min << endl;
    return 0;
}

Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
#include <random>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
#define CONTAINS_SET(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }


signed main()
{
	string s, t;
	cin >> s;
	cin >> t;

	int ma = 0;
	for (int i = 0; i <= (s.length() - t.length()); i++)
	{
		int cnt = 0;
		for (int j = 0; j < t.length(); j++)
		{
			if (s[i + j] == t[j])
			{
				cnt++;
			}
		}
		ma = max(cnt, ma);
	}
	cout << (t.length () - ma) << endl;
}



Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

#define MOD 1000000007

LL mult(LL a, LL b){
    return ((a % MOD) * (b % MOD)) % MOD;
}

LL solve2(LL a, LL b, LL c, LL d){
    LL ans = 0;
    LL i = 1;
    while(i < (c-d)){
        LL go = 1e9;
        LL go1 = 0;
        //if(i < 1000000 || (c-d-i) < 1000000) go1 = 1;
        LL x = a*i/c;
        LL y = b*i/c;
        LL l1 = min(a-1, x+d) - max(0LL, x-d);
        LL l2 = min(b-1, y+d) - max(0LL, y-d);

        if(l1 == 2*d){
            go = min(go, c*(a-d-1)/a - i);
        } else {
            go = min(go, (c*(x+1)-1)/a - i);
        }

        if(l2 == 2*d){
            go = min(go, c*(b-d-1)/b - i);
        } else {
            go = min(go, (c*(y+1)-1)/b - i);
        }

        if(go1) go = 1;
        go = max(go, 1LL);
        go = min(go, c-d-i);
        ans += mult(go, mult(l1+1, l2+1));
        ans %= MOD;
        i += go;
    }
    return ans % MOD;
}

LL solve(LL a, LL b, LL c, LL d){
    LL ans = 0;
    for(LL i = 1; i < c-d; i++){
        LL x = a*i/c;
        LL y = b*i/c;
        LL l1 = min(a-1, x+d) - max(0LL, x-d);
        LL l2 = min(b-1, y+d) - max(0LL, y-d);
        ans += mult(l1+1, l2+1);
        ans %= MOD;
    }
    return ans;
}

int main(){
    LL a, b, c;
    LL d;
    cin >> a >> b >> c >> d;
    LL ans = mult(min(a,d+1), mult(min(b,d+1), min(c,d+1)));
    ans += solve2(a,b,c,d);
    ans += solve2(b,c,a,d);
    ans += solve2(c,a,b,d);
    ans %= MOD;
    while(ans < 0) ans += MOD;
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args){
        
        Scanner sc = new Scanner(System.in);
        
        // input K
        int K = sc.nextInt();
        int odd = 0;
        int even = 0;
        
        if(K%2 == 1){
            odd = K/2 + 1;
            even = K/2;
        }
        else{
            odd = K/2;
            even = K/2;
        }
        System.out.println(odd * even);
    }
}


Measured memory_bytes: 21972
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    
    int ans = inf;
    rep(i, N) {
        vector<int> cur;
        vector<int> tmp;
        rep(j, N) {
            if(A[j] >= A[i]) {
//                cout << A[j] << endl;
                tmp.pb(A[j]);
            }
            else {
                if((int)tmp.size() >= K) {
//                    cout << "tmp:";
//                    voutput(tmp);
                    sort(all(tmp));
                    rep(k, (int)tmp.size() - K + 1) {
                        cur.pb(tmp[k]);
                    }
                    
                    
                    
                }
                tmp.clear();
            }
        }
        if((int)tmp.size() >= K) {
//            cout << "tmp:";
//            voutput(tmp);
            sort(all(tmp));
            rep(k, (int)tmp.size() - K + 1) {
                cur.pb(tmp[k]);
            }
            
        }
        
//        voutput(cur);
        if((int)cur.size() >= Q) {
            sort(all(cur));
            ans = min(ans, cur[Q - 1] - A[i]);
        }
        
    }
    output(ans);
    
    
    
    
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	ans := func() string {
		if s[2] == s[3] && s[4] == s[5] {
			return "Yes"
		}
		return "No"
	}()

	fmt.Println(ans)

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> pii;
#define rep(i, start, n) for (int i = (int)(start); i < (int)(n); ++i)
#define all(a) a.begin(), a.end()

const int MOD = 1e9+7;
const int INF = 1001001001;
int dist[1000][1000];
char maze[1000][1000];

int main(){
    int H, W;
    cin >> H >> W;
    deque<pii> q;
    rep(i, 0, H){
        rep(j, 0, W){
            char st;
            cin >> st;
            maze[i][j] = st;
            if (st == '#'){
                q.emplace_back(i, j);
                dist[i][j] = 0;
            }
            else{
                dist[i][j] = INF;
            }
        }
    }
    vector<int> dx = {1, -1, 0, 0};
    vector<int> dy = {0, 0, 1, -1};
    int ans = 0;
    while (!q.empty()){
        pii xy = q.front();
        int x = xy.first;
        int y = xy.second;
        q.pop_front();
        rep(i, 0, 4){
            int nx = x + dx[i];
            int ny = y + dy[i];
            if (0 <= nx && nx < H && 0 <= ny && ny < W && maze[nx][ny] == '.' && dist[nx][ny] == INF){
                dist[nx][ny] = dist[x][y] + 1;
                q.emplace_back(nx, ny);
                ans = max(ans, dist[nx][ny]);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 16336
'''
from sys import stdin, setrecursionlimit as srl
from threading import stack_size, Thread
srl(int(1e9)+7)
stack_size(int(1e8))

def solve():
    t = int ( input () )
    for _ in range ( t ) :
        


Thread(target=solve).start()
solve()
'''

a = input()
b = input()
dp = [[0 for j in range(len(b)+1)] for i in range(len(a)+1)]
for i in range(1, len(a)+1):
    for j in range(1, len(b)+1):
        if a[i-1] == b[j-1] :
            dp[i][j] = dp[i-1][j-1] + 1
            continue
        dp[i][j] = max(dp[i-1][j], dp[i][j-1])
m = dp[-1][-1]
ans = ''
i,j=-1,-1
while(len(ans)<m):
    if a[i] == b[j]:
        ans = a[i] + ans
        i-=1
        j-=1
    elif dp[i-1][j] > dp[i][j-1]:
        i-=1
    else:
        j-=1
print(ans)

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

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

    int n;
    cin >> n;
    string s;
    cin >> s;
    int prev = s[0];
    int ans = 1;
    for (int i = 1; i < n; i++) {
        if (prev == s[i]) continue;
        ans++;
        prev = s[i];
    }
    cout << ans << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
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(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n, T;
    cin >> n >> T;
    vll t(n);
    rep(i, n){
        cin >> t[i];
    }
    ll ans = 0;
    ll y = 0;
    rep(i, n){
        if(t[i] < y){
            ans += T+t[i]-y;
        }else{
            ans += T;
        }
        y = t[i] + T;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let k: usize = read();

    let mut a: Vec<usize> = (0..n).map(|_| read()).collect();
    for _i in 0..min(k, 2000) {
        let mut imos: Vec<i64> = vec![0; n];
        for i in 0..n {
            let left = max(0, i as i64 - a[i] as i64);
            let right = i + a[i] + 1;
            imos[left as usize] += 1;
            if right < n {
                imos[right as usize] -= 1;
            }
            //println!("{:?}",imos);
        }
        a[0] = imos[0] as usize;
        for j in 1..n {
            imos[j] += imos[j - 1];
            a[j] = imos[j] as usize;
        }
        //println!("{:?}",imos);
    }
    let f = n - 1;
    for i in 0..n {
        if i == f{
            println!("{}",a[i]);
        }else{
            print!("{} ",a[i]);
        }
    }
}

Measured memory_bytes: 5164
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;

constexpr long long MOD = (long long)1e9 + 7;
constexpr long long MOD2 = 998244353;
constexpr long long HIGHINF = (long long)1e18;
constexpr long long LOWINF = (long long)1e15;
constexpr long double PI = 3.1415926535897932384626433L;

template <class T> vector<T> multivector(size_t N,T init){return vector<T>(N,init);}
template <class... T> auto multivector(size_t N,T... t){return vector<decltype(multivector(t...))>(N,multivector(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max(a,b);}
template <class T> void chmin(T& a, const T b){a=min(a,b);}
void YN(bool flg) {cout << (flg ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << (flg ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << (flg ? "yes" : "no") << endl;}

int main() {
    int N; cin >> N;
    N %= 10;
    if(N==3) cout << "bon" << endl;
    else if (N==0 || N==1 || N==6 || N==8) cout << "pon" << endl;
    else cout << "hon" << endl;
    return 0;
}


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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    p=LI()
    p.sort()
    ans=sum(p[:K])
    print(ans)

main()


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

const ll mod = 1000000007;


int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> p(n);
	rep(i,n) cin >> p.at(i);
	int min = 100100100, ans = 0;
	rep(i, n){
		if(min >= p.at(i)){
			ans++;
			min = p.at(i);
		}
	}
	cout << ans << endl;
} 

Measured memory_bytes: 1024
from collections import deque
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, M = map(int, input().split())
e_from = [[] for _ in range(N+1)]
e_to = [[] for _ in range(N+1)]
for _ in range(N + M - 1):
    a, b = map(int, input().split())
    e_from[a].append(b)
    e_to[b].append(a)


add = np.zeros(N+1, dtype=int)
rank = [-1]*(N+1)

# まず根を探す
for i in range(1, N+1):
    add[i] = len(e_to[i])
    if len(e_to[i]) == 0:
        root = i

# BFS
rank[root] = 0
node = deque([root])
while node:
    s = node.popleft()
    add[e_from[s]] -= 1
    for t in e_from[s]:
        if add[t] == 0:
            rank[t] = s
            node.append(t)

print(*rank[1:], sep="\n")


Measured memory_bytes: 45904
/*
author: Apoorv Singh
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds;

typedef vector <int> vi;
typedef vector <long long> vl;
typedef pair <int, int> pii;
typedef pair <long long, long long> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define ll long long
#define pb push_back   
#define all(c) c.begin(), c.end()
#define watch(x) cout << (#x) << " " << (x) << endl;
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = a; i > b; --i)
#define um unordered_map
#define F first
#define S second

ll modulo = 1e9 + 7;

template <class X>

void printarr(X arr[], int n)
{
    for (int i = 0; i < n; ++i)
        cout << arr[i] << " ";
    cout << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,m,x,y;
    cin >> n >> m >> x >> y;
    int a[n], b[m];
    FOR(i,0,n)
        cin >> a[i];
    FOR(i,0,m)
        cin >> b[i];
    sort(a,a+n);
    sort(b,b+m);
    FOR(i, x+1, y+1)
    {
        if (i > a[n-1] and i <= b[0])
        {
            cout << "No War" << endl;
            return 0;
        }
    }
    cout << "War" << endl;
    return 0;
}

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

#define MAXN 10010

long long int N, W;
long long int dp[MAXN][MAXN], w[MAXN], v[MAXN];
/*
int solve(int i, int weigth){
	if (i == N+1) return 0;
	
	if (dp[i][weigth] != -1) 
		return dp[i][weigth];
	
	int ans = solve(i+1, weigth);
	if (weigth - w[i] >= 0) return max(ans, solve(i+1, weigth - w[i]) + v[i]);
	return dp[i][weigth] = ans; 
}
*/
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	cin >> N >> W;	
	for (int i = 1; i <= N; i++)
		cin >> w[i] >> v[i];

	for (int i = 1; i <= N; i++) {
		for (int j = W; j >= 0; j--) {
			long long int ans = dp[i-1][j]; 
			if (j-w[i] >= 0)
				ans = max(ans, dp[i-1][j-w[i]] + v[i]);
			dp[i][j] = ans;
		}
	}

	cout << dp[N][W] << endl;
	
	return 0;
}


Measured memory_bytes: 10240
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9+7;
int cnt(0);
int N;

int main(){
  int N,M;
  cin>>N>>M;
  vector <tuple<int,int,int>>p(M);
  for (int i(0);i<M;i++) {
    cin>>get<0>(p[i])>>get<1>(p[i]);
    get<2>(p[i])=i;
  }
  vector <pair<int,int>> s(M); 
  sort(p.begin(),p.end());
  int cnt(1);
  for (int i(0);i<M;i++){
    if (i!=0&&get<0>(p[i])!=get<0>(p[i-1])) cnt=1;
    s[get<2>(p[i])]={get<0>(p[i]),cnt};
    cnt++;
  }
  for (int i(0);i<M;i++){
    cout << setfill('0') << right << setw(6) << s[i].first <<setfill('0') << right << setw(6)<< s[i].second << endl;
  }
}


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

int main() {
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  int flag = 1;
  while(flag){
    rep(i,2){
      if(i==0){
        C -= B;
        if(C <= 0){
          cout << "Yes" << endl;
          flag = 0;
          break;
        }
      }
      else if(flag==1){
        A -= D;
        if(A <= 0){
          cout << "No" << endl;
          flag = 0;
          break;
        }
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3592
k=int(input())
a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
flag=False
for i in range(a,b+1):
    if i%k==0:
        flag=True
        break
if flag:
    print("OK")
else:
    print("NG")
    





Measured memory_bytes: 9168
import collections
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]
s = dict(collections.Counter(s).most_common())
t = dict(collections.Counter(t).most_common())
m_cnt = 0
for k, v in s.items():
    if k in t:
        if v > t[k]:
            if m_cnt < v - t[k]:
                m_cnt = v - t[k]
    else:
        if m_cnt < v:
            m_cnt = v
print(m_cnt)


Measured memory_bytes: 3316
#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<stack>
#include<array>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<numeric>
#include<random>
#include<functional>
#define int int64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
using namespace std;




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

	int N, L;
	cin >> N >> L;
	vector<int>a(N);
	rep(i, N)cin >> a[i];

	if (N == 2) {
		if (L <= a[0] + a[1]) {
			cout << "Possible" << endl << "1" << endl;
		}
		else {
			cout << "Impossible" << endl;
		}
		return 0;
	}

	rep(i, N - 1)if (L <= a[i] + a[i + 1]) {
		vector<int>answer;
		for (int j = 1; j <= i; j++)answer.push_back(j);
		for (int j = N - 1; i < j; j--)answer.push_back(j);
		cout << "Possible" << endl;
		rep(j, answer.size())cout << answer[j] << endl;
		return 0;
	}
	cout << "Impossible" << endl;
}

Measured memory_bytes: 2548
import java.util.*;
import java.io.*;
public class Main {
	public static void main(String args[]) {
		FastScanner in = new FastScanner();
		int d=in.nextInt();
		int t=in.nextInt();
		int s=in.nextInt();
		
		double t1=1.0*d/s;
		if(t1<=t){
			System.out.println("Yes");
		}
		else 
			System.out.println("No");
	}

	///////////////////////////
	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

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

		int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 32656
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
bool a[26];
int main(){
	string s;
	cin>>s;
	int n=s.size();
	r(i,n)a[s[i]-'a']++;
	if(n<26){
		r(i,26)if(!a[i]){
			s+=(i+'a');
			break;
		}
		cout<<s<<endl;
	}
	else if(s=="zyxwvutsrqponmlkjihgfedcba")cout<<-1<<endl;
	else{
		string t=s,ans;
		next_permutation(s.begin(),s.end());
		r(i,n){
			ans+=s[i];
			if(t[i]!=s[i])break;
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>

int main()
{
	double r,pi,a,b;
	scanf("%lf",&r);
	pi=M_PI;
	a=r*r*pi;
	b=2*r*pi;
	
	printf("%lf %lf",a,b);

	return 0;
}

Measured memory_bytes: 1076
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for(int i = -118; i <= 119; i++){
            for(int j = -118; j <= 119; j++){
                if((int)(Math.pow(i,5) - Math.pow(j,5)) == n){
                    System.out.println(i + " " + j);
                    return;
                }
            }
        }
    }
}



Measured memory_bytes: 38816
#include<iostream>

using namespace std;

int main() {
  int h, w, minH, minW;
  cin>>h>>w;
  while(h>0 && w>0) {
    int diag = h*h+w*w;
    int calDiag = 151*151+151*151;

    for(int i=1; i<=150; i++) {
      for(int j=i+1; j<=150; j++) {

	if(diag == i*i+j*j) { // 下限
	  if(diag == calDiag && h<i && i<minH) {
	    minH = i;
	    minW = j;
	  } 
	  else if(i*i+j*j<calDiag && h!=i && w!=j && h<i) { 
	    calDiag = diag;
	    minH = i;
	    minW = j;
	  }
	}
	else if(diag < i*i+j*j && (i*i+j*j<calDiag || (i*i+j*j==calDiag && i<minH))) { // 挟まれた場合 問題無し
	  calDiag = i*i+j*j;
	  minH = i;
	  minW = j;
	}

      }
    }
    cout<<minH<<" "<<minW<<endl;
    cin>>h>>w;
  }
  //return 0;
}

Measured memory_bytes: 1160
N, M = map(int, input().split())

par = list(range(0, N + 1))
size = [1] * (N + 1)
rank = [1] * (N + 1)

def root(i):
  if par[i] == i:
    return i
  else:
    par[i] = root(par[i])
    return par[i]
  
def same(i, j):
  return root(i) == root(j)
  
def findsize(i):
  size[i] = size[root(i)]
  
def unite(i, j):
  i = root(i)
  j = root(j)
  if i != j:
    if rank[i] > rank[j]:
      par[j] = i
      size[i] += size[j]
    else:
      par[i] = j
      size[j] += size[i]
      if rank[i] == rank[j]:
        rank[j] += 1

bridge = [None] * M
for i in range(M):
  x, y = map(int, input().split())
  bridge[i] = [x, y]
  
cnt = N * (N - 1) // 2
inconv = [0] * M
for i in range(M - 1, -1, -1):
  inconv[i] = cnt
  a, b = bridge[i]
  if not same(a, b):
    cnt -= size[root(a)] * size[root(b)]
    unite(a, b)
    
for i in range(M):
  print(inconv[i])

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

using namespace __gnu_pbds;
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#define    boost        ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define    nl           "\n"
#define    ll           long long
#define    pb           push_back
#define    mpr          make_pair
#define    fr(i,a,n)    for(ll i=a;i<n;++i)
#define    fr0(i,n)     for(ll i=0;i<n;++i)
#define    pii          pair<int, int>
#define    FO           find_by_order
#define    OK           order_of_key
#define    mem(a)       memset(a,0,sizeof(a))
#define    ff           first
#define    ss           second


typedef tree <
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update >
set_t;


void fio()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}


template<typename T> void TIME(T start, T end)
{
#ifndef ONLINE_JUDGE
	double time_taken =  chrono::duration_cast<chrono::nanoseconds>(end - start).count();
	time_taken *= 1e-9;
	cout << "\nExecuted in: " << fixed
	     << time_taken << setprecision(9);
	cout << " sec";
#endif
}

///----------------------------- | FUNCTIONS | --------------------------------------///

/*
const int N = 2e5 + 5;

vector<int> adj[N];
bool visited[N];
//int val[N];
int depth[N];
//int parent[N];

void dfs(int v)
{
	visited[v] = true;
	for (int u : adj[v])
	{
		if (!visited[u])
		{
			//parent[u] = v;
			depth[u] = depth[v] + 1;
			dfs(u);
		}
	}
}
*/

// left shift << multiply by 2
// right shift >> divide by 2

///----------------------------- | START FROM HERE | --------------------------------------///

//#define int long long //change int main to int32_t main


void solve()
{
	int n; cin >> n;
	int h[n + 5];
	fr0(i, n) cin >> h[i + 1];
	int dp[n + 5];
	dp[1] = 0;
	dp[2] = abs(h[2] - h[1]);
	dp[3] = abs(h[3] - h[1]);
	fr(i, 4, n + 1)
	{
		dp[i] = min(dp[i - 2] + abs(h[i] - h[i - 2]), dp[i - 1] + abs(h[i] - h[i - 1]));
	}
	cout << dp[n] << nl;


}





int main()
{
	auto start = chrono::high_resolution_clock::now();
	boost;
	fio();
	int t;
	t = 1;
	//cin >> t;
	while (t--) solve();
	auto end = chrono::high_resolution_clock::now();
	TIME(start, end);
	return 0;
}




Measured memory_bytes: 4444
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto S = readln.to!(dchar[]);
    auto T = readln.to!(dchar[]);

    dchar[dchar] smemo, tmemo;
    foreach (i, s; S) {
        auto t = T[i];
        if (s in smemo && t in tmemo) {
            if (smemo[s] != t || tmemo[t] != s) {
                writeln("No");
                return;
            }
        } else if (s in smemo || t in tmemo) {
            writeln("No");
            return;
        } else {
            smemo[s] = t;
            tmemo[t] = s;
        }
    }
    writeln("Yes");
}

Measured memory_bytes: 4152
use std::cmp::{max, min};

fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_owned()
}

fn reads<T>() -> Vec<T>
where
    T: std::str::FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    read_line()
        .split_whitespace()
        .map(|w| w.parse().unwrap())
        .collect()
}

fn main() {
    let (n, m): (i64, i64) = {
        let t = reads();
        (t[0], t[1])
    };

    let (n, m) = (min(n, m), max(n, m));

    let ans = if n == 1 && m == 1 {
        1
    } else if n == 1 {
        m - 2
    } else {
        (m - 2) * (n - 2)
    };

    println!("{}", ans);
}


Measured memory_bytes: 4352