akhauriyash/Code-Regression huggingface dataset:
def devide_two(a, counter):

    if a == []:
        return counter

    temp_a = []
    for i in a:
        if i % 2 == 0:
            counter += 1
            temp_a += [i//2]

    return devide_two(temp_a, counter)

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

print(devide_two(a, counter = 0))

Measured memory_bytes: 12040
#pragma GCC optimize("O3")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include<unordered_set>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define all(x) x.begin(),x.end()
using namespace std;
inline int mex(unordered_set<int> st)
{
	int m = 0;
	while (st.find(m) != st.end())
	{
		m += 1;
	}
	return m;
}
inline int calculateGrundy(int n)
{
	if (n == 1)
		return 0;
	unordered_set<int> mexi;
	for (int i = 1; i <= sqrt(n); i += 1)
	{
		if (n % i == 0)
		{
			if (n / i != n)
				mexi.insert(calculateGrundy(n / i));
			mexi.insert(calculateGrundy(i));
		}
	}
	return mex(mexi);
}
inline ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0),cin.tie(0);
	ll n, k;
	cin >> n;
	vector<ll> arr(n, 0);
	ll sum = 0;
	f(i, 0, n)
	{
		cin >> arr[i];
		sum += arr[i];
	}
	ll ans = 0;
	if (sum % n == 0)
	{
		sum /= n;
		f(i, 0, n)
		{
			ans += (sum - arr[i]) * (sum - arr[i]);
		}
	}
	else
	{
		sum /= n;
		ll ans1 = 0, ans2 = 0;
		f(i, 0, n)
		{
			ans1 += (sum - arr[i]) * (sum - arr[i]);
		}
		f(i, 0, n)
		{
			ans2 += (sum+1 - arr[i]) * (sum+1 - arr[i]);
		}
		ans = min(ans1, ans2);
	}
	
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#
#
# S = input()
#

s = str(input())
# s = 'czyxwvutsrqponmlkjihgfedba'

s_list = list(s)
s_length = len(s)
last_str = s[-1]

alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

if s == 'zyxwvutsrqponmlkjihgfedcba':
    print(-1)

elif s_length < 26:
    rest_list = list(set(alphabet) - set(s_list))
    rest_list.sort()
    print(s + rest_list[0])

else:
    trans_list = []
    for i in reversed(range(1,len(s))):
        trans_list.append(alphabet.index(s_list[i]))
        min_trans_list = min(trans_list)

        if alphabet.index(s_list[i-1]) < alphabet.index(s_list[i]):
            last_list = [k for k in trans_list if k > alphabet.index(s_list[i-1])]

            print(s[:i-1] + alphabet[last_list[0]])

            break





Measured memory_bytes: 3064
package main

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

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	scanner := bufio.NewScanner(os.Stdin)
	s := make([]string, h)
	for i := 0; i < h; i++ {
		scanner.Scan()
		s[i] = scanner.Text()
	}
	result := ""
	for i := 0; i < h; i++ {
		for k := 0; k < w; k++ {
			total := 0
			if s[i][k] == '.' {
				if 0 < i {
					total += eight(s[i-1], k, w)
				}
				if i < h-1 {
					total += eight(s[i+1], k, w)
				}
				total += eight(s[i], k, w)
				result += strconv.Itoa(total)
			} else {
				result += "#"
			}
		}
		result += "\n"
	}
	fmt.Print(result)
}

func eight(s string, k int, w int) int {
	total := 0
	if s[k] == '#' {
		total++
	}
	if 0 < k {
		if s[k-1] == '#' {
			total++
		}
	}
	if k < w-1 {
		if s[k+1] == '#' {
			total++
		}
	}
	return total
}

Measured memory_bytes: 4352
#![allow(unused_imports)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

//
// Macro debug!
//

#[cfg(debug_assertions)]
include!{"./procon/debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

//
// Macro input!
//

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//
// IteratorExt
//

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}





