akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
	int y=0,i;
	string str;
	cin>>str;
	int n = str.length();
	for(i=0; i<n; i++){
	    
	    y = y+ (((int)(str[i]))-48);
	    y%=9;
	}
	if(y==0) cout<<"Yes";
	else cout<<"No";
	return 0;
}

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

int main() {
  vector<vector<int>> a(3, vector<int>(3));
  rep(i,3) rep(j,3) cin >> a[i][j];
  int n; cin >> n;
  rep(i,n) {
    int b; cin >> b;
    rep(j,3) rep(k,3) if (b == a[j][k]) a[j][k] = 0;
  }
  
  int f=0, s=0, t=0, ff=0, ss=0, tt=0, fff=0, sss=0;
  rep(i,3)  f += a[0][i];
  rep(i,3)  s += a[1][i];
  rep(i,3)  t += a[2][i];
  rep(i,3)  ff += a[i][0];
  rep(i,3)  ss += a[i][1];
  rep(i,3)  tt += a[i][2];
  fff = (a[0][0]+a[1][1]+a[2][2]);
  sss = (a[0][2]+a[1][1]+a[2][0]);
  
  
  if(f==0 || s==0 || t==0 || ff==0 || tt==0 || ss==0 || fff==0 || sss==0) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main(){
  sc.Scan()
  counter := 0
  for _, c := range sc.Text() {
    if c == '1' {
      counter++
    }
  }
  fmt.Print(counter)
}

Measured memory_bytes: 640
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する
struct edge {int from,to;ll cost;};
vector<edge> es; // 辺
vector<ll> d; //最短距離,0で初期化してね
int V,E;//頂点数と辺の数

bool find_negative_loop(int s){
    //dはINFで初期化しておく
    d[s] = 0;

    for(int i = 0; i < V; i++){
        for(int j = 0; j < E; j++){
            edge e = es[j];
            if(d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
            }
        }
    }

    return false;
}


int main() {
    int N,M;
    cin >> N >> M;
    V = N;
    E = M;
    rep(i,0,M){
        int a,b;
        ll c;
        cin >> a >> b >> c;
        a--;
        b--;
        c *= -1;
        edge e{a,b,c};
        es.push_back(e);
    }
    rep(i,0,N){
        d.push_back(INFl);
    }
    find_negative_loop(0);
    ll ans = d[N-1];
    find_negative_loop(0);
    if(ans != d[N-1]){
        cout << "inf" << endl;
    }else{
        cout << -ans << endl;
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
	  Scanner sc = new Scanner(System.in);
	  String s=sc.next(),t=sc.next();
	  int count=0;
	  for(int i=0;i<s.length();i++) {
		  if(!s.substring(i, i+1).equals(t.substring(i, i+1)))count++;
	  }

	  System.out.println(count);
  }
}


Measured memory_bytes: 55092
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

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

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const ll INF = 1LL<<60;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
struct State{
  int low, high;
  ll cost;
  State(int low, int high, ll cost) : low(low), high(high), cost(cost) {}
  bool operator < (const State& s) const {
    return cost > s.cost; // reversed!!!
  };
};
ll get_cost(int from, int to, int L, const vector<ll>& accumulation){
  ll sum = accumulation[to] - accumulation[from - 1];
  return sum / L;
}

int main(){
  int N, M, L;
  while(cin >> N >> M >> L && N){
    vector<int> K(N);
    vector<int> S(M);
    REP(i, N) cin >> K[i];
    REP(i, M) cin >> S[i];

    vector<ll> accumulation(M + 1);
    REP(i, M) accumulation[i + 1] = accumulation[i] + S[i];

    sort(K.begin(), K.end());
    priority_queue<State> que;
    static ll dist[2000][2000];
    REP(i, N)REP(j, N) dist[i][j] = INF;
    que.push(State(0, 1, get_cost(K[0], K[1], L, accumulation)));
    dist[0][1] = get_cost(K[0], K[1], L, accumulation);
    while(!que.empty()){
      State s = que.top(); que.pop();
      if(dist[s.low][s.high] < s.cost) continue;
      if(s.high + 1 == N){
        cout << s.cost << endl;
        break;
      }else if(s.high + 1 == N - 1){
        ll cost1 = get_cost(K[s.low], K[s.high + 1], L, accumulation);
        ll cost2 = get_cost(K[s.high], K[s.high + 1], L, accumulation);
        State next(s.high + 1, s.high + 1, s.cost + cost1 + cost2);
        if(dist[next.low][next.high] > next.cost){
          dist[next.low][next.high] = next.cost;
          que.push(next);
        }
      }else{
        State next(s.low, s.high + 1,
            s.cost + get_cost(K[s.high], K[s.high + 1], L, accumulation));
        if(dist[next.low][next.high] > next.cost){
          dist[next.low][next.high] = next.cost;
          que.push(next);
        }
        next = State(s.high, s.high + 1,
            s.cost + get_cost(K[s.low], K[s.high + 1], L, accumulation));
        if(dist[next.low][next.high] > next.cost){
          dist[next.low][next.high] = next.cost;
          que.push(next);
        }
      }
    }
  }
  return 0;
}

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

#define pu push_back
#define fi first
#define se second
#define mp make_pair
#define int long long
#define pii pair<int,int>
#define mm (s+e)/2
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(int i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define sz 200000
signed main()
{
	
		int x,y;
		cin>>x>>y;
		if(y>=2*x && y<=4*x && y%2==0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	
}

Measured memory_bytes: 3636
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        String[] dic = new String[H];
        for(int i=0;i<H;i++) dic[i]=sc.next();
        int end = -1;
        for(int i=0;i<H;i++){
            int left = 0;
            while(left<H&&dic[i].charAt(left)=='.') left++;
            if(end>left){
                System.out.println("Impossible");
                System.exit(0);
            }
            end = W-1;
            while(end>=0&&dic[i].charAt(end)=='.') end--;
        }
        System.out.println("Possible");
    }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  long long n;
  cin>>n;
  while(n>0){
    n-=1;
    s+=n%26+'a';
    n/=26;
  }
  reverse(s.begin(),s.end());
  cout<<s;
}

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

int main(){
    int n, a, b, c, x, y;
    while(cin >> n >> a >> b >> c >> x, n+a+b+c+x){
        int y[n];
        for(int i = 0; i < n; i++)  cin >> y[i];

        int step = 0, pos = 0;
        while(1){
            if(x == y[pos]) pos++;
            if(pos == n)    break;
            x = (a*x + b) % c;
            step++;
            if(step == 10001)   break;
        }

        if(pos == n && step <= 10000)    cout << step << endl;
        else                             cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 3004
#include<bits/stdc++.h>
using namespace std;
#define il inline
#define ll long long
#define outy printf("Yes\n")
#define outn printf("No\n")
#define outf printf("First\n")
#define outs printf("Second\n")
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FORD(a,b,c) for(int a=b;a>=c;a--)
#define FORL(a,b) for(int a=head[b];a;a=nxt[a])
#define in(a)  a=read()
#define in2(a,b)  in(a),in(b)
#define in3(a,b,c)  in2(a,b),in(c)
#define in4(a,b,c,d)  in2(a,b),in2(c,d)
#define out(a) printf("%d\n",a)
#define out2(a,b) printf("%d %d\n",a,b)
#define out3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out4(a,b,c,d) printf("%d %d %d %d\n",a,b,c,d)
#define outl(a) printf("%lld\n",a)
#define outl2(a,b) printf("%lld %lld\n",a,b)
#define outl3(a,b,c) printf("%lld %lld %lld\n",a,b,c)
#define outl4(a,b,c,d) printf("%lld %lld %lld %lld\n",a,b,c,d)
#define clr(x,y) memset(x,y,sizeof(x))
ll read(){
    ll f=1,x=0;char c=getchar();
    while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
    return x*f;
}
/*------------------------------------------------------------*/
#define mod 1000000007
#define maxn 100010
#define inf 0x7fffffff
/*------------------------------------------------------------*/
bool check(int x){
	FOR(i,2,sqrt(x))
		if(x%i==0)return 0;
	return 1;
}
char c[100][100];
int main(){
	int n,m;
	in2(n,m);
	int ans=0;
	FOR(i,1,n)
		FOR(j,1,m)cin>>c[i][j];
	FOR(i,1,n){
		FOR(j,1,m){
			int f=1;
			if(c[i][j]=='#'){
				if(c[i-1][j]=='#'||c[i][j-1]=='#'||c[i][j+1]=='#'||c[i+1][j]=='#')
					f=0; 
			ans|=f;
			}
		}
	}
	ans?outn:outy;
	
}


Measured memory_bytes: 256
package main

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

func main() {
	fsc := NewFastScanner()
	S := fsc.Next()
	result := 0
	for _, v := range S {
		if v == '1' {
			result++
		}
	}
	fmt.Println(result)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}

func (s *FastScanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

//Max,Min
func IntMax(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func IntMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}

//Gcd
func IntGcd(a, b int) int {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return IntGcd(b, a%b)
}
func Int64Gcd(a, b int64) int64 {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return Int64Gcd(b, a%b)
}

func IntAbs(a int) int {
	if a < 0 {
		a *= -1
	}
	return a
}

func Int64Abs(a int64) int64 {
	if a < 0 {
		a *= -1
	}
	return a
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
const int N=65;
const double eps=1e-8;
int n,k;
double x[N],y[N],c[N],r[N];
double dis(pair<double,double> a,pair<double,double> b) {
    return sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}
vector<pair<double,double> > cal(double x1,double y1,double r1,double x2,double y2,double r2) {//两圆交点
    x1-=x2,y1-=y2;
    double S=x1*x1+y1*y1,a=(S+r2*r2-r1*r1)/2,D=S*r2*r2-a*a;
    if(S==0)return {};
    if(D<0) return {};
    double A1=a*x1,B1=y1*sqrt(D);
    double A2=a*y1,B2=x1*sqrt(D);
    return {{(A1+B1)/S+x2,(A2-B2)/S+y2},{(A1-B1)/S+x2,(A2+B2)/S+y2}};
}
bool check(double t) {
    for(int i=0;i<n;i++) r[i]=t/c[i];
    vector<pair<double,double> > vec;
    for(int i=0;i<n;i++) {
    	vec.push_back({x[i],y[i]});
        for(int j=i+1;j<n;j++) {
            auto v=cal(x[i],y[i],r[i],x[j],y[j],r[j]);
            for(auto it:v) vec.push_back(it);
        }
    }
    for(auto it:vec) {
        int cnt=0;
        for(int i=0;i<n;i++) {
            if(r[i]+eps>=dis(it,{x[i],y[i]})) cnt++;
        }
        if(cnt>=k) return true;
    }
    return false;
}
int main() {
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++) {
        scanf("%lf%lf%lf",&x[i],&y[i],&c[i]);
    }
    double L=0,R=1000010;
    for(int i=0;i<100;i++) {
        double mid=(L+R)/2;
        if(check(mid)) R=mid;
        else L=mid;
    }
    printf("%.6lf\n",R);
    return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	parseProblem(os.Stdin)
}

func parseProblem(r io.Reader) {
	const (
		initialBufSize = 100000
		maxBufSize     = 1000000
	)
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	k, a, b := scanInt(sc), scanInt(sc), scanInt(sc)
	for i := a; i <= b; i++ {
		if i%k == 0 {
			fmt.Println("OK")
			return
		}
	}
	fmt.Println("NG")
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


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

#define endl "\n"
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first 
#define ss second 
#define pii pair<int,int>
#define vi vector<int>
#define vc vector<char>
#define vii vector<pii>
#define vvi vector<vi>
#define fori(i,n) for(int i=1;i<=n;++i)
#define forn(i,n) for(int i=0;i<n;++i)
#define sz(x) int(x.size())
#define error(x) cout<<#x<<" "<<x<<endl
#define IOS  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const int N=100*1000;
const int mod=1e9+7;

int min3(int a,int b,int c){return min(a,min(b,c));}
int max3(int a,int b,int c){return max(a,max(b,c));}
int min4(int a,int b,int c,int d){return min(min(a,b),min(c,d));}
int max4(int a,int b,int c,int d){return max(max(a,b),max(c,d));}

//#define int int64_t
int a[N+2];

int32_t  main(){
	IOS;
  int n;cin>>n;  
  fori(i,n){cin>>a[i];}
  int ans=0;
  fori(i,n){
    bool flag=true;
    for(int j=1;j<i;++j){
      if(a[j]>a[i]){flag=false;break;}
    }
    if(flag)ans++;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

int Linearsearch(int *,int,int);

int main(){
  int i,j=0,n,q;
  int S[10000+1],T[10000+1];

  scanf("%d",&n);

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

  scanf("%d",&q);

  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }

for(i=0;i<q;i++){
if(Linearsearch(S,n,T[i])==1)j++;
}

printf("%d\n",j );
}

int Linearsearch(int S[],int n,int key){
  int i;

  for(i=0;i<n;i++){
    if(S[i] == key)return 1;
  }
  return 0;
}



Measured memory_bytes: 2128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
using ll = long long;
const ll MOD = 1000000007;//998244353;
int main() {
   ios::sync_with_stdio(false);
   cin.tie(0);
   ll x; cin >> x;
   ll money = 100;
   ll year = 0;
   while (money < x){
      year++;
      money += money/100;
   }
   cout << year << endl;
}

Measured memory_bytes: 3472
#include <cstdio>
using namespace std;
int a[100008];
int fastin(){
	register int i; register char ch;
	while (ch = getchar(), ch < '0' || ch > '9');
	i = ch - '0';
	while (ch = getchar(), ch >= '0' && ch <= '9') i = i * 10 + ch - '0';
	return i;
}
int main(){
	register long long l, r;
	register int k, i;
	k = fastin();
	for (i = 1; i <= k; ++i) a[i] = fastin();
	l = r = 2;
	for (i = k; i; --i) {
		l = (l + a[i] - 1) / a[i] * a[i];
		r = r / a[i] * a[i] + a[i] - 1;
		if (l > r) break;
	}
	if (i) puts("-1");
	else printf("%lld %lld", l, r);
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <math.h>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
static const ll MAX_L = (ll)1 << 62;

int main() {
	ll n; cin >> n;
	ll sum = 0;
	rep(i, 0, n) {
		ll  a; cin >> a;
		sum += (a - 1);
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int cas;
  scanf("%d", &cas);
  int ret = 0;
  while (cas--) {
    int n, m;
    scanf("%d%d", &n, &m);
    int cur = 0;
    if (n % m == 0) {
      cur = n / m;
    } else {
      n -= n / m;
      // trace("s", n);
      while (n % m != 1) {
        // trace(n);
        if (n < m) {
          n = 1;
          break;
        }
        int delta = (n + m - 1) / m;
        int k = (n - (delta * m - m + 1)) / delta;
        k = max(1, k);
        n -= delta * k;
      }
      cur = n / m;
    }
    // trace(cur);
    ret ^= cur;
  }
  puts(ret ? "Takahashi" : "Aoki");
  return 0;
}


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

int main()
{
	long long N;
	cin >> N;
	long long a[5];

	for (int i = 0; i < 5; i++) {
		cin >> a[i];
	}

	long long min = a[0];

	for (int i = 1; i < 5; i++) {
		if (a[i] < min) min = a[i];
	}

	if(N % min == 0) cout << N / min + 4 << endl;
    else cout << N / min + 5 << endl; 
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (h, w) = readLine()!!.split(' ').map(String::toInt)
    val rows = (1..h).map { '#' + readLine()!! + '#' }
    val headerFooter = CharArray(w + 2) { '#' }.joinToString("")
    println(headerFooter)
    rows.forEach(::println)
    println(headerFooter)
}


Measured memory_bytes: 38036
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Data.Function (on)

getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

div'::Int->Int->Double
div' = (/) `on` fromIntegral

main = do
  [n,k] <- getInts
  an <- getInts
  let minVal = minimum an
  let minCount = length $ filter (== minVal) an
  print $ ceiling $ div' (n-minCount) (k-1)

Measured memory_bytes: 9852
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

int main()
{
	int k, a, b;
	cin >> k >> a >> b;
	for (int i = a; i <= b; i++) {
		if (i % k == 0) {
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
}


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

typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int,V,greater<int>>

#define pb(a) push_back(a)
#define mp make_pair

#define dump(x)  cout << #x << " = " << (x) << "\n";
#define COUT(x) cout<<(x)<<"\n"

int func(int x)
{
    if (x % 2 == 0)
    {
        return x / 2;
    }
    else
    {
        return 3 * x + 1;
    }
}

int main()
{
    int a = 0;
    cin >> a;
    set<int> sets;
    int buf = a;
    sets.insert(a);
    int ct = 1;
    while (1)
    {
        buf = func(buf);
        if (sets.count(buf) == 1)
        {
            COUT(ct + 1);
            return 0;
        }
        sets.insert(buf);
        ct++;
    }

    return 0;
}

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

int main(){
    int W, H, x, y, r;
    cin >> W >> H >> x >> y >> r;

    bool can=true;
    if(x-r<0 || x+r>W) can = false;
    else if(y-r<0 || y+r>H) can = false;

    if(can) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 3116
import sys

x = sys.stdin.readline()
x = x.split(' ')
(k,n)=[int(str) for str in x]

x = sys.stdin.readline()
x = x.split(' ')
a=[int(str) for str in x]

prev = 0
amax = 0
sa = 0
for i in range(0,n):
  if(i == 0):
    prev = a[i]
  else:
    among = a[i] - prev
    if( amax < among):
      amax = among
    prev = a[i]
    sa += among

last = a[0] + k - a[n-1]
if( amax < last):
  amax = last
sa += last

print(sa-amax)

sys.stdout.flush()


Measured memory_bytes: 24908
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1e9+7;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define pb push_back

typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef set<int> si;
typedef set<vi> svi;


int main(){
    int N;
    cin>>N;
    string s;
    cin>>s;
    int q;
    cin>>q;
    si st[26];
    F0R(i,26){
        st[i].clear();
        st[i].insert(N);
    }
    F0R(i,N){
        st[s[i]-'a'].insert(i);
    }
    F0R(i,q){
        int a;
        cin>>a;
        if(a==1){
           int b;
           char c;
           cin>>b>>c;
           st[s[b-1]-'a'].erase(b-1);
           s[b-1]=c;
           st[s[b-1]-'a'].insert(b-1);
        }else{
            int b,c;
            cin>>b>>c;
            int ans=0;
            F0R(j,26){
                auto it=st[j].lower_bound(b-1);
                if(*it<=c-1){
                    ans++;
                }
            }
            cout<<ans<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 24196
using System;
using System.Linq;

namespace ITP1_7_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var y = Convert.ToInt32(input[0]);
            var x = Convert.ToInt32(input[1]);

            int[][] table = new int[y + 1][]; 
            for(int i = 0; i < y ; i++)
            {
                var line = Console.ReadLine().Split(' ').Select(s => Convert.ToInt32(s)).ToList();
                line.Add(line.Sum());
                table[i] = line.ToArray();
            }

            table[y] = new int[x + 1];

            for (int i = 0; i < x + 1; i++)
            {
                for (int j = 0; j < y; j++)
                {
                    table[y][i] += table[j][i];
                }
            }
            foreach(var line in table)
            {
                Console.WriteLine(string.Join(" ", line.Select(i => i.ToString()).ToArray()));
            }
        }
    }
}

Measured memory_bytes: 10060
#include <bits/stdc++.h>
using namespace std;
char a[100005],b[100005];
int main(){
  cin>>a;
  int j=0;
  for(int i=0;i<strlen(a);i=i+2){
    b[j++]=a[i];
  }
  cout<<b<<endl;
  return 0;
}


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

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define all(x) (x).begin(),(x).end()

#define in(type,a) type a;cin >> a

using ll = long long;

int main() {
    in(int, a);
    in(int, b);
    if((a+b)%2 == 1){
        cout << "IMPOSSIBLE" << endl;
    }else{
        cout << (a+b)/2 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import sys
import math
N=[]
for l in sys.stdin:
  a=list(map(int,l.split(",")))
  N.append(a)
  
x=0
y=0
n=90

for d in N:
  if d[0]==0 and d[1]==0:
    break
  x=x+d[0]*math.cos(math.radians(n))
  y=y+d[0]*math.sin(math.radians(n))
  #print(x,y)
  n-=d[1]

print(int(x), int(y), sep="\n")



Measured memory_bytes: 5728
#include<iostream>
using namespace std;
double dp[305][305][305];
int n,a[305];
double rec(int a,int b,int c){
	if(a<0||b<0||c<0)return 0.0;
	if(!a&&!b&&!c)return 0;
	if(dp[a][b][c])return dp[a][b][c];
	double p1,p2,p3,p4;
	double nn=a+b+c;
	p1=double(a)/double(nn);
	p2=double(b)/double(nn);
	p3=double(c)/double(nn);
	p4=1-p1-p2-p3;
	double a1,a2,a3,a4;
	a1=rec(a-1,b,c);
	a2=rec(a+1,b-1,c);
	a3=rec(a,b+1,c-1);
  	dp[a][b][c]=(p1*a1+p2*a2+p3*a3);
	dp[a][b][c]+=double(n)/double(a+b+c);
	return dp[a][b][c];
}
int main()
{
	cin>>n;
	int f[3];
	f[0]=f[1]=f[2]=0;
	for(int i=0;i<n;i++){cin>>a[i];f[a[i]-1]++;}
	printf("%0.12lf",rec(f[0],f[1],f[2]));
}


Measured memory_bytes: 219392
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class Pair {
	int first;
	int second;

	Pair(int first, int second) {
		this.first = first;
		this.second = second;
	}
}

class TaskB {

	public void solve(int testNumber, InputReader in, PrintWriter pw) {
		int N = in.nextInt();
		int K = in.nextInt();
		int arr[] = new int[N];
		for (int i = 0; i < N; i++) {
			arr[i] = in.nextInt();
		}
		int st = K - 1;
		int ans = -1;
		int index = -1;
		for (int i = 0; i < N; i += st) {
			ans++;
			index = i;
		}
		ans = index != N - 1 ? ans + 1 : ans;
		pw.println(ans);
	}

	int __gcd(int a, int b) {
		if (b == 0)
			return a;
		return __gcd(b, a % b);

	}

	public int getInt(int num) {
		int ret = -1;
		switch (num) {
		case 0:
			ret = 6;
			break;
		case 1:
			ret = 2;
			break;
		case 2:
			ret = 5;
			break;
		case 3:
			ret = 5;
			break;
		case 4:
			ret = 4;
			break;
		case 5:
			ret = 5;
			break;
		case 6:
			ret = 6;
			break;
		case 7:
			ret = 3;
			break;
		case 8:
			ret = 7;
			break;
		case 9:
			ret = 6;
			break;
		}
		return ret;
	}

	public int isPow(long num) {
		int count = 0;
		while (num > 0) {
			num /= 2;
			count++;
		}
		return count;
	}
}

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

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

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

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

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


Measured memory_bytes: 33724
N,M = map(int,input().split())
cntNode = [0]*N
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    cntNode[a] += 1
    cntNode[b] += 1

flag = True
for i in range(N):
    if(cntNode[i] % 2 != 0):
        flag = False
        break
if(flag):
    print('YES')
else:
    print('NO')

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

using namespace std;

#define FOR(i,a,b)  for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n)    FOR(i,0,n)
#define ALL(a)      a.begin(),a.end()
#define vi          vector<int>
#define vvi         vector<vi>
#define P           pair<int,int>
#define vP          vector<P>
#define vvP         vector<vP>

int main(){
    int n;cin>>n;
    long long res=1;
    FOR(i,1,n+1){
        res=res*i%1000000007;
    }
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair


int N, R;

void solve()
{
	if(N >=10) cout << R << '\n';
	else{
		cout << R + 100*(10-N) << '\n';
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> N >> R;
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include<math.h>
int main()
{
	int A, B, C;
	while (scanf("%d %d %d",&A,&B,&C)!=EOF)
	{
		int a, b, c;
		a = fabs(A - B) + fabs(B - C);
		b = fabs(A - C) + fabs(B - C);
		c = fabs(A - B) + fabs(A - C);
		if (a < b)
		{
			if (a < c)
				printf("%d\n", a);
			else
				printf("%d\n", c);
		}
		else
		{
			if (b < c)
				printf("%d\n", b);
			else
				printf("%d\n", c);
		}
	}
	return 0;
}

Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <math.h>
#include <time.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <list>
using namespace std;
typedef long long ll;
int main() {
	int n, k, mn = 1e6, idx;
	cin >> n >> k;
	for (int i = 0; i < n; ++i) {
		int x;
		cin >> x;
		if (x < mn) {
			mn = x;
			idx = i;
		}
	}
	--k;
	int minAns = 1e6;
	for (int i = 0; i <= idx && i <= k; ++i) {
		int bfr = idx - i;
		int afr = n - min(n - 1, bfr + k) - 1;
		int tmp = 1 + (bfr + k - 1) / k + (afr + k - 1) / k;
		minAns = min(minAns, tmp);
	}
	cout << minAns << endl;
	return 0;
}

Measured memory_bytes: 256
'use strict'

const main = (input) => {
    input = input.split('\n')
    const a = input[0]
    const b = input[1]
    if(a === b.split('').reverse().join('')){
        console.log('YES')
    }else{
        console.log('NO')
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

Measured memory_bytes: 9420
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <climits>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <map>
#include <tuple>
#include <iostream>
#include <deque>
#include <array>
#include <set>
#include <functional>
#include <memory>
#include <stack>
#include <numeric>
#include <climits>
#include <cfloat>

int main() {
	int n; std::cin >> n;
	std::vector<int> heights(n); for (auto& h : heights) std::cin >> h;
	auto can_change = true;
	for (auto i = n - 1; i > 0 && can_change; --i) {
		if (heights[i] < heights[i - 1]) {
			heights[i - 1]--;
		}
		if (heights[i] < heights[i - 1]) {
			can_change = false;
		}
	}
	if (can_change) std::cout << "Yes\n";
	else std::cout << "No\n";
}

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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "YES" : "NO") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

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

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

  // CIN(a, b, c);
  int a, b, c;
  cin >> a >> b >> c;

  bool ok = false;
  REP(xi, MAX_N) {
    if ((a * xi - c) % b == 0) ok = true;
  }

  OK(ok);

  return 0;
}



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

int f(int x) {
    if (x%2 == 0) {
        return x/2;
    }
    return 3*x + 1;
}

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

    set<int> S;
    rep(i,1000000) {
        if (S.find(n) != S.end()) {
            cout << i+1 << endl;
            return 0;
        }
        S.insert(n);
        n = f(n);
    }
    return 0;
}


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

int main() {
	int N;
	cin >> N;
	rep(i, N) {
		cout << "ACL";
	}
	cout << '\n';
}


Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <numeric>
#include <regex>
#include <climits>

#define FOR(i, f, n) for(int (i) = (f), TMPend = (n); (i) < TMPend; (i)++)
#define RFOR(i, f, n) for(int (i) = (f), TMPend = (n); (i) >= TMPend; (i)--)
#define REP(i, n) for(int (i) = 0, TMPend = (n); (i) < TMPend; (i)++)
#define RREP(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define rep(i, n) for(int (i) = 0, TMPend = (n); (i) < TMPend; (i)++)
#define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define forin(i, a) for(auto i: (a))
#define p(...) printf(__VA_ARGS__); cout << endl;
#define in(...) __VA_ARGS__; input__(__VA_ARGS__);
#define input(...) in(__VA_ARGS__)
#define out(...) output__(__VA_ARGS__);
#define output(...) out(__VA_ARGS__)
#define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i];
#define lambda(a, b, c) [](auto const &a, auto const &b){ return c ;}
#define key(t, x, compare) [](const t &a, const t &b){ return a x compare b x ;}
#define unless(a) if(!(a))

using namespace std;

using pii = pair<int, int>;

template <class... T>
void input__(T &...a) {
  for(auto v: {&a...}) {
    cin >> *v;
  }
}

void output__(){
  cout << endl;
}

template <class Head, class... T>
void output__(Head const &v, T const &...a) {
  if(sizeof...(a) == 0) {
    cout << v;
  } else {
    cout << v << " ";
  }
  output__(a...);
}

int a[300];
bool take[301][301];
bool check[301][301];
int dp[301][301];

bool take_dfs(int i, int j) {
  if (i == j) return false;
  if (check[i][j]) {
    return take[i][j];
  }
  bool isok;
  if (j - i <= 1) {
    isok = abs(a[i] - a[j]) <= 1;
    take[i][j] = isok;
    if (isok) dp[i][j] = j - i + 1;
    check[i][j] = true;
    return isok;
  }

  isok = abs(a[i] - a[j]) <= 1 && take_dfs(i + 1, j - 1);
  FOR(k, i + 1, j) {
    if (isok) break;
    isok = take_dfs(i, k) && take_dfs(k + 1, j);
  }

  take[i][j] = isok;
  if (isok) dp[i][j] = j - i + 1;
  check[i][j] = true;
  return isok;
}

bool f(){
  int input(n);
  if (n == 0) return true;
  memset(a, 0, sizeof(a));
  memset(take, 0, sizeof(take));
  memset(check, 0, sizeof(check));
  memset(dp, 0, sizeof(dp));

  rep(i, n) cin >> a[i];
  rep(i, n - 1) take_dfs(i, n - 1);
  /* rep(left, n - 1) rep(right, n - 1) { */
  /*   , */
  /* } */

  rep(w, n) rep(i, n - w) FOR(k, i, i + w) {
    dp[i][i + w] = max(dp[i][i + w], dp[i][k] + dp[k + 1][i + w]);
  }
  cout << dp[0][n - 1] << endl;

  /* rep(i, n + 1) { */
  /*   rep(j, n + 1) { */
  /*     cout << take[i][j] << " "; */
  /*   } */
  /*   cout << endl; */
  /* } */
  return false;
}

int main() {
  while(1) {
    if(f()) break;
  }
}



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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;
int mod = 1000000000+7;

int main(){

	char c;
	cin>>c;
	if(60<=c && c<=90)cout<<"A";
	else cout<<"a";
	cout<<endl;

	return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int>cards(N);
  for(int i=0;i<N;i++){
  cin >> cards.at(i);
  }
  sort(cards.begin(),cards.end());
  reverse(cards.begin(),cards.end());
  int A = 0;
  int B = 0;
  if(N == N / 2 * 2){
  for(int i=0;i<N;i += 2){
  A = A + cards.at(i);
  B = B + cards.at(i+1);
  }
  }
  else{
  for(int i=0;i<N-1;i+=2){
  A += cards.at(i);
  B += cards.at(i+1);
  }
  A += cards.at(N-1);
  }
  cout << A - B << endl;
}

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

int main() {

    int x, a, b;
    scanf("%d %d %d", &x, &a, &b);

    int xa=abs(x-a);
    int xb=abs(x-b);
    
    puts(xa< xb ? "A" : "B");


    return 0;

}


Measured memory_bytes: 128
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
inline long long read()
{
	long long s=0,f=1,ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	ch=='-' ? f=-1:s=ch-'0',ch=getchar();
	while(isdigit(ch)) s=s*10+ch-'0',ch=getchar();
	return f*s;
	
} 
long long a,b,c;
long long k;
int main()
{
	a=read();b=read();c=read();k=read();
	long long x,y,z;
	k%=2;
	if(k==0) printf("%lld\n",a-b);
	else printf("%lld\n",b-a);
	
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{
    int n, k, i;
    scanf("%d %d", &n, &k);
    char s[n], c;

    scanf("%s", s);

    for (i = 0; i < n; i++) {
         if (i + 1 == k) {
            s[i] += 32;
        }
    }

    printf("%s", s);

    return 0;
}


Measured memory_bytes: 128
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

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

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

const INF: i64 = 1 << 60;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: usize = sc.get();
    let mut p = vec![vec![0; N]; 2];
    for i in 0..N {
        let x: i64 = sc.get();
        let y: i64 = sc.get();
        p[0][i] = x - y;
        p[1][i] = x + y;
    }
    let mut ans = -INF;
    for d in 0..2 {
        let mut mx = -INF;
        let mut mn = INF;
        for i in 0..N {
            mx = max(mx, p[d][i]);
            mn = min(mn, p[d][i]);
        }
        ans = max(ans, mx - mn);
    }
    println!("{}", ans);
}


Measured memory_bytes: 5184
<?php
fscanf(STDIN, "%d %d", $a, $b);
function gcd($m, $n) {
while ($m % $n != 0) {
$temp = $n;
$n = $m % $n;
$m = $temp;
}
return $n;
}
echo $a * $b / gcd($a, $b);

Measured memory_bytes: 3700
#include <stdio.h>
#include <string.h>

int ispalin(char * s,int len)
{  
  if(len < 2)
    return(-1);
  else if(len ==2)
    return(s[0]==s[1]?(-1):0);
  else if(s[0]==s[len-1] )
    return(ispalin(s+1,len-2));
  else
    return(0);
}



main()
{
  char s[101];
  int  cnt=0;
  
  while(EOF != scanf("%s",s))
    {
      if(ispalin(s,strlen(s)))
        {
          cnt++;
          /*printf("palin\n");*/
        }
    }
  printf("%d\n",cnt);

return(0);
}
 



Measured memory_bytes: 2024
import sys
N, W = sys.stdin.readline().split()
aArr = list()
ans = 0
tmp = int(N)
MOD = 10 ** 9 + 7
aArr = set(map(int, sys.stdin))

tmp = 0
tmpB = 0
ans = 1
for i in range(int(N)):
    if (i in aArr):
        tmp = 0
    elif i < 2:
        tmp = 1
    else:
        tmp = ans
    ans = (tmp + tmpB) % MOD
    tmpB = tmp
print(ans)

Measured memory_bytes: 11884
#include<iostream>

using namespace std;

int main(){

    int N,T;
    int c,t;
    int first=0;
    int menor;

    cin >>N>>T;

    while(N--){
        cin>>c>>t;
        if(first==0&&t<=T){
            first=1;
            menor = c;
        }
        else if(first==1){
            if(c<menor&&t<=T)menor=c;
        }
    }
    if(first)
    cout<<menor<<endl;
    else cout<<"TLE"<<endl;

    return 0;
}

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())
#define IN(x, a, b) x >= a and x < b

using namespace std;
using ll = long long;

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;
}
template <typename T> constexpr T INF = numeric_limits<T>::max() / 2;

vector<bool> prime_table(ll n) {
  vector<bool> is_prime(n + 1, true);
  is_prime.at(0) = false;
  is_prime.at(1) = false;
  for (ll i = 2; i * i <= n; i++) {
    if (is_prime.at(i)) {
      for (ll j = i + i; j <= n; j += i) {
        is_prime.at(j) = false;
      }
    }
  }
  return is_prime;
}

ll gcd(ll a, ll b) {
  ll t = 0;
  while (b != 0) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n)
        ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

bool is_prime(ll x) {
  for (ll i = 2; i * i <= x; i++) {
    if (x % i == 0)
      return false;
  }
  return true;
}

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

  ll a, b;
  cin >> a >> b;
  ll g = gcd(a, b);
  auto d = divisor(g);
  // auto p = prime_table(d.at(SZ(d) - 1) + 1);
  int ans = 0;
  REP(i, SZ(d)) {
    // if (p.at(d.at(i))) {
    //   ans++;
    // }
    if (is_prime(d.at(i))) {
      ans++;
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 384
// J'aime
// Chemise Blanche

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr << __LINE__ << " > " << #x << " = " << (x) << endl

void MAIN() {
  string s, t;
  cin >> s >> t;
  cout << t << s << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3576
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var n = int.Parse(s);
            var s2 = Console.ReadLine().Split(' ');
            int savedh = 0;
            bool cancomplete = true;
            for (int i = 0; i < n; i++)
            {
                var h = int.Parse(s2[i]);
                if (h > savedh)
                {
                    savedh = h - 1;
                }
                else if (h == savedh)
                {
                    savedh = h;
                }
                else
                {
                    cancomplete = false;
                    break;
                }
            }
            if (cancomplete)
            {
                Console.WriteLine("Yes");
            }
            else
            {

                Console.WriteLine("No");
            }

#if DEBUG
            Console.ReadKey();
#endif
        }
    }
}


Measured memory_bytes: 26336
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

int main() {
    ll A;
    cin >> A;
    ll Ba, Bb;
    scanf("%lld.%lld", &Ba, &Bb);
    cout << A * (Ba * 100LL + Bb) / 100LL << endl;
}


Measured memory_bytes: 3780