akhauriyash/Code-Regression huggingface dataset:
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String args[]) {
		FastScanner scanner = new FastScanner();
		int n=scanner.nextInt();
		int m=scanner.nextInt();
		long x = n+m;
		if(x%2==0){
			System.out.println(x/2);
		}else{
			System.out.println("IMPOSSIBLE");
		}
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 22612
/**
*	created: 29.08.2020 21:24:24
**/
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
using ll = long long;
using P = pair<int,int>;
// #define endl '\n'
#define int long long
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define rep2(i,s,n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
const long double pi = acos(-1.0);
const int MAX = 1000010;
const int INF = 1ll << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;
template<typename T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<typename T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
template<typename T> T pow(T a, ll n) {T r(1); while(n) {if (n & 1) r *= a; a *= a; n >>= 1;} return r;}
struct faster_io {faster_io() {cin.tie(0); ios_base::sync_with_stdio(false);}} faster_io_;


map<int,int> mp;

void prime(int g) {

    if (g % 2 == 0){
        int t = 0;
        while (g % 2 == 0){
            if (t == 0) mp[2]++;
            g /= 2;
            t++;
        }
    }
    for (int i = 3; i*i <= g; i += 2){
        int t = 0;
        while (g % i == 0){
            if (t == 0) mp[i]++;
            g /= i;
            t++;
        }
    }
    if (g != 1) mp[g]++;
    return;
}

signed main() {
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    int g = v[0];
    rep(i,n) g = __gcd(g,v[i]);
    bool st = false, pa = true;
    if (g == 1) st = true;
    rep(i,n) prime(v[i]);
    for (auto p : mp) if (p.second > 1) pa = false;
    if (pa) cout << "pairwise coprime" << endl;
    else if (st) cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
    return 0;
}

Measured memory_bytes: 15696
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
typedef long long ll;

void solve() {
    int K;
    cin >> K;
    string s;
    cin >> s;
    REP(i,min(K,(int)s.size())) {
        cout << s[i];
    }
    if (s.size() > K ) {
        cout << "...";
    }
    cout << endl;
}

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


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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

int n;
int p[MAX_N];

int idx[MAX_N];

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 0; i < n; ++i) {
    scanf("%d", &(p[i]));
    p[i] -= 1;
    idx[p[i]] = i;
  }

  set<int> st;

  ll ans = 0LL;

  for (int x = n - 1; x >= 0; --x) {
    int i = idx[x];

    ll c = 0LL;

    {  // calc c
      st.insert(i);
      vector<int> l(2, -1);
      vector<int> r(2, n);

      {  // calc l
        auto itr = st.find(i);
        for (int j = 0; j < 2; ++j) {
          if (itr == st.begin()) break;
          --itr;
          l[j] = *itr;
        }
      }

      {  // calc r
        auto itr = st.find(i);
        for (int j = 0; j < 2; ++j) {
          ++itr;
          if (itr == st.end()) break;
          r[j] = *itr;
        }
      }

      vector<int> ls(2);
      ls[0] = i - l[0];
      ls[1] = l[0] - l[1];

      vector<int> rs(2);
      rs[0] = r[0] - i;
      rs[1] = r[1] - r[0];

      c = (ll)(ls[0] * rs[1]) + (ll)(ls[1] * rs[0]);
    }

    ans += c * (x + 1);
  }

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 5760
program abc064c
  logical :: color(0:7) = .false.
  integer :: n, c
  integer,dimension(:),allocatable :: a
  read *, n
  allocate(a(n))
  read *, a
  color(pack(a,a<3200)/400) = .true.
  c = count(color)
  print *, merge(c,1,c/=0), count(a>=3200)+c
end program abc064c


Measured memory_bytes: 512
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int

signed main(){
    
    int a[1010] = {};
    for(int i = 0; i < 12; i++){
        int in; cin >> in;
        a[in]++;
    }

    int cnt = 0;
    for(int i = 0; i < 1000; i++){
        cnt += a[i] / 4;
    }

    if(cnt == 3) cout << "yes" << endl;
    else cout << "no" << endl;
    return 0;
}



Measured memory_bytes: 3096
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <cstdlib>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n, k; cin >> n >> k;
	vector<bool> v(n);
	rep(i, k)
	{
		int d; cin >> d;
		rep(j, d)
		{
			int a; cin >> a;
			--a;
			v[a] = true;
		}
	}
	int res = 0;
	rep(i, n)if (!v[i])++res;
	cout << res << endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int n, m, q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int> A){
    if (A.size() == n + 1) {
        int ans_now = 0;
        for (int i = 0; i < q; ++i) {
            if (A[b[i]] - A[a[i]] == c[i]) ans_now += d[i];
        }
        ans = max(ans, ans_now);
        return;
    }
    
    A.push_back(A.back());
    while (A.back() <= m){
        dfs(A);
        A.back()++;
    }
}