fn main() {
    input! {
        n: isize,
        m: isize,
    }
    
    let (x, y) = (m, n + m - 1);

    let ans = if y < 0 {
        let y = y - 1;
        (x + y) * (y - x + 1) / 2
    } else if 0 < x {
        let x = x + 1;
        (x + y) * (y - x + 1) / 2
    } else {
        (x + y) * (y - x + 1) / 2
    };

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


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
#include <vector>
#include <string>

int main(){
  long long int ans=0,mans=0;
  string s;
  int n;
  cin >> n;
  cin >> s;
  int J=0,O=0,I=1;
  
  for(int i = n-1; i >= 0; i--){
  
    if(s[i]=='I')I++;
    if(s[i]=='O'){
      O++;
      J+=I;
     
    }
    if(s[i]=='J'){
      ans+= J;
    }
  }
 
  mans =ans;
  J=0;O=0;I=0;ans = 0;
  for(int i = n-1; i >= 0; i--){
    if(s[i]=='I')I++;
    if(s[i]=='O'){
      O++;
      J+=I;
    }
    if(s[i]=='J'){
      ans+=J;
    }
  }
 
  if(mans < ans+J)mans = ans+J;
  J=0;
  int k=0;
  for(int i = 0; i < n; i++){
    if(k < I*J)k = I*J;
    if(s[i]=='I'){
      I--;
    }
    if(s[i]=='J'){
      J++;
    }
  }  
 
  if(mans < ans+k)mans = ans+k;
  
  cout << mans << endl;
}



Measured memory_bytes: 3352
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define REPS(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
using ll = long long;
using ld = long double;

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

    bool flg = true;
    REP (i, 3) {
        char tmp;
        if (i == 0) {
            tmp = S.at(0);
        }
        if (tmp != S.at(i)) {
            flg = false;
        }
    }
    if (flg) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;
const int mod = 1e9 + 7;
const int MX = 210000;
ll inv[MX], f[MX], invf[MX];
void calc(){
	inv[0] = inv[1] = f[0] = f[1] = invf[0] = invf[1] = 1;
	for (int i = 2; i < MX; i++){
		inv[i] = mod - mod / i * inv[mod % i] % mod;
		f[i] = f[i - 1] * i % mod;
		invf[i] = invf[i - 1] * inv[i] % mod;
	}
}
inline ll C(ll n, ll k){
	return f[n] * invf[k] % mod * invf[n - k] % mod;
}

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	calc();
	
	int n, m, k; cin >> n >> m >> k;
	if(n > m) swap(n, m);
	
	ll co = C(n * m - 2, k - 2);
	ll ans = 0, sum = 0;
	for(int i = 1; i < m; i++) sum += (ll)i * (m - i); sum %= mod;
	ans = sum * n % mod;
	
	rep(i, n){
		ans += 2 * sum * i;
		ans += i * (i + 1ll) / 2 * m % mod * m % mod;
	}
	
	ans = ans % mod * co % mod;
	
	cout << ans << endl;
	
	return 0;
}

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

using namespace std;
typedef long long ll;
const int MAXN = 55;

int N, K;
int arr[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);
    
    cin >> N >> K;
    for (int i = 0; i < N; i++)
        cin >> arr[i];

    int ans = 0;
    for (int i = 0; i < N; i++)
        for (int j = 0; j + i <= min (N, K); j++)
        {
            int cv = 0;
            vector <int> v;
            for (int k = 0; k < i; k++)
                v.push_back(arr[k]);
            for (int k = N - j; k < N; k++)
                v.push_back(arr[k]);
            sort (v.begin(), v.end());

            for (int x : v) cv += x;
            for (int k = 0; k < K - i - j && k < i + j; k++)
            {
                if (v[k] < 0)
                    cv -= v[k];
            }
            ans = max (ans, cv);
        }
    cout << ans << "\n";
}

Measured memory_bytes: 256
N = int(input())
bList = [int(x) for x in input().split()]
numset = list(set(bList))
numset.sort(reverse=True)

result = []
for i in range(N, 0, -1):
    okflg = False
    for num in numset:
        kouho = [i+1 for i, x in enumerate(bList) if x == num]
        if num in kouho:
            del bList[num-1]
            result.append(num)
            okflg = True
            break
    if not okflg:
        print('-1')
        quit()

for x in result[::-1]:
    print(x)

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

int main()
{
  int i,j,k;
  int M1,D1;
  int M2,D2;
  
  scanf("%d %d",&M1,&D1);
  scanf("%d %d",&M2,&D2);
  
  if( M2==(M1+1) && D2==1 ){
    printf("1\n");
  }
  else{
    printf("0\n");
  }
  
  
  return 0; 
}

Measured memory_bytes: 128
s = input()
t = input()
ans = 0
max = 0

if t in s:
  print(ans)
else:
  for i in range(len(s) - len(t) + 1):
    for j in range(len(t)):
      if t[j] == s[j + i]:
        ans += 1
    if max < ans:
        max = ans
    ans = 0
  print(len(t) - max)