int main() {
    cin >> n >> m >> q;
    a = b = c = d = vector<int>(q);
    for (int i = 0; i < q; i++){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
    }

    ans = 0;
    dfs(vector<int>(1,1));
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 3636
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
ans_list = ["X"] * N
if M == 0:
    if N == 1:
        print(0)
    else:
        print(int("1" + ("0" * (N - 1))))
elif N == 1:
    for i in range(M):
        s, c = map(int, input().split())
        if ans_list[s - 1] == "X" or ans_list[s - 1] == c:
            ans_list[s - 1] = c
        else:
            print(-1)
            break
    else:
        ans_list = ["0" if i == "X" else str(i) for i in ans_list]
        print(int("".join(ans_list)))
else:
    for i in range(M):
        s, c = map(int, input().split())
        if s == 1 and c == 0:
            print(-1)
            break
        elif ans_list[s - 1] == "X" or ans_list[s - 1] == c:
            ans_list[s - 1] = c
        else:
            print(-1)
            break
    else:
        ans_list = ["0" if i == "X" else str(i) for i in ans_list]
        if ans_list[0] == "0":
            ans_list[0] = "1"
        print(int("".join(ans_list)))


Measured memory_bytes: 3064
($H,$W)=glob<>;
@a=map[/./sg],<>;
$o=Yes;
for my$h(0..$H-1){
    for my$w(0..$W-1){
        next if($a[$h][$w]eq'.');
        if( ($h==0    or $a[$h-1][$w]eq'.') and
            ($h==$H-1 or $a[$h+1][$w]eq'.') and
            ($w==0    or $a[$h][$w-1]eq'.') and
            ($w==$W-1 or $a[$h][$w+1]eq'.') 
        ){
            $o=No;
            last;
        }
    }
}
print $o;

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
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; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
	ll n;cin >> n;
    int ans=15;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            ll u=i,v=n/i;
            int p=0,q=0;
            while(u){
                u/=10;
                p++;
            }
            while(v){
                v/=10;
                q++;
            }
            chmin(ans,max(p,q));
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3508
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 N, K;
  std::string S;
  std::cin >> N >> K >> S;

  std::vector<i64> combos;
  for (auto it = S.begin(), prev_it = S.end(); it != S.end(); prev_it = it, ++it) {
    if (prev_it == S.end() || *prev_it != *it) {
      combos.push_back(0);
    }
    ++combos.back();
  }

  const i64 base_score = std::accumulate(combos.begin(), combos.end(), static_cast<i64>(0)) - static_cast<i64>(combos.size());
  const i64 possible_two = (static_cast<i64>(combos.size()) - 1) / 2;
  const i64 possible_one = (static_cast<i64>(combos.size()) - 1) % 2;
  const i64 additional_score = K <= possible_two ? K * 2 : possible_two * 2 + possible_one;

  std::cout << base_score + additional_score << std::endl;
  return 0;
}

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}