Measured memory_bytes: 8932
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, ans = 0;
    cin >> n;
    for(int a=1;a<n;++a) {
        for(int b=1;a*b<=n;++b) {
            int c = n - a * b;
            if(c > 0) {
                ++ans;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3648
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        x: i32,
    }

    println!("{}", x / 3);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
int main () {
  long N;
  cin >> N;
  long ans = 0, a, b;
  cin >> a;
  ans += a / 2;
  a %= 2;
  b = a;
  for(int i = 1; i < N; i++){
    cin >> a;
    if(b == 1 && a > 0){
      ans++;
      a--;
    }
    ans += a / 2;
    a %= 2;
    b = a;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
ll MOD = (1e9)+7;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
inline void fastIO(){
  ios_base::sync_with_stdio(0);cin.tie(0);
}

int main(){
  fastIO();
  int n;
  cin>>n;
  vector<int>h(n);
  for(int i=0;i<n;i++){
    cin>>h[i];
  }
  for(int i=0;i<n-1;i++){
    if(h[i+1]<h[i]){
      h[i]--;
    }else if(i>0){
      if(h[i+1]==h[i]&&h[i]>h[i-1]){
        h[i]--;
      }
    }

  }
  bool yes=true;
  for(int i=0;i<n-1;i++){
    if(h[i+1]<h[i]){
      yes=false;
    }
  }
  if(yes){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return 0;
}


Measured memory_bytes: 640
#[allow(unused_imports)]
use std::cmp::*;
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 = read();
    let m = read();
    let c: i32 = read();
    let b: Vec<i32> = (0..m).map(|_| read()).collect();
    let mut a: Vec<Vec<i32>> = Vec::new();
    a.resize(n, Vec::new());
    for i in 0..n {
        a[i] = (0..m).map(|_| read()).collect();
    }

    let mut ans = 0;
    for i in 0..n {
        let mut sum = c;
        for j in 0..m {
            sum += a[i][j] * b[j]
        }
        if sum > 0 {
            ans += 1;
        }
    }

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

Measured memory_bytes: 4352
#include <iostream>
using namespace std;
int main() {
int S[32] ={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int K;
cin>>K;
cout<<S[K-1];
}

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

#define REP(i, n, m) for(int i = n; i < m; i++)
#define REPR(i, n, m) for(int i = n; i >= m; i--)
#define LREP(i, n, m) for(ll i = n; i < m; i++)
#define LREPR(i, n, m) for(ll i = n; i >= m; i--)


const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;

typedef long long ll;


//---functions---//
int gcd(int a, int b){
    if(a < b) swap(a, b);
    return b?gcd(b, a%b):a;
}

int s2i(string num){stringstream ss; ss << num << flush; int n; ss >> n; return n;}
string i2s(int n){stringstream ss; ss << n << flush; return ss.str();}
//---------------//

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

    cin >> N;
    char S[N];
    int e[N], w[N];
    REP(i, 0, N){
        cin >> S[i]; 
        e[i] = 0; 
        w[i] = 0;
    }
    if(S[0] == 'W') w[0] = 1;
    REP(i, 1, N){
        if(S[i] == 'W'){
            w[i] = w[i-1] + 1;
        }else{
            w[i] = w[i-1];
        }
    }
    if(S[N-1] == 'E') e[N-1] = 1;
    REPR(i, N - 2, 0){
        if(S[i] == 'E'){
            e[i] = e[i+1] + 1;
        }else{
            e[i] = e[i+1];
        }
    }
    /*
    cout << "w = ";
    REP(i, 0, N) cout << w[i];
    cout << endl;
    cout << "e = ";
    REP(i, 0, N) cout << e[i];
    cout << endl;
    */
    int ans = INF;
    REP(i, 0, N){
        if(i == 0){
            ans = min(ans, e[1]);
        }else if(i == N - 1){
            ans = min(ans, w[N-2]);
        }else{
            ans = min(ans, w[i-1] + e[i+1]);
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 2944
/* it was worth becoming a chemist */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<int, long long> pil;
typedef vector<int> vi;
typedef vector<long long> vll;

#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
#define NAME "puts"
#define F first
#define S second

const int inf = 1e9;
const ll INF = 1e18;
const int mod = 1e9 + 7;
const int MAXN = 1e5 + 5;

ll a, b, c;
    
int main() {
	//freopen(NAME".in", "r", stdin);
	//freopen(NAME".out", "w", stdout);

	
	cin >> a >> b >> c;
	ll mn = min(a, c);
	ll res = 0;
	res += mn;
	a -= mn;
	c -= mn;
	if (b >= c) cout << res + b + c;
	else cout << res + b * 2 + 1;
	return 0;	
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;
typedef vector<int> vi;


int main() {
	int n, m;
	cin >> n >> m;
	vi A(n, 1);
	vector<bool> P(n, false);
	P[0] = true;
	for (int i = 0; i < m; i++) {
		int x, y;
		cin >> x >> y;
		x--; y--;
		if (A[x] == 1) {
			if (P[x]) {
				P[y] = true;
				P[x] = false;
			}
			A[x]--;
			A[y]++;
		}
		else {
			if (P[x]) {
				P[y] = true;
			}
			A[x]--;
			A[y]++;
		}
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (P[i])ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
/*
  AUTHOR:SOURABH
  CREATED:10:01:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<ll , null_type, less< ll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen(2 "out.txt","w",stdout);

    char c;
    cin>>c;
    cout<<++c;
    return 0;
}






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

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

even = 0
bai = 0
for i in range(N):
    if A[i] % 2 == 0:
        even = even + 1
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            bai = bai + 1
    i = i + 1
    
if even == bai:
    print("APPROVED")
else:
    print("DENIED")
            

Measured memory_bytes: 3064
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}
	
	std::string S;
	std::cin >> S;
	int hist[3] = {};
	for (auto ch : S) {
		++hist[ch - 'a'];
	}
	if (hist[0] == 1 && hist[1] == 1) {
		std::cout << "Yes\n";
	} else {
		std::cout << "No\n";
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

using namespace std;
#define LOCAL  1
#define UPLOAD 2
#define ll long long
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
template <class T = long long> T input(){T x;cin >> x;return x;}
template <class T> void output(T x){cout << x << endl;}
#define debug(x) cerr << #x<< ": " << x<< '\n';

int main()
{
#if ENVIRONMENT == LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
  int N = input();
  vector<int> D;
  for(int i=0;i<N;i++){
    int d = input();
    D.push_back(d);
  }
  
  int sum = 0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      sum += D[i]*D[j];
    }
  }

  output(sum);

  return 0;
}

Measured memory_bytes: 256
# ANSHUL GAUTAM
# IIIT-D
 
a,b = map(int, input().split())
if(a+b>16):
	print(":(")
elif(a==8 and b==8):
	print("Yay!")
elif(max(a,b)>8):
	print(":(")
else:
	print("Yay!")







Measured memory_bytes: 2940
from sys import stdin
input = stdin.readline


def main():
  S = input()[:-1]

  N = len(S)+1

  from_left = [0]*N
  from_right = [0]*N

  for i, s in enumerate(S, 1):
    if s == '>':
      from_left[i] = 0
    else:
      from_left[i] = from_left[i-1]+1

  for i, s in enumerate(S[::-1]):
    i = N-2-i
    if s == '<':
      from_right[i] = 0
    else:
      from_right[i] = from_right[i+1]+1

  seq = [x if x>y else y for x, y in zip(from_left, from_right)]

  answer = sum(seq)
  print(answer)


if(__name__ == '__main__'):
  main()


Measured memory_bytes: 118632
#include<bits/stdc++.h>
using namespace std;
int main(){
  string a,b;
  cin >> a >> b;
  int c,d;
  cin >> c >> d;
  string e;
  cin >> e;
  if(a == e)
    cout << c-1 << ' '<< d << endl;
  else
    cout << c << ' '<< d -1 << endl;
}


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

int main() {
  long H,W,M;
  cin>>H>>W>>M;
  vector<long>K(M);
  vector<long>O(M);
  long h=H+1;
  long w=W+1;
  int m=max(h,w);
  vector<long>A(m,0);
  vector<long>B(m,0);
  vector<long>a(m,0);
  vector<long>b(m,0);
  vector<long>D(m,0);
  vector<long>d(m,0);
  vector<long>Z(m,0);
  vector<long>z(m,0);
  vector<long>Y(m,0);
  vector<long>y(m,0);
  for(long i=0;i<M;i++){
    cin>>K[i]>>O[i];
    A[K[i]]++;
    B[O[i]]++;
    a[K[i]]++;
    b[O[i]]++;
    D[K[i]]++;
    d[O[i]]++;
    Z[K[i]]++;
    z[K[i]]++;
    Y[O[i]]++;
    y[O[i]]++;
  }
  long C=0;
  long c=0;
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  for(long i=0;i<m;i++){
    if(a[0]==D[i]){
      c=i;
      break;
    }
  }
  for(long i=0;C<a[0];i++){
    if(K[i]==c){
      b[O[i]]--;
      C++;
    }
  }
  sort(b.begin(),b.end());
  reverse(b.begin(),b.end());
  int ANS=a[0]+b[0];
  long E=0;
  sort(B.begin(),B.end());
  reverse(B.begin(),B.end());
  for(long i=0;i<m;i++){
    if(B[0]==d[i]){
      c=i;
      break;
    }
  }
  for(int i=0;E<B[0];i++){
    if(O[i]==c){
      A[K[i]]--;
      E++;
    }
  }
  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());
  int ans=A[0]+B[0];
  int Last=max(ANS,ans);
  
  //ここから折り返し
  
  long F=0;
  long f=0;
  sort(z.begin(),z.end());
  reverse(z.begin(),z.end());
  for(long i=m-1;i>=0;i--){
    if(z[0]==D[i]){
      f=i;
      break;
    }
  }
  for(long i=0;F<z[0];i++){
    if(K[i]==f){
      y[O[i]]--;
      F++;
    }
  }
  sort(y.begin(),y.end());
  reverse(y.begin(),y.end());
  int SNA=z[0]+y[0];
  long G=0;
  sort(Y.begin(),Y.end());
  reverse(Y.begin(),Y.end());
  for(long i=m-1;i>=0;i--){
    if(Y[0]==d[i]){
      f=i;
      break;
    }
  }
  for(int i=0;G<Y[0];i++){
    if(O[i]==f){
      Z[K[i]]--;
      G++;
    }
  }
  sort(Z.begin(),Z.end());
  reverse(Z.begin(),Z.end());
  int sna=Z[0]+Y[0];
  int last=max(SNA,sna);
  
  cout<<max(Last,last)<<endl;
}

Measured memory_bytes: 31436
#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() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;

    ll s = 0;
    REP(i, N) {
        ll n = i + 1;
        if (n % 3 != 0 && n % 5 != 0)
            s += n;
    }
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 3640
import sys
input = sys.stdin.readline
enum = enumerate
INF = 1001001001

def linput(ty=int, cvt=list):
	return cvt(map(ty,input().rstrip().split()))

def vinput(rep=1, ty=int, cvt=list):
	return cvt(ty(input().rstrip()) for _ in "*"*rep)

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def main():
	N,M = linput()
	S,T = vinput(2,str)
	
	g = gcd(N,M)
	l = lcm(N,M)
	
	res = 0
	if S[::N//g]==T[::M//g]:
		#print(S[::N//g])
		#print(T[::M//g])
		res = l
	else:
		res = -1
	
	#sT = "No Yes".split()
	#print(sT[res])
	print(res)


if __name__ == "__main__":
	main()


Measured memory_bytes: 9248
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++) {
			a[scan.nextInt()-1]=i+1;
		}
		scan.close();
		for(int i=0;i<n;i++) {
			System.out.print(a[i]);
			if(i!=n)System.out.print(" ");
		}
		System.out.println();

	}
}

Measured memory_bytes: 66972
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <iomanip>
#include <map>
#include <queue>
#include <list>


#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
//#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define vint vector<int>
#define INF 1e9

using namespace std;
typedef long long  ll;


int main(){
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;

    int tmp = (h2 - h1)*60 + (m2 - m1);

    p(tmp - k);
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans=0;
    for(int i=0; i<n; i++){
        string s1 = s.substr(0, i);
        string s2 = s.substr(i, s.size()-i);
        int count=0;

        for(char c='a'; c<='z'; c++){
            int exist=0;
            for(int j=0; j<s1.size(); j++){
                if(c==s1[j]){
                    exist++;
                    break;
                }
            }
            for(int j=0; j<s2.size(); j++){
                if(c==s2[j]){
                    exist++;
                    break;
                }
            }
            if(exist==2){
                count++;
            }
        }

        ans = max(ans, count);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-06-05 12:50:10
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

#if __cplusplus >= 201703L
template <class Ch, class Tr, class Tuple, std::size_t... Is>
void tuple_out(std::basic_ostream<Ch, Tr>& os, const Tuple& tp, std::index_sequence<Is...>) {
  ((os << (Is ? ", " : "(") << std::get<Is>(tp)), ...) << ")";
}

template <class Ch, class Tr, class... Args>
auto& operator<<(std::basic_ostream<Ch, Tr>& os, const std::tuple<Args...>& tp) {
  tuple_out(os, tp, std::index_sequence_for<Args...>{});
  return os;
}
#endif

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class Compare>
std::ostream& operator<<(std::ostream& os, const std::set<T, Compare>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U, class Compare>
std::ostream& operator<<(std::ostream& os, const std::map<T, U, Compare>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int h1, m1, h2, m2; cin >> h1 >> m1 >> h2 >> m2;
  int wake_up = 60 * h2 + m2 - (60 * h1 + m1);
  int k; cin >> k;

  cout << max(0, wake_up - k) << endl;

  return 0;
}


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

int main(void)
{
  int n;
  cin >> n;
  vector<int> data(n);
  rep(i,n) 
  {
    cin >> data[i];
    if(i > 0) cout << " ";
    cout << data[i];
  }
  cout << endl;
  for(int i = 1; i < n ; i++)
  {
    int v = data[i];
    int j = i - 1;
    while(j >= 0 && data[j] > v)
    {
      data[j+1] = data[j];
      j--;
    }
    data[j+1] = v;
    rep(i, n) 
    {
      if(i > 0) cout << " ";
      cout << data[i];
    }
    
    cout << endl;
  }
  return (0);
} 


Measured memory_bytes: 3120
#include <stdio.h>

int main(){
  int H, W;
  char S[60][60] = {};
  int count = 0;

  scanf("%d %d", &H, &W);
  for(int i = 0; i < H; i++){
    scanf("%s", S[i]);
  }

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(S[i][j] == '.'){
        count = 0;
        for(int k = -1; k <= 1; k++){
          for(int l = -1; l <= 1; l++){
            if(k != 0 || l != 0){
              if(i+k>=0 && i+k<H && j+l>=0 && j+l<W && S[i+k][j+l]=='#'){
                count++;
              }
            }
          }
        }
        S[i][j] = count + '0';
      }
    }
  }

  for(int i = 0; i < H; i++){
    printf("%s\n", S[i]);
  }
  
  return 0;
}


Measured memory_bytes: 128
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int> > Matrix;



int main(){
    int n;
    string s;
    cin >> n >> s;
    char tmp = s[0];
    int ans = 1;
    for (int i = 1; i < n; i++){
        if (tmp != s[i]){
            ans++;
            tmp = s[i];
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x;
  cin >> x;
 
  if (x % 1110 < 10 || (x - x/1000*1000)%111==0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

int bubbleSort(int A[],int N) {
  int sw=0;
  bool flag=true;
  for (int i=0; flag; i++) {
    flag=false;
    for (int j=N-1; j>=i+1; j--) {
      if (A[j]<A[j-1]) {
        swap(A[j],A[j-1]);
        flag=true;
        sw++;
      }
    }
  }
  return sw;
}
int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i=0; i<N; i++) {
    cin >> A[i];
  }
  int sw=bubbleSort(A,N);
  for (int i=0; i<N; i++) {
    cout << (i==0?"":" ") << A[i] << flush;
  }
  cout << endl;
  cout << sw << endl;
  return 0;
}



Measured memory_bytes: 3084
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2600>
 問題文============================================================
 =================================================================
 解説=============================================================
 
 ================================================================
 */

string solve(){
    string res;
    int N,W,H; cin >> N >> W >> H;
    vector<int> x(N),y(N),w(N);
    vector<int> X(W+2),Y(H+2);
    for(int i = 0; i < N;i++){
        cin >> x[i] >> y[i] >> w[i];
        X[max(0,x[i]-w[i])]++;
        X[min(W+1,x[i]+w[i])]--;
        
        Y[max(0,y[i]-w[i])]++;
        Y[min(H+1,y[i]+w[i])]--;
    }
    
    bool xf = true;
    for(int i = 0; i < W;i++){
        X[i+1] += X[i];
        if(X[i] == 0) xf = false;
    }
    bool yf = true;
    for(int i = 0; i < H;i++){
        Y[i+1] += Y[i];
        if(Y[i] == 0) yf = false;
    }
    if(xf | yf){
        res = "Yes";
    }else{
        res = "No";
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    cout << solve() << endl;
    return 0;
}



Measured memory_bytes: 5004
#![allow(unused_imports, unused_variables, unused_macros, unused_mut, dead_code)]
use std::io::*;
use std::str::{FromStr, Chars};

fn read_line<T: FromStr>(stdin_lock: &mut StdinLock) -> T {
    let mut line: String = String::new();
    stdin_lock.read_line(&mut line).expect("input error");
    line.trim().to_string().parse().ok().expect("parse error")
}

fn sep_line<T: FromStr>(stdin_lock: &mut StdinLock, sep: char) -> Vec<T> {
    let mut line: String = String::new();
    stdin_lock.read_line(&mut line).expect("input error");
    line = line.trim().to_string();
    let res: Vec<&str> = line.split(sep).collect();
    res.iter().map(|s| s.to_string().parse::<T>()
        .ok().expect("parse error")).collect()
}

fn main() {

    let stdin = stdin();
    let mut stdin_lock = stdin.lock();
    let s:Vec<usize> = read_line::<String>(&mut stdin_lock).chars()
                        .map(|c| c as usize - '0' as usize).collect();
    let n:usize = s.len();
    let mut res:usize = 0;
    for i in 0..(1<<(n-1)) {
        let (mut t, mut d): (usize, usize) = (0, 0);
        for j in 0..n {
            d = d*10 + s[j];
            if j == n-1 || (i & (1<<j)) != 0 {
                t += d;
                d = 0;
            }
        }
        res += t;
    }
    println!("{}", res);
}


Measured memory_bytes: 4352
#include<cassert>
#include<cstdio>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

const double eps = 1e-10;

class Point{
public:
  double x,y,z;
  double dist(){
    return sqrt(x*x+y*y+z*z);
  }
  Point operator+(Point a)const{
    return (Point){x+a.x,y+a.y,z+a.z};
  }
  Point operator-(Point a)const{
    return (Point){x-a.x,y-a.y,z-a.z};
  }
  Point operator*(double a)const{
    return (Point){a*x,a*y,a*z};
  }
  Point operator/(double a)const{
    return (Point){x/a,y/a,z/a};
  };
};

//Lib
double dot(Point A,Point B){
  return A.x*B.x + A.y*B.y + A.z*B.z;
}

//Lib
Point CircumCenter(Point A,Point B,Point C){
  Point ret;
  double a=(B-C).dist(),b=(C-A).dist(),c=(A-B).dist();
  double cosA=dot(B-A,C-A)/(b*c);
  double s=(c-b*cosA)/(2*c*(1-cosA*cosA));
  double t=(b-c*cosA)/(2*b*(1-cosA*cosA));
  ret=(B-A)*s+(C-A)*t+A;
  return ret;
}

//Lib
Point normal_vector(Point a,Point b){
  Point ret =(Point){a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x};
  double len=ret.dist();
  ret=ret/len;
  return ret;
}

double isp(Point a,Point b,Point c){
  return (a-c).dist()+(b-c).dist() < (a-b).dist() + eps;
}

bool is_contain_all(Point a,double r,vector<Point> &in){
  rep(i,in.size()){
    if ((in[i]-a).dist() <r+eps);
    else return false;
  }
  return true;
}

double solve(Point cir,Point norm,vector<Point> &in,Point check,
	     double d,double f){//d=(A+B)/2).dist(),f=(cir-(A+B)/2)/dist()
  double l = 0,r=40;
  double mid,ret=1e6;
  //  while(r-l >eps){
  rep(i,100){
    double mid = (l+r)/2;
    Point vec = cir+norm*mid;
    double radius = (vec-check).dist();
    if (isnan(radius))exit(1);
    if (is_contain_all(vec,radius,in))r=mid-eps,ret=min(ret,radius);
    else l=mid+eps;
  }
  return ret;
}

double solve(vector<Point> & in){
  double ret = 1e6;
  
  rep(i,in.size()){
    REP(j,i+1,in.size()){
      REP(k,j+1,in.size()){
	if (isp(in[i],in[j],in[k])||isp(in[i],in[k],in[j])
	    ||isp(in[j],in[k],in[i])){
	  continue;
	}
	Point cir = CircumCenter(in[i],in[j],in[k]);
	double r =(cir-in[i]).dist();

	if (is_contain_all(cir,r,in))ret=min(ret,r);
	
	Point norm= normal_vector(in[j]-in[i],in[k]-in[i]);
	Point tmp = (in[i]+in[j])/2-in[i];
	Point tmp2= (cir-(in[i]+in[j])/2);
	ret=min(ret,solve(cir,norm,in,in[i],tmp.dist(),tmp2.dist()));
	norm=norm*-1;
	ret=min(ret,solve(cir,norm,in,in[i],tmp.dist(),tmp2.dist()));
	
      }
    }
  }
  
  rep(i,in.size()){
    REP(j,i+1,in.size()){
      Point center=(in[i]+in[j])/2;
      double r = (center-in[i]).dist();
      if (is_contain_all(center,r,in))ret=min(ret,r);
    }
  }

  return ret;
}

main(){
  int n;
  while(cin>>n && n){
    vector<Point> in;
    rep(i,n){
      double x,y,z;
      cin>>x>>y>>z;
      in.push_back((Point){x,y,z});
    }

    printf("%.8lf\n",solve(in));
  }
}

Measured memory_bytes: 980
N, W = [int(_) for _ in input().split()]
WV = [[int(_) for _ in input().split()] for i in range(N)]

def solve(N, W, WV):
    if N == 0:
        return 0
    if W == 0:
        return 0

from collections import defaultdict
from itertools import accumulate

cs = defaultdict(list)

for w, v in WV:
    cs[w].append(v)

minw = min(cs.keys())

for k in range(minw, minw+4):
    cs[k] = [0] + list(accumulate(sorted(cs[k], reverse=True)))

ts = defaultdict(int)

result = solve(N, W, WV)
result = 0

for w1, t1 in enumerate(cs[minw]):
    for w2, t2 in enumerate(cs[minw+1]):
        tw2 = w1 * minw + w2 * (minw+1)
        tv2 = t1 + t2
        if tw2 > W:
            break
        for w3, t3 in enumerate(cs[minw+2]):
            tw3 = tw2 + w3 * (minw+2)
            tv3 = tv2 + t3
            if tw3 > W:
                break
            for w4, t4 in enumerate(cs[minw+3]):
                tw4 = tw3 + w4 * (minw+3)
                tv4 = tv3 + t4
                # print(w1, w2, w3, w4, tv4)
                if tw4 > W:
                    break
                result = max(result, tv4)

print(result)


Measured memory_bytes: 3440
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (int)(a); i <= (int)(b); i++)
#define NFOR(i,a,b) for(int i = (int)(a); i >= (int)(b); --i)
#define endl "\n"
#define mp make_pair
#define X first
#define Y second
#define inf 1e9
#define mod 1000000007
#define mod1 998244353
#define pb push_back
#define Case cout<<"Case #"<<++cas<<": ";
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(v) v.begin(),v.end()
#define sz(x) int(x.size())
// #define lli int
typedef long long int lli;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<pii> vii;
typedef pair<lli,lli> pll;
typedef vector<lli> vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef complex <long double> complex_t;
const long double PI = acos((long double)-1.0);

#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ","; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}

ll b[200010];
int a[200010];
map<ll, int> mp1;
ll ft[200010];

void update(int index1, int val1) {
    for(; index1 <= 200009; index1 += index1 & (-index1)) {
        ft[index1] += val1;
    }
}

ll query(int index1) {
    ll answer1 = 0;
    for(; index1 > 0; index1 -= index1 & (-index1)) {
        answer1 += ft[index1];
    }
    return answer1;
}

ll query(int a1, int b1) {
    if (a1 > b1) return 0;
    return query(b1) - query(a1-1);
}

int main() {
    int n, k;
    cin >> n >> k;
    FOR(i, 1, n) {
        int temp; cin >> temp; a[i] = temp;
    }
    FOR(i, 1, n) {
        b[i] = b[i-1] + (ll)(a[i] - k);
    }
    set<ll> set1;
    FOR(i, 1, n) set1.insert(b[i]);
    for (auto v : set1) {
        mp1[v] = sz(mp1) + 1;
        // pr(v, mp1[v]);
    }
    // pr(mp1);
    ll answer1 = 0;
    FOR(i, 1, n) {
        int pos1 = mp1[b[i]];
        if (b[i] >= 0) answer1++;
        // pr(i, mp1[b[i]], pos1);
        answer1 += query(0, pos1);
        update(pos1, 1);
    }
    cout << answer1 << endl;
return 0;}

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

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; }



int main(){
    const long long INF = 1LL << 60;


    long long N;
    cin >> N;

    // DP テーブル
    long long dp[N + 10];

    // DP テーブル全体を初期化 (最小化問題なので INF に初期化)
    for (int i = 0; i < N + 10; ++i) dp[i] = INF;

    dp[0] = 0;
    dp[1] = 1;

    for(int i = 0; i < N+1; i++){
            long long s = 1;
            long long t = 1;
        for(int j = 1; j < N; j++){
          if(i - j <0)break;
            chmin(dp[i],dp[i - 1] + 1) ;
            s *= 6;
            if(i - s>=0){
                chmin(dp[i],dp[i - s] + 1);
            }
            t *= 9;
            if(i - t>=0){
                chmin(dp[i],dp[i - t] + 1);
            }
            if(i - s < 0 && i - t < 0)break;
        }
    }

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


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

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

    vector<int> num(n+1, 0);
    bool possible = true;

    for (int i = 0; i < m; i++) {
        int s, c;
        cin >> s >> c;
        s--;
        if (num[s] != 0 && num[s] != c) {
            possible = false;
        }
        if (n > 1 && s == 0 && c == 0) {
            possible = false;
        }
        num[s] = c;
    }

    if (!possible) {
        cout << -1 << endl;
        return 0;
    }
    if (n > 1 && num[0] == 0) {
        num[0] = 1;
    }

    for (int i = 0; i < n; i++) cout << num[i];
    cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

int main() {
  double b[11];
  while(cin >> b[1]) {
    for(int i = 2; i <= 10; ++i) {
      if(i % 2 == 0) b[i] = b[i-1] * 2.0;
      else b[i] = b[i-1] / 3.0;
    }
    double s = 0.0;
    for(int i = 1; i <= 10; ++i) s += b[i];
    printf("%.10f\n", s);
  }
  return 0;
}

Measured memory_bytes: 1236
#include<cmath>
#include<bits/stdc++.h>
#define MAX(a,b) (a>b? a:b)
#define MIN(a,b) (a>b? b:a)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repr(i,n) for(lint i=(lint)(n);i>0;--i)
#define reps(i,a,b) for(lint i=a;i<=(lint)(b);i++)
typedef long long lint;
typedef long double ld;
using namespace std;
const ld PI = acos(-1.0);

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(b-a==c-b) cout << "YES" << endl;
    else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;

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

    string s;
    int K;
    cin >> s >> K;
    
    int n = s.size();
    ll dp[101][2][5] = {0};
    dp[0][0][0] = 1;

    rep(i, n){
        rep(j, 2){
            rep(k, K+1){
                
                int c = s[i] - '0';
                rep(nxt, 10){
                    if(c<nxt && j==0) continue;

                    int dgt = i + 1;

                    int isless = j;
                    if(nxt < c) isless = 1;
                    
                    int k2 = k;
                    if(nxt != 0) ++k2;

                    dp[i + 1][isless][k2] += dp[i][j][k];

                }
            }
        }
    }

    cout << dp[n][0][K] + dp[n][1][K] << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i = 0; i < (n);++i)

int main(){
  int a,b,c,d,e;
  cin >> a >> b >> c >> d >> e;
  if(a == 0){
    cout << 1 << endl;
  }
  if(b == 0){
    cout << 2 << endl;
  }
  if(c == 0){
    cout << 3 << endl;
  }
  if(d == 0){
    cout << 4 << endl;
  }
  if(e == 0){
    cout << 5 << endl;
  }

  }




Measured memory_bytes: 3620