signed main()
{   
    gearup;
    ll n;cin >> n;
    ll x = n;
    ll res = 0;
    while(x > 0){
        res += x % 10;
        x /= 10;
    }
    cout << (n%res == 0?"Yes":"No") << endl;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// input scanner
var sc = bufio.NewScanner(os.Stdin)

const (
	initialBufSize = 10e4
	maxBufSize     = 10e6
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

// util
func max(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n > ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func min(l []int) (int, int) {
	idx := 0
	ans := l[idx]
	for i, n := range l {
		if n < ans {
			idx = i
			ans = n
		}
	}
	return idx, ans
}

func check(c [][]bool) bool {
	if c[0][0] && c[0][1] && c[0][2] {
		return true
	}
	if c[1][0] && c[1][1] && c[1][2] {
		return true
	}
	if c[2][0] && c[2][1] && c[2][2] {
		return true
	}
	if c[0][0] && c[1][1] && c[2][2] {
		return true
	}
	if c[0][2] && c[1][1] && c[2][0] {
		return true
	}
	if c[0][0] && c[1][0] && c[2][0] {
		return true
	}
	if c[0][1] && c[1][1] && c[2][1] {
		return true
	}
	if c[0][2] && c[1][2] && c[2][2] {
		return true
	}
	return false
}

// main
func main() {
	buf := make([]byte, initialBufSize)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords)
	var ans bool
	a := make([][]int, 3)
	c := make([][]bool, 3)
	for i := 0; i < 3; i++ {
		a[i] = nextInts(3)
		c[i] = make([]bool, 3)
	}
	n := nextInt()
	for k := 0; k < n; k++ {
		b := nextInt()
		for i := 0; i < 3; i++ {
			for j := 0; j < 3; j++ {
				if a[i][j] == b {
					c[i][j] = true
				}
			}
		}
		if check(c) {
			ans = true
		}
	}
	if ans {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 640
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {

    char c;
    scanf("%c", &c);

    if(c=='a' || c=='i'||c=='u'||c=='e'||c=='o'){
        puts("vowel");
    }else{
        puts("consonant");
    }
    
    
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i, s, n) for (int i = (s); i < (n); i++)
#define RFOR(i, s, n) for (int i = (n) - 1; i >= (s); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
const long long MOD = 1e9 + 7, INF = 1e18;
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a=b;return true;}return false;}



signed main(){
	string s,t;
	cin>>s>>t;
	int ans = 0;
	REP(i,3)if(s[i]==t[i])ans++;
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<ctime>
#include<vector>
using namespace std;

int main(){

   string s;
   cin>>s;

   string forecast[]={"Sunny","Cloudy","Rainy","Sunny"};
for(int i=0;i<4;i++){
    if(s==forecast[i]){
        cout<<forecast[i+1]<<endl;
        break;
    }
}


    

return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <algorithm>
int main() {
  int A,B;
  cin>>A>>B;
  if(B%A==0){
  cout<<A+B<<endl;
  }else{
  cout<<B-A<<endl;
  }
}

Measured memory_bytes: 256
n = int(input())
li = []
for i in range(0,n):
    li.append(input())
di = dict()
for j in range(0,len(li)):
    if li[j] in di.keys():
        di[li[j]]+=1
    else:
        di[li[j]] = 1
li.clear()
di = {k: v for k, v in sorted(di.items(), key=lambda item: item[1])}
total = max(di.values())
for k,v in di.items():
    if v == total:
        li.append(k)
li.sort()
for l in li:
    print(l)


Measured memory_bytes: 66160
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

n = int(input())
a = int(input())
print(n*n-a)


Measured memory_bytes: 3832
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <math.h>
#include <array>
using namespace std;
typedef long long ll;

int main(int argc,char const* argv[])
{
  int x,t=0;
  cin >> x;
  while((t*(t+1)/2)<x)
    {
      t++;
    }
  cout << t << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
#define dbg          cout<<"Freak"<<endl;
#define dbgg(i)      cout<<i<<endl;
#define N            1e9+7
#define pb           push_back
#define pi           acos(-1)
using namespace std;
ll arr[100005];
ll t;
vector<string>v,v1;
map<string,ll>mp;
map<string,string>np;
int main()
{
    ll a,b,c,d,e,f=0,i,j;
    cin>>a;
    string s;
    for(i=0;i<a;i++)
    {
        cin>>s;
        mp[s]++;
        if(mp[s]==1)v.pb(s);
    }
    for(i=0;i<v.size();i++)
    {
        f=max(f,mp[v[i]]);
    }
    for(i=0;i<v.size();i++)
    {
        if(mp[v[i]]!=f)mp[v[i]]=0;
        else v1.pb(v[i]);
    }
    sort(v1.begin(),v1.end());
    for(i=0;i<v1.size();i++)cout<<v1[i]<<endl;

}




Measured memory_bytes: 28784
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cstring>
#include<climits>
#include<cmath>
#include<map>

#define f first
#define s second
#define mp make_pair

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

typedef unsigned int uint;
typedef long long ll;

using namespace std;

int main(){
  string str;
  while(cin>>str){
    char buff[3][3];
    REP(i,3) REP(j,3)
      buff[i][j] = str[i*3+j];

    REP(i,3){
      if(buff[i][0] == buff[i][1] &&
         buff[i][1] == buff[i][2] &&
         buff[i][0] != 's'){
        cout << buff[i][0] << endl;
        goto end;
      }
      if(buff[0][i] == buff[1][i] &&
         buff[1][i] == buff[2][i] &&
         buff[0][i] != 's'){
        cout << buff[0][i] << endl;
        goto end;
      }
    }
    if(buff[0][0] == buff[1][1] &&
       buff[1][1] == buff[2][2] &&
       buff[0][0] != 's'){
      cout << buff[0][0] << endl;
      goto end;
    }
    if(buff[2][0] == buff[1][1] &&
       buff[1][1] == buff[0][2] &&
       buff[2][0] != 's'){
      cout << buff[2][0] << endl;
      goto end;
    }
    cout << 'd' << endl;
  end:;
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // 整数スキャン（複数）
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s;
    cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s;
        cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    int n;
    scanf("%d",&n);
    ll a[n+1] = {};
    srep(i,1,n+1){
        scanf("%lld",&a[i]);
    }


    ll ans = 0;
    int before = 0;
    srep(i,1,n+1){
        if(a[i]==i){
            if(before==0){
                if(i==n){
                    ans++;
                }else{
                    before=1;
                }
            }else{
                ans++;
                before=0;
            }
        }else{
            if(before==1){
                ans++;
                before=0;
            }
        }
    }
    
    cout << ans << endl;
    return 0;
}
 
 


Measured memory_bytes: 1024
#include <stack>
using namespace std;

struct Rectangle {
  int height;
  int pos;
};
 

#include <stdio.h>
#define SIZ 1400
int m[SIZ+1][SIZ+1];
int st[SIZ];
char z[9999999];
int get(){
	static int input_count=0;
	int r=0;
	for(;'0'<=z[input_count]&&z[input_count]<='9';)r=r*10+z[input_count++]-'0';
	input_count++;
	return r;
}
int main(){
	fread(z,1,sizeof(z),stdin);
	int i,j,k,y=get(),x=get(),r,ptr;
	for(j=0;j<y;j++)for(r=i=0;i<x;m[j][i]=r,i++){
		int t=get();
		r=t==0?r+1:0;
	}
	r=0;
/*
	for(i=0;i<x;i++)for(ptr=j=0;j<=y;j++){
		//printf("%d %d %d %d\n",i,j,ptr,m[j][i]);
		if(!ptr || st[ptr-1]<m[j][i])st[ptr++]=m[j][i];
		else{
			for(;ptr && st[ptr-1]>m[j][i];){
				int _y=(j-(ptr-1)),_x=st[--ptr];
				//printf("%d %d\n",_x,_y);
				if(r<_x*_y)r=_x*_y;
			}
			st[ptr++]=m[j][i];
		}
	}
*/
	Rectangle rect;
	for(int i=0;i<x;i++){
		stack<Rectangle> stk;
		for(int j=0;j<=y;j++){
			rect.height = m[j][i];
			rect.pos = j;
			if(stk.empty() || stk.top().height < rect.height){
				stk.push(rect);
			}else if(stk.top().height>rect.height){
				int target = j;
				for(;!stk.empty() && stk.top().height >= rect.height;){
					Rectangle pre = stk.top(); stk.pop();
					int area = pre.height * (j - pre.pos);
					r = max(r, area);
					target = pre.pos;
				}
				rect.pos = target;
				stk.push(rect);
			}
		}
	}

	printf("%d\n",r);
	return 0;
}

Measured memory_bytes: 14312
#include<stdio.h>
int main(void)
{
	int a,s,d,f,i;
	scanf("%d",&a);
	while(a!=0){
		for(i=1;i<=a;i++){
			scanf("%d %d %d",&s,&d,&f);
			if(s==100 || d==100 || f==100){
				printf("A\n");
			}
			else if((s+d+f)/3>=80){
				printf("A\n");
			}
			else if((s+d)/2>=90){
				printf("A\n");
			}
			else if((s+d+f)/3>=70){
				printf("B\n");
			}
			else if((s+d+f)/3>=50 && s>=80 || d>=80){
				printf("B\n");
			}
			else{
				printf("C\n");
			}
		}
	scanf("%d",&a);
	}
	return 0;
}

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

#define ll long long
#define pb push_back
#define vi vector<int>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define sizeOf(A) (sizeof(A))/(sizeof(A[0]))
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
const ll MOD = 1e9 + 7;

int main() {
    fastio;

    ll x, a, b;
    cin >> x >> a >> b;
    if (abs(x-a) > abs(x-b)) {
        cout << "B\n";
    } else {
        cout << "A\n";
    }
    return 0;
}


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

int main(){
    int a,b,k,l=0;cin>>a>>b>>k;vector<int> ans(100);
    for(int i=min(a,b);i>=1;i--){
        if(a%i==0&&b%i==0){
            ans.at(l)=i;
            l++;
        }
    }
    cout<<ans.at(k-1)<<endl;
}

Measured memory_bytes: 256
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
 
ll power(ll x, ll y); 
#define repp(I, A, B) for(int I = A; I <= B; I++)
#define rep(I, A, B) for(int I = A; I < B; I++)
#define rrep(I, B, A) for(int I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define mem(A, B) memset(A, B, sizeof(A));
#define mem0(A) memset(A, 0, sizeof(A));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define bitcount(n) __builtin_popcountll(n)
#define in_edges(M) repp(I, 1, M){ll A, B; cin >> A >> B; v[A].pb(B), v[B].pb(A);}
#define in_edges2(M) repp(I, 1, M){ll A, B; cin >> A >> B; v[A].pb(B);}
#define endl "\n"

const ll MOD = 1000000007;
 
int main() //PointBlank's code ¯\_(ツ)_/¯
{
    quickio
    int n;
    cin >> n;
    int arr[n + 5];
    repp(i, 1, n) cin >> arr[i];

    int x = 0;
    repp(i, 1, n/2) x ^= (arr[i*2] ^ arr[i*2 - 1]);

    repp(i, 1, n) cout << (x^arr[i]) << " ";
}

ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Measured memory_bytes: 4348
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	//n := r.nextInt()
	r.Scan(true)
	s,t:=r.nextString(),r.nextString()
	var ans string
	for i:=range s{
		ans += string([]byte{s[i] ,t[i]})
	}
	fmt.Fprintln(stdout, ans)
}


Measured memory_bytes: 640
#include <iostream>

using namespace std;

int main()
{
    int x{};
    int y{};
    int z{};
    cin >> z >> y >> x;
    if (y==z)
        cout << x;
    else if (x==z)
        cout << y;
    else
        cout << z;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
typedef long long ll;
using namespace std;

const ll MAXN = 200000;

ll X, Y, ans;

const int MAX = 2000000;
const int MOD = 1000000007;

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

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


signed main(){
    cin >> X >> Y;
    COMinit();
    if((2*Y-X)%3==0&&(2*X-Y)%3==0) {
        ans = COM((2*Y-X)/3+(2*X-Y)/3, (2*X-Y)/3);
    }
    else ans = 0;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 47232
def rate(m, f, r)
  return 'F' if m == -1 || f == -1
  return 'A' if 80 <= m + f
  return 'B' if (65...80).include?(m + f)
  return 'C' if (50...65).include?(m + f)
  if (30...50).include?(m + f)
    if r >= 50
      return 'C'
    else
      return 'D'
    end
  end
  return 'F'
end
readlines.each do |line|
  m, f, r = line.split.map(&:to_i)
  break if [m, f, r].all? {|i| i == -1 }
  puts rate(m, f, r)
end

Measured memory_bytes: 6104
import java.util.Arrays;
import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String cnt = s.nextLine();
		int c = Integer.parseInt(cnt);
		int[] input = new int[c];
		for(int i=0 ; i< c ; i++) {
			input[i] = Integer.parseInt(s.nextLine());
		}
		System.out.println(lis(input));
	}

	public static int lis(int[] input) {
		int output = 1;
		int[] calArray = new int[100001];
		Arrays.fill(calArray, (int) (10e9 + 1));
		calArray[0] = -1;
		for(int i=0 ; i<input.length ; i++) {
			int index = Arrays.binarySearch(calArray, input[i]);
			index = index >0 ? index : ~index;
			if(calArray[index] == (int)(10e9 + 1)) {
				calArray[output] = input[i];
				output++;
			}else if(calArray[index] != (10e9 + 1)) {
				calArray[index] = input[i];
			}
//			else {
//				calArray[~index] = input[i];
//			}
		}
		return output -1;
	}
}

Measured memory_bytes: 113780
n = int(input())
no_tax=n//1.08

#print(no_tax)
#print(n/1.08)
#print(int(927*1.08))

if int(no_tax*1.08)==n:
  print(int(no_tax))
elif int((no_tax+1)*1.08)==n:
  print(int(no_tax+1))
else:
  print(":(")

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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

int main() {
    vector<int>a(3);
    rep(i,3){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    cout<<a[0]+a[1]<<endl;
}



Measured memory_bytes: 256
// +build ignore
package main

import (
	"fmt"
)

func main() {
  var A, B int
  fmt.Scan(fmt.Scan(&A,&B))
	num, nana := 0, 1
	for ;; {
		if B == 1 {
			break
		}
		tmpnana := nana - 1 + A
		if tmpnana >= B {
			num++
			break
		} else {
			nana += A - 1
			num++
		}
	} 
  fmt.Println(num)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int INF=1e9;

vector<int> e[300000];
int d[300000];

void bfs(int s){
    fill(d,d+300000,-3);
    d[s]=0;
    queue<int> q;
    q.push(s);
    while(q.size()){
        int v=q.front();
        q.pop();
        for(int n:e[v]){
            if(d[n]==-3){
                q.push(n);
                d[n]=d[v]+1;
            }
        }
    }
}

int main(){
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        --a;--b;
        e[a].push_back(n+b);
        e[n+a].push_back(n+n+b);
        e[n+n+a].push_back(b);
    }
    int s,t;
    cin>>s>>t;
    --s;--t;
    bfs(s);
    cout<<d[t]/3<<endl;
}


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

using namespace std;
#define int long long

signed main(){
    set<int> st;
    int a;
    for(int i=0;i<3;i++){
        cin >> a;
        st.insert(a);
    }
    
    cout << st.size() << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
const ll mod=1e9+7;
const ll inf=0x3f3f3f3f;
const int N=2e5+5;
using namespace std;
int a[N],b[N];
int main()
{
    int n,k;cin>>n>>k;
    for(int i=0;i<n;i++) cin>>a[i];
    while(k--)
    {
        memset(b,0,sizeof b);
        int mx=n;
        for(int i=0;i<n;i++)
        {
            mx=min(mx,a[i]);
            int l=max(0,i-a[i]);
            int r=min(n,i+a[i]+1);
            b[l]++;b[r]--;
        }
        if(mx>=n) k/=2;
        for(int i=0;i<n-1;i++)
        {
            b[i+1]+=b[i];
        }
        for(int i=0;i<n;i++) a[i]=b[i];
    }
    for(int i=0;i<n;i++) cout<<a[i]<<" ";

    return 0;
}


Measured memory_bytes: 5100
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)

ll dp[51][51][2501];

int main(){
  ll n;
  ll a;
  cin >> n >> a;
  ll ans=0;
  vector<int> x(n);
  dp[0][0][0]=1;
  rep(i,n) cin >> x[i];
  for (int i=0;i <= n;i++){
    for (int j=0;j <= n;j++){
      for (int s=0;s < 2501;s++){
        if (i >=1 && s < x[i-1]){
          dp[i][j][s]=dp[i-1][j][s];
        }
        else if (i >= 1 && j>=1 && s >= x[i-1]){
          dp[i][j][s]=dp[i-1][j][s]+dp[i-1][j-1][s-x[i-1]];
        }
        else if (i==0 && j == 0 && s==0){
          dp[i][j][s]=1;
        }
        else dp[i][j][s]=0;
      }
    }
  }
  for (int i=1;i <= n;i++){
    ans+=dp[n][i][i*a];
  }
  //rep(i,n+1){
  //  rep(j,n+1){
  //    rep(k,34){
  //      cout << dp[i][j][k] << " ";
  //    }
  //    printf("\n");
  //  }
  //  printf("\n");
  //}
  cout << ans << endl;

  
  return 0;
}

Measured memory_bytes: 51072
#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()
const ll INF = 1LL << 60;

int main(){
    int a;
    string s;
    cin >> a >> s;
    if(a>=3200){
        cout << s << endl;
    }
    else cout << "red" << endl;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

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

  ll N = S.length();
  vector<ll> dp0(N + 1), dp1(N + 1), dp2(N + 1), dp3(N + 1);
  dp0[0] = 1;
  REP(i, 0, N) {
    if (S[i] == 'A') {
      dp0[i + 1] = dp0[i];
      dp1[i + 1] = (dp0[i] + dp1[i]) % MOD;
      dp2[i + 1] = dp2[i];
      dp3[i + 1] = dp3[i];
    }
    if (S[i] == 'B') {
      dp0[i + 1] = dp0[i];
      dp1[i + 1] = dp1[i];
      dp2[i + 1] = (dp1[i] + dp2[i]) % MOD;
      dp3[i + 1] = dp3[i];
    }
    if (S[i] == 'C') {
      dp0[i + 1] = dp0[i];
      dp1[i + 1] = dp1[i];
      dp2[i + 1] = dp2[i];
      dp3[i + 1] = (dp2[i] + dp3[i]) % MOD;
    }
    if (S[i] == '?') {
      dp0[i + 1] = (dp0[i] * 3) % MOD;
      dp1[i + 1] = (dp0[i] + (dp1[i] * 3) % MOD) % MOD;
      dp2[i + 1] = (dp1[i] + (dp2[i] * 3) % MOD) % MOD;
      dp3[i + 1] = (dp2[i] + (dp3[i] * 3) % MOD) % MOD;
    }
  }

  REP(i, 0, N + 1) cerr << dp0[i] << (i != N ? " " : "\n");
  REP(i, 0, N + 1) cerr << dp1[i] << (i != N ? " " : "\n");
  REP(i, 0, N + 1) cerr << dp2[i] << (i != N ? " " : "\n");
  REP(i, 0, N + 1) cerr << dp3[i] << (i != N ? " " : "\n");

  cout << dp3[N] << endl;
}

Measured memory_bytes: 3584
fun main(args: Array<String>) {

    val (n, k) = readLine()!!.split(" ").map { it.toInt() }

    var ans = 0.0

    for(i in 1 .. n){
        var t = i
        var c = 0
        while (t < k){
            t *= 2
            c++
        }

        ans += (1.0/n) * Math.pow(0.5, c.toDouble())
    }

    println(ans)
}


Measured memory_bytes: 37872
import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	int x, y;
	{
		int[] tmp = readln.chomp.split.map!(to!int).array;
		x = tmp[0], y = tmp[1];
		}
	
	int ans1, ans2, ans3, ans4;
	if(y >= x) ans1 = y - x; else ans1 = int.max;
	if(y >= -x) ans2 = 1 + (y - -x); else ans2 = int.max;
	if(-y >= x) ans3 = 1 + (-y - x); else ans3 = int.max;
	if(-y >= -x) ans4 = 2 + (-y - -x); else ans4 = int.max;
	
	int ans = min(ans1, ans2, ans3, ans4);
	
	ans.writeln;
	}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while (true)

int main(){
    
    int a,n,m;
    cin >> a >> n >> m;

    int ans = 0;
    for(int y=1; y<=9*9; y++){
        int tmp = y + a;
        int x = 1;
        for(int i=0; i<n; i++) x *= tmp;
        
        string X = to_string(x);
        int y2 = 0;
        for(int i=0; i<X.size(); i++){
            y2 += X[i] - '0';
        }

        if(y2 == y && x <= m) ans++;
    }

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





/*
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while (true)

int main(){
    
    
    
    return 0;
}
*/


Measured memory_bytes: 3272
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os, pdb
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)

A, B = LI()

ans = 0
current = 1
while current < B:
    current -= 1
    current += A
    ans += 1
print(ans)


Measured memory_bytes: 7756
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };



int main() {
	vector<bool> is_pm( 1299710, true );
	is_pm[ 0 ] = is_pm[ 1 ] = false;
	for ( int i = 2; i * i <= 1299709; i += 2 ) {
		if ( is_pm[ i ] ) {
			for ( int j = i * i; j <= 1299709; j += i ) {
				is_pm[ j ] = false;
				if ( i != 2 ) {
					j += i;
				}
			}
			if ( i == 2 ) {
				--i;
			}
		}
	}
	int n;
	while ( ~scanf( "%d", &n ) && n ) {
		int a, b;
		for ( int i = n; i >= 2; i-- ) {
			if ( is_pm[ i ] ) {
				a = i;
				break;
			}
		}
		for ( int i = n; i <= 1299709; i++ ) {
			if ( is_pm[ i ] ) {
				b = i;
				break;
			}
		}
		printf( "%d\n", b - a );
	}
	return 0;
}

Measured memory_bytes: 1268
def coun(a,i,j):
    if dp[i][j]!=-1:
        return dp[i][j]

    if i==j:
        return a[i]
    elif abs(i-j)==1:

        return max(a[i],a[j])
    dp[i][j]= max(min(coun(a,i+2,j),coun(a,i+1,j-1))+a[i],min(coun(a,i+1,j-1),coun(a,i,j-2))+a[j])

    return dp[i][j]

n= int(input())
a =[int(X ) for  X in input().split()]
dp = [[-1 for i in range(n)]for j in range(n)]
print(2*coun(a,0,n-1)-sum(a))

Measured memory_bytes: 229868
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Library;
using static Library.Input;

namespace AtCoderTemplate
{
    class ProgramB
    {
        static void Main()
        {
            long n = NextInt, m = NextInt;
            long sum = LongList.Sum();

            if (sum > n)
            {
                System.Console.WriteLine(-1);
            }
            else
            {
                System.Console.WriteLine(n - sum);
            }
        }
    }
}

namespace Library
{
    class Input
    {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line => Console.ReadLine();

        public static string[] StrArr => Line.Split(' ');

        public static int NextInt => int.Parse(NextWord());

        public static long NextLong => long.Parse(NextWord());

        public static List<int> IntList => StrArr.Select(int.Parse).ToList();

        public static List<long> LongList => StrArr.Select(long.Parse).ToList();

        public static IEnumerable<long[]> TakeLine(int N)
        {
            return Enumerable.Repeat(0, N).Select(_ => Console.ReadLine().Split(' ').Select(long.Parse).ToArray());
        }

        public static string NextWord()
        {
            while (!enumerator.MoveNext())
            {
                enumerator = StrArr.AsEnumerable().GetEnumerator();
            }
            return enumerator.Current;
        }
    }
}


Measured memory_bytes: 29128
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	string s; cin >> s;
	cout << s.substr(0, s.length() - 8) << endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
Ks = list(map(int, input().split()))

roads = [list(map(int, input().split())) for i in range(M)]

highest = set([i + 1 for i in range(N)])

for road in roads:
	if Ks[road[1] - 1] > Ks[road[0] - 1]:
		if road[0] in highest:
			highest.remove(road[0])
	elif Ks[road[1] - 1] < Ks[road[0] - 1]:
		if road[1] in highest:
			highest.remove(road[1])
	else:
		if road[1] in highest:
			highest.remove(road[1])
		if road[0] in highest:
			highest.remove(road[0])

print(len(highest))

Measured memory_bytes: 41904