akhauriyash/Code-Regression huggingface dataset:
n, k = map(int, input().split())
s = input()
pre = s[0]
ans = s[0]
first = s[0]

if s[0] == "R":
    second = "L"
else:
    second = "R"

for i in s[1:]:
    if i == second and k > 0:
        ans = ans + first
        pre = i
    elif i == first and pre == second:
        k -= 1
        ans = ans + i
        pre = i
    elif k == 0:
        ans = ans + i
    elif i == first and pre == first:
        ans = ans + i

pre = "0"
cnt = 0

for i in ans:
    if i == pre:
        cnt += 1
    pre = i

print(cnt)

Measured memory_bytes: 9360
n=int(input())
h=list(map(int, input().split()))

max_count=0

i=0
j=1
while(i<=n-1 and j<=n-1):
    count=0
    while(h[i]>=h[j] and j<n):
        count+=1
        if j<n-1:
            i+=1
            j+=1
        else:
            break
    max_count=max(count, max_count)

    i=j
    j=i+1

print(max_count)

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

using namespace std;

typedef long long ll;

const int N_MAX = 200002;

int n, k;

int a[N_MAX];
int d[N_MAX];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> k >> n;
    int mx = 0;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    d[1] = a[1] + k - a[n];
    for(int i = 2; i <= n; i++)
        d[i] = a[i] - a[i - 1];
    for(int i = 1; i <= n; i++)
        mx = max(mx, d[i]);
    cout << k - mx << "\n";
    return 0;
}


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

using namespace std;

typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<llint, llint> pll;
typedef vector<int> vi;
typedef vector<llint> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define ci cin
#define co cout
#define en endl
#define ln cout<< '\n'
#define rep(i, n) for(int i = 0; i < n; i++)
#define outl(x) cout<< (x) << '\n'
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007

template<typename Tn> Tn gcd(Tn a, Tn b)
{
    return (b ? gcd(b, a % b) : a);
}

template<typename Tn> Tn lcm(Tn a, Tn b)
{
    return a / gcd(a, b) * b;
}

string IntToString(int number)
{
    stringstream ss;
    ss << number;
    return ss.str();
}

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

int main()
{
    char c;
    ci >> c;

    if(c == 'A') co << 'T' << en;
    if(c == 'T') co << 'A' << en;
    if(c == 'C') co << 'G' << en;
    if(c == 'G') co << 'C' << en;
  
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define gc getchar
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x1 uvuvwevwevwe
#define y1 onyetenyevwe
#define x2 ugwemubwem
#define y2 ossas
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
template <typename T> void scan(T &angka){
	angka=0;char input=gc();T kali=1;
	while(!(48<=input&&input<=57)){	if(input=='-')	kali=-1;input=gc();}
	while(48<=input&&input<=57)	angka=(angka<<3)+(angka<<1)+input-48,input=gc();angka*=kali;
}
template <typename T1,typename T2> void scan(T1 &angka1,T2 &angka2){
	scan(angka1);scan(angka2);
}
struct trio{
	int fi,se,th;
	trio(){
	}
	trio(int _fi,int _se,int _th){
		fi=_fi;
		se=_se;
		th=_th;
	}
};
int n,ans=0,tambahan;
vector <trio> edgelist;
vector <int> bits;
int main()
{
	cin>>n;
	for(int i=0;i<20;i++)
	{
		if(n&(1<<i))
			bits.pb(i);
	}
	int panjang=bits.back();
	ans=panjang+1;
	for(int i=1;i<=panjang;i++)
	{
		edgelist.eb(i,i+1,0);
		edgelist.eb(i,i+1,(1<<(panjang-i)));
	}
	tambahan=(1<<panjang);
	
	bits.pop_back();
	reverse(all(bits));
	for(auto isi:bits){
		edgelist.eb(1,ans-isi,tambahan);
		tambahan+=(1<<isi);
	}
	
	cout<<ans<<" ";
	cout<<edgelist.size()<<endl;
	for(int i=0;i<edgelist.size();i++)
		cout<<edgelist[i].fi<<" "<<edgelist[i].se<<" "<<edgelist[i].th<<endl;
	//cout<<(1LL<<59)<<endl;
	//cout<<(1LL<<60)<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 200050
#define M 200
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(),v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
#define MOD mod
using namespace std;
int n,k,ar[N],pr[N];
signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
   cin>>n>>k;
   for(int i=0;i<n;i++){
       cin>>ar[i];
   }
   for(int i=0;i<k;i++){
       int fl = 0;
       for(int i=0;i<n;i++){
           if(ar[i]!=n)fl = 1;
       }
       if(!fl)break;
       memset(pr,0,sizeof(pr));
       for(int i=0;i<n;i++){
           int l = max(0ll,i-ar[i]);
           int r = min(n+1,ar[i]+i+1);
           pr[l]++;
           pr[r]--;
       }
       ar[0] = pr[0];
       for(int i=1;i<n;i++){
           pr[i]+= pr[i-1];
           ar[i] = pr[i];
       }
   }
   for(int i=0;i<n;i++)
    cout<<ar[i]<<" ";
  	return 0;
}



Measured memory_bytes: 6664
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'

typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL<<60;

int main(){
    int n;cin >> n;
    set<string> s;
    rep(i,n){
        string k;cin >> k;
        s.insert(k);
    }
    cout << s.size() << endl;
    return 0;
}

Measured memory_bytes: 19252
n, k = map(int, input().split())
s = list(input())

ls = []
c = s[0]
l = 0
for i in range(1, n):
    if s[i] == c:
        l += 1
    else:
        ls.append(l)
        c = s[i]
        l = 0
ls.append(l)
ans = sum(ls)
m = len(ls)
for i in range(k):
    if m == 1:
        break
    elif 3 <= m:
        ans += 2
        m -= 2
    else:
        ans += 1
        m -= 1
print(ans)

Measured memory_bytes: 49520
#include <stdio.h>
#include <string.h>
#define rep(i, n) for(int i = 0; i < n; ++i)

class dice {
  private:
    int f[6];
  public:
    dice(int *a){
      int i;
      rep(i, 6) f[i] = a[i];
    }
    void n(){
      int t;
      t = f[0];
      f[0] = f[1];
      f[1] = f[5];
      f[5] = f[4];
      f[4] = t;
    }
    void s() {
      int t;
      t = f[0];
      f[0] = f[4];
      f[4] = f[5];
      f[5] = f[1];
      f[1] = t;
    }
    void w() {
      int t;
      t = f[0];
      f[0] = f[2];
      f[2] = f[5];
      f[5] = f[3];
      f[3] = t;
    }
    void e() {
      int t;
      t = f[0];
      f[0] = f[3];
      f[3] = f[5];
      f[5] = f[2];
      f[2] = t;
    }
    int print(int num) {
      return f[num];
    }
};

int main(void) {
  int a[6], i, q, j;
  char s[150];
  rep(i, 6) scanf("%d", &a[i]);
  dice d(a);
  scanf("%d", &q);
  for(i = 0; i < q; ++i) {
    int t, s;
    scanf("%d%d", &t, &s);
    if(d.print(1) == t) d.n();
    else if(d.print(2) == t) d.w();
    else if(d.print(3) == t) d.e();
    else if(d.print(4) == t) d.s();
    else if(d.print(5) == t) d.n(), d.n();
    if(d.print(1) == s) printf("%d\n", d.print(2));
    else if(d.print(2) == s) printf("%d\n", d.print(4));
    else if(d.print(3) == s) printf("%d\n", d.print(1));
    else if(d.print(4) == s) printf("%d\n", d.print(3));
  }
  return 0;
}


Measured memory_bytes: 2692
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    string a, b, c;
    int d = 0, e = 0, f = 0, g = 0;
    cin >> a >> b >> c;
    while (1) {
        if (g == 0) {
            if (d == (int)a.size()) {
                cout << 'A';
                return 0;
            }
            g = a[d] - 'a';
            d++;
        } else if (g == 1) {
            if (e == (int)b.size()) {
                cout << 'B';
                return 0;
            }
            g = b[e] - 'a';
            e++;
        } else {
            if (f == (int)c.size()) {
                cout << 'C';
                return 0;
            }
            g = c[f] - 'a';
            f++;
        }
    }
}


Measured memory_bytes: 256
import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;

class MathLib{
    static long gcd(long a, long b){
        if(a<0) a = -a;
        if(b<0) b = -b;
        if(a>b){
            long t = a;
            a = b;
            b = t;
        }
        while(a>0){
            long r = b%a;
            b = a;
            a = r;            
        }
        return b;
    }
    
    static boolean isPrime(long N){
        if(N%2==0) return false;
        for(long i=3; i*i<=N; i+=2){
            if(N%i==0) return false;
        }
        return true;
    }
    static Counter<Long> factorize(long N){
        Counter<Long> ans = new Counter<>();
        while(N%2==0){
            ans.addOne(2L);
            N /= 2;
        }
        for(long i=3; i*i<=N; i+=2){
            while(N%i==0){
                ans.addOne(i);
                N /= i;
            }
        }
        if(N>1) ans.addOne(N);
        return ans;
    }
    static List<Integer> primeList(int max){
        boolean[] prime = new boolean[max+1];
        Arrays.fill(prime, true); prime[0]=false; prime[1]=false;
        ArrayList<Integer> list = new ArrayList<>();
        for(int n=2; n<=max; n++) if(prime[n]){
            list.add(n);
            if(n*n<=max) for(int m=2*n; m<=max; m+=n) prime[m]=false;
        }
        return list;
    }
}
class Counter<T> extends TreeMap<T,Long>{
    public Counter(){
        super();
    }
    public Counter(List<T> list){
        super();
        for(T e: list) this.addOne(e);
    }
    public Long count(Object elm){
        return getOrDefault(elm,0L);
    }
    public void add(T elm, long amount){
        if(!this.containsKey(elm)) put(elm, amount);
        else replace(elm, get(elm)+amount);
        if(this.count(elm)==0) this.remove(elm);
    }
    public void addOne(T elm){
        this.add(elm, 1);
    }
    public void removeOne(T elm){
        this.add(elm, -1);
    }
    public void removeAll(T elm){
        this.add(elm, this.count(elm));
    }
    public static<T> Counter<T> merge(Counter<T> a, Counter<T> b){
        Counter<T> c = new Counter<>();
        for(T x: a.keySet()) c.add(x, a.count(x));
        for(T y: b.keySet()) c.add(y, b.count(y));
        return c;
    }
}

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        Counter<Long> factorize = MathLib.factorize(N);
        long ans = 0;
        for(long d: factorize.keySet()){
            long k = factorize.count(d);
            for(int i=1;;i++){
                if(k<i) break;
                k -= i;
                ans++;                
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 35868
#import math
#import itertools
import numpy as np
#from collections import deque
# sys.setrecursionlimit(10 ** 6)
#MOD = 10 ** 9 + 7
#INF = 10 ** 9
#PI = 3.14159265358979323846

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    h,w=INTM()
    ban=np.zeros((h,w),dtype=np.int16)
    for i in range(h):
        s=STR()
        for i1 in range(len(s)):
            if s[i1]==".":
                ban[i][i1]=1

    left =np.zeros((h,w),dtype=np.int16)
    right=np.zeros((h,w),dtype=np.int16)
    up   =np.zeros((h,w),dtype=np.int16)
    down =np.zeros((h,w),dtype=np.int16)
    #print(up)
    for i in range(w):
        i2=w-1-i
        if i==0:
            left[:,i]=ban[:,i]
            right[:,i2]=ban[:,i2]
        else:
            left[:,i]=ban[:,i]*(left[:,i-1]+1)
            right[:,i2]=ban[:,i2]*(right[:,i2+1]+1)
    
    for i in range(h):
        i2=h-1-i
        if i==0:
            up[i,:]=ban[i,:]
            down[i2,:]=ban[i2,:]
        else:
            up[i,:]=ban[i,:]*(up[i-1,:]+1)
            down[i2,:]=ban[i2,:]*(down[i2+1,:]+1)
    

    anslist=down+up+right+left
    ans=0
    for i in anslist:
        ans=max(ans,max(i))
    print(ans-3)


if __name__=='__main__':
    do()

Measured memory_bytes: 73924
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.next());
        int m = Integer.parseInt(scanner.next());
        int[] a = new int[n];
        int sum = 0;
        int ai;
        for (int i = 0; i < n; i++) {
            ai = Integer.parseInt(scanner.next());
            sum += ai;
            a[i] = ai;
        }
        Arrays.sort(a);
        if ((4*m)*a[n-m] < sum) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
}

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

namespace ABC
{
    class ABC174A
    {
        const string FILE = "/tmp/data.txt";

        static void Main(string[] args)
        {
#if DEBUG
            Console.SetIn(new StreamReader(FILE));
#endif
            var N = RI();
            Console.WriteLine(N >= 30 ? "Yes" : "No");


#if DEBUG
            Console.WriteLine("*** end ***");
            Console.SetIn(Console.In);
            Console.ReadKey();
            Console.WriteLine();
#endif
        }

        static int RI()
        {
            return int.Parse(Console.ReadLine());
        }

        static int[] RIa(int n)
        {
            string[] sa = Console.ReadLine().Split(' ');
            int[] la = new int[n];
            for (int i = 0; i < n; ++i)
            {
                la[i] = int.Parse(sa[i]);
            }
            return la;
        }
    }
}


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

using p_int = pair<int, int>;

int N, M;
vector<p_int> X;

bool compare(p_int a, p_int b) { return a.second < b.second; }

void abc103d() {
  sort(X.begin(), X.end(), compare);
  int res = 0, endtime = 0;
  for (int i = 0; i < M; i++) {
    if (endtime <= X[i].first) {
      res++;
      endtime = X[i].second;
    }
  }
  cout << res << "\n";
  return;
}

int main() {
  cin >> N >> M;
  X.resize(M);
  for (int i = 0; i < M; i++) {
    cin >> X[i].first >> X[i].second;
  }
  abc103d();
  return 0;
}

Measured memory_bytes: 1152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace AtCoder
{
    public class Code6
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
 
            Console.WriteLine(funcMain(s1));
        }
 
        static public string funcMain(string arg1)
        {
            string[] s = arg1.Split();
            int N, M;
            int ret = 0;
 
            N = int.Parse(s[0]);
            M = int.Parse(s[1]);
 
            var OnceTime = (N - M) * 100 + M * 1900;
            var Times = (int)Math.Pow(2,M);
            ret = OnceTime * Times;
 
            return ret.ToString();
        }
    }
}

Measured memory_bytes: 11348
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);

int main(){
    string s;

    cin>>s;
  ll n=sz(s);
    if(s.substr(0,(n-1)/2)==s.substr((n-1)/2+1)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define flash ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define pb push_back
#define all(v) (v).begin(),(v).end() 
#define endl "\n"
#define int long long int
#define ll long long
#define ld long double
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
const int mod = 1000000007;
const int N=200005;
const int inf=1e18;
vector<vector<int>>adj(N);


bool isPrime(ll n){if(n<2)return false;for(ll i=2;i*i<=n;++i){if(n%i==0){return false;}}return true;}
ll power(ll x,ll y){ll res=1;x=x;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res%mod;}
ll gcd(ll a,ll b){if (a==0)return b;return gcd(b%a,a);}

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


signed main(){
    flash;
    fun();
    int t=1;
    //cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;
        vi a(n);
        for(int i=0;i<n;i++)
            cin>>a[i];        
        vii d(m);
        for(int i=0;i<m;i++){
            cin>>d[i].S>>d[i].F;
        }
        sort(all(a));
        sort(d.rbegin(),d.rend());
        int indx=0;
        for(int i=0;i<m;i++){
            for(int j=0;j<d[i].S;j++){
                if(indx>n)
                    break;
                if(a[indx]<d[i].F){
                    a[indx]=d[i].F;
                    indx++;
                }
                else
                {
                    break;
                }
                                    
            }
        }
        int ans=0;
        for(auto i: a)
            ans+=i;
        cout<<ans<<endl;
        
    }
    return 0;
}

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

int main() {
long long n,k;
cin>>n>>k;
long long a[n];
for(long long i=0;i<n;i++){
    cin>>a[i];
}
for(long long i=k;i<n;i++){

        if(a[i]>a[i-k]){
            cout<<"Yes"<<endl;
        }
    else{
        cout<<"No"<<endl;
    }
}
return 0;
}


Measured memory_bytes: 5192
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 2000000000;//10^9
ll MOD  = 998244353;
ll gcd(ll a, ll b){
    if(b == 0) return a;
    return gcd(b, a%b);
}

int main() {
    int N,X;
    cin >> N >> X;
    vector<int> x(N);
    for(int i = 0; i < N; i++) cin >> x.at(i);
    
    for(int i = 0; i < N; i++){
        x.at(i) = abs(X - x.at(i));
    }
    int ans = x.at(0);
    for(int i = 1; i < N; i++){
        ans = gcd(ans, x.at(i));
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include <math.h>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define PI 3.14159265358979323846264338327950L
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

int main() {
  long long A, B, K;

  cin >> A >> B >> K;

  if (A - K < 0) {
    if (B + A - K < 0)
      cout << 0 << " " << 0 << endl;
    else
      cout << 0 << " " << B + A - K << endl;
  } else
    cout << A - K << " " << B << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  if(a>12){
    cout << b << endl;
  }
  else if(a<6){
    cout << 0 << endl;
  }
  else {
    cout << b/2 << endl;
  }
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdlib>

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,k,n) for(int i=k;i<n;i++)

using namespace std;


int main()
{
	string s;
	string soro[10] = {"* = ****","* =* ***","* =** **","* =*** *","* =**** "," *= ****"," *=* ***"," *=** **"," *=*** *"," *=**** "};
	bool flag = true;
	while(cin >> s)
	{
		vector<char> c;

		rep(i,5-s.size())
		{
			c.push_back('0');
		}

		rep(i,s.size())
		{
			c.push_back(s[i]);
		}

		if(flag)
		{
			flag = false;
		}
		else
		{
			cout << endl;
		}

		rep(i,8)
		{
			rep(j,5)
			{
				cout << soro[c[j]-'0'][i];
			}
			cout << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1204
/*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_C&lang=jp
 */

import java.util.*;

class Point {
	double x, y;
	Point(double x, double y) {
		this.x = x;
		this.y = y;
	}
	void print() {
		System.out.printf("%.8f %.8f\n", x, y);
	}
}

public class Main {
	
	double dist(Point s, Point t) {
		double xd = t.x - s.x;
		double yd = t.y - s.y;
		return Math.sqrt(xd*xd + yd*yd);
	}
	
	void koch(int n, Point p1, Point p2) {
		if (n <= 0) return;
		n--;
		Point s = new Point((p1.x*2 + p2.x) / 3.0, (p1.y*2 + p2.y) / 3.0);
		Point t = new Point((p1.x + p2.x*2) / 3.0, (p1.y + p2.y*2) / 3.0);
		double ux = (t.x - s.x) * Math.cos(Math.toRadians(60)) - (t.y - s.y) * Math.sin(Math.toRadians(60)) + s.x;
		double uy = (t.x - s.x) * Math.sin(Math.toRadians(60)) + (t.y - s.y) * Math.cos(Math.toRadians(60)) + s.y;
		Point u = new Point(ux, uy);
		koch(n, p1, s);
		s.print();
		koch(n, s, u);
		u.print();
		koch(n, u, t);
		t.print();
		koch(n, t, p2);
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Point p1 = new Point(0, 0);
		Point p2 = new Point(100, 0);
		
		p1.print();
		koch(n, p1, p2);
		p2.print();
	}

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

}



Measured memory_bytes: 41632
/*program by mangoyang*/
#include<bits/stdc++.h>
#define inf (0x7f7f7f7f)
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) < (b) ? (a) : (b))
typedef long long ll;
using namespace std;
template <class T>
inline void read(T &x){
	int f = 0, ch = 0; x = 0;
	for(; !isdigit(ch); ch = getchar()) if(ch == '-') f = 1;
	for(; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
	if(f) x = -x;
}
int a[100005], n;
int main(){
	read(n); int ans = 0;
	for(int i = 1; i <= n; i++) read(a[i]);
	for(int i = 2; i <= n; i++)
		if(a[i] == a[i-1]) a[i] = -1, ans++; 
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n, d;
    vector<int> s(1010);
    
    while(true){
        cin >> n;
        if(n == 0) break;
        int sum = 0;
        for (int i = 0; i < n; i++)
        {
            cin >> d;
            s.at(i) = d;
            sum += d;
        }
        double ave = (double)sum/n;
        double v = 0.0;
        for (int i = 0; i < n; i++)
        {
            v += pow(s.at(i)-ave, 2);
            s.at(i) = 0;
        }
        cout << fixed << setprecision(10) << sqrt(v/n) << endl;
    }
}


Measured memory_bytes: 3236
#include<cstdio>
#include<string>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n,ans=0;
	cin>>n;
	vector<int> a;
	for(int i=0;i<2*n;i++){
		int x;cin>>x;
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	for(int i=0;i<n;i++){
		ans+=a[2*i];
	}
	cout<<ans<<endl;
	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;

ll llsqrt(ll n) {
  ll i;
  for(i = 1; n > 0; i++) {
    n -= i * 2 + 1;
  }
  return i;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  ll ans = 0;
  ll sq = llsqrt(N);
  // cout << sq << endl;
  for(ll i = 1; i <= sq; i++) {
    if((N - i) % i == 0 && (N - i) / i >= i && N % ((N - i) / i) != 0) {
      ans += (N - i) / i;
      // cout << (N - i) / i << endl;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int n,i;
	int r;
	int l;
	int sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d",&l,&r);
		sum += r-l+1;
	}
	printf("%d",sum);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

#define rep(i, n) for(long int i = 0; i < n; i++)


int main(){
    int n;
    cin >> n;
    if(n % 10 == 2 || n % 10 == 4 || n % 10 == 5 || n % 10 == 7 || n % 10 == 9){
        cout << "hon" << endl;
    }else if(n % 10 == 3){
        cout << "bon" << endl;
    }else{
        cout << "pon" << endl;
    }
}


Measured memory_bytes: 3624
#include<stdio.h>
#include<string.h>
char a[104],b[104];
int lena,lenb,i;
int main(){
	scanf("%s %s",&a,&b);
	lena=strlen(a);
	lenb=strlen(b);
	if(lena>lenb)
		printf("GREATER");
	else if(lenb>lena)
		printf("LESS");
	else{
		for(i=0;i<lena;i++){
			if(a[i]>b[i]){
				printf("GREATER");
				break;
			}
			else if(b[i]>a[i]){
				printf("LESS");
				break;
			}
		}
		if(i==lena)printf("EQUAL");

		
	}
		
}



Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,h[100005],dp[100005];
  cin>>n;
  dp[0]=0;
  for(int i=0; i<n; i++){
    cin>>h[i];
  }
  for(int i=1; i<n; i++){
    if(i==1){
      dp[i]=abs(h[i]-h[i-1])+dp[i-1];
    }else{
      if(abs(h[i]-h[i-1])+dp[i-1]>abs(h[i]-h[i-2])+dp[i-2]){
	dp[i]=abs(h[i]-h[i-2])+dp[i-2];
      }else{
	dp[i]=abs(h[i]-h[i-1])+dp[i-1];
      }
    }
  }
  cout<<dp[n-1]<<'\n';

  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
ll N;
ll a[200000], reva[200000];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>N;
    rep(i,0,N){
        cin>>a[i];
        a[i]--;
        reva[a[i]]=i;
    }
    ll ans=0;
    set<ll> v;
    v.insert(-1);
    v.insert(N);
    rep(i,0,N){
            ans+=(reva[i]-*(--v.lower_bound(reva[i])))*(*v.lower_bound(reva[i])-reva[i])*(i+1);
            v.insert(reva[i]);
    }
    cout <<ans<<"\n";
}

Measured memory_bytes: 12800
n, k = (int(x) for x in raw_input().split())
l = [int(x) for x in raw_input().split()]
pref = [0]
for i in xrange(n):
    pref.append(pref[-1] + (1 + l[i]) / 2.)
i = k
ret = 0
while i < len(pref):
    ret = max(ret, pref[i] - pref[i-k])
    i += 1
print ret


Measured memory_bytes: 57728
using System;

namespace AGC004A{
    public class Program{
        public static void Main(string[] args){
            var sr = new StreamReader();
            //---------------------------------
            var A = sr.Next<long>();
            var B = sr.Next<long>();
            var C = sr.Next<long>();

            if(A % 2 == 0 || B % 2 == 0 || C % 2 == 0){
                Console.WriteLine(0);
                return;
            }

            Console.WriteLine(Ex.Min(A * B, B * C, C * A));
            //---------------------------------
        }
    }

    public class Ex{
        public static T Min<T>(params T[] values) where T : IComparable{
            var ret = values[0];
            foreach(var v in values) ret = ret.CompareTo(v) < 0 ? ret : v;
            return ret;
        } 
    }

    public class StreamReader{
        private readonly char[] _c = {' '};
        private int _index = -1;
        private string[] _input = new string[0];
        private readonly System.IO.StreamReader _sr = new System.IO.StreamReader(Console.OpenStandardInput());

        public T Next<T>(){
            if(_index == _input.Length - 1){
                _index = -1;
                while(true){
                    string rl = _sr.ReadLine();
                    if(rl == null){
                        if(typeof(T).IsClass) return default(T);
                        return (T)typeof(T).GetField("MinValue").GetValue(null);
                    }
                    if(rl != ""){
                        _input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
                        break;
                    }
                }
            }
            return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
        }

        public T[] Next<T>(int x){
            var ret = new T[x];
            for(var i = 0; i < x; ++i) ret[i] = Next<T>();
            return ret;
        }

        public T[][] Next<T>(int y, int x){
            var ret = new T[y][];
            for(var i = 0; i < y; ++i) ret[i] = Next<T>(x);
            return ret;
        }
    }
}

Measured memory_bytes: 3032
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
  ll n,m,d;
  cin>>n>>m>>d;
  cout<<setprecision(10);
  if(d==0) cout<<(m-1)*(double)1/n<<endl;
  else cout<<(m-1)*(double)2*(n-d)/(n*n)<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 998244353;
const int IMAX = 3000;
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}
class unko {
public:
	int fac[IMAX + 1], ifac[IMAX + 1], inv[IMAX + 1];
	constexpr unko() : fac(), ifac(), inv() {
		fac[0] = 1;
		rep1(i, IMAX) fac[i] = ll(fac[i - 1]) * i % mod;
		ifac[IMAX] = modpow(fac[IMAX], mod - 2);
		for (int i = IMAX; i > 0; i--) ifac[i - 1] = ll(ifac[i]) * i % mod;
		inv[0] = 1;
		rep1(i, IMAX) inv[i] = ll(ifac[i]) * fac[i - 1] % mod;
	}
} f;

int dp[3001];
int A[3001], B[3001];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N, S;
	scanf("%d %d", &N, &S);

	int saisho = 5000;
	rep(i, N) {
		int a;
		scanf("%d", &a);
		A[a]++;
		if (saisho > a) saisho = a;
	}

	ll k2 = modpow(2, mod - 2);
	dp[0] = modpow(2, N);
	int s = saisho * A[saisho];
	ll kotae1 = 0, kotae2 = 0;
	B[0] = 1;

	for (int b = 1; b <= A[saisho]; b++) {
		if (b * saisho > S) break;
		dp[b * saisho] = k2 * dp[(b - 1) * saisho] % mod * (A[saisho] - b + 1) % mod * f.inv[b] % mod;
	}
	kotae2 = dp[S];

	for (int a = saisho + 1; a <= S; a++) {
		if (A[a] == 1) {
			s = min(S - a - 1, s + a);
			if (S >= a) kotae1 += dp[S - a];
			for (int j = s; j >= a; j--) {
				dp[j] = (dp[j] + dp[j - a] * k2) % mod;
			}
		}
		else if (A[a]) {
			rep1(b, A[a]) {
				B[b] = k2 * B[b - 1] % mod * (A[a] - b + 1) % mod * f.inv[b] % mod;
			}

			s = min(S - a, s + a * A[a]);
			if (S >= a) {
				rep1(b, A[a]) {
					if (S - a * b < 0) break;
					kotae2 += ll(dp[S - a * b]) * B[b] % mod;
				}
			}
			for (int j = s; j >= a; j--) {
				ll tmp = dp[j];
				rep1(b, A[a]) {
					if (j - a * b < 0) break;
					tmp += ll(dp[j - a * b]) * B[b] % mod;
				}
				dp[j] = tmp % mod;
			}
		}
	}

	printf("%lld\n", (kotae1 % mod * k2 + kotae2) % mod);

	Would you please return 0;
}

Measured memory_bytes: 1760
#include<iostream>
using namespace std;
int main() {
	long long x1, y1, x2, y2, x3, y3, s, mod;
	cin >> s;
	x1 = y1 = 0;
	x2 = 1e9, y2 = 1;
	mod = 1e9;
	y3 = s / mod + 1;
	x3 = x2 * y3 - s;
	if (s == 1e18) {
		y2--, y3--;
	}
	cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;
	return 0;
}

Measured memory_bytes: 3612
N,M = [int(x) for x in input().split()]
ac = [0]*(N+1)
wa = [0]*(N+1)
for i in range(M):
  p,s = input().split()
  if s =="AC" and ac[int(p)]==0:
    ac[int(p)]=1
  if s=="WA" and ac[int(p)]==0:
    wa[int(p)]+=1
ans = 0
answa = 0
for i in range(N+1):
  if ac[i]==1:
    ans+=1
    answa+=wa[i] 
print(ans,answa)

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

int main() {
  int n, l;
  cin >> n >> l;
  
  vector<string> s(n);
  for(int i=0; i<n; i++){
    cin >> s.at(i);
  }
  sort(s.begin(), s.end());
  
  string str;
  for(int i=0; i<n; i++){
    str += s.at(i);
  }
  
  cout << str << endl;
  return 0;
}


Measured memory_bytes: 256
q , h , s , d = map(int,input().split())
n = int(input())
qb = q*8
hb = h*4
sb = s*2
db = d

if min(qb,hb,db,sb) != db:
    print(n*min(q*4,h*2,s))
elif min(qb,hb,db,sb) == db:
    if n % 2 == 0:
        print((n//2)*d)
    elif n % 2 == 1:
        ans = (n//2) * d
        ans += min(q*4,h*2,s)
        print(ans)

Measured memory_bytes: 38384
import java.util.*;
public class Main{
    public static void main(String args[]) {
        Scanner cin = new Scanner(System.in);
        while(cin.hasNext()){
        	String s = cin.next();
        	System.out.println(getNum(s));
        }
    }
    public static int getNum(String s){
    	int count=0;
    	for(int i=0;i<s.length();i++){
    		if(s.charAt(i)=='p') count++;
    	}
    	return s.length()/2-count;
    } 
}

Measured memory_bytes: 13728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	string s;
	ll x,y;
	cin>>s>>x>>y;
	ll st=0;
	for(ll i=0;i<s.size();i++){
		if(s[i]!='F'){
			break;
		}
		st++;
	}
	//cout <<st;
	vector<ll>dx,dy;
	bool l=true;
	ll cnt=0;
	for(ll i=st;i<s.size();i++){
		if(s[i]=='T'){
			if(l){
				dx.push_back(cnt);
			}
			else{
				dy.push_back(cnt);
			}
			l=abs(l-1);
			cnt=0;
		}
		else{
			cnt++;
		}
	}
	if(l){
		dx.push_back(cnt);
	}
	else{
		dy.push_back(cnt);
	}
	set<ll>chx;
	chx.insert(st);
	for(ll i=0;i<dx.size();i++){
		ll now=dx[i];
		vector<ll>b;
		for(auto i=chx.begin();i!=chx.end();i++){
			b.push_back(*i);
		}
		chx.clear();
		for(ll i=0;i<b.size();i++){
			ll nowb=b[i];
			chx.insert(nowb+now);
			chx.insert(nowb-now);
		}
	}
	set<ll>chy;
	chy.insert(0);
	for(ll i=0;i<dy.size();i++){
		ll now=dy[i];
		vector<ll>b;
		for(auto i=chy.begin();i!=chy.end();i++){
			b.push_back(*i);
		}
		chy.clear();
		for(ll i=0;i<b.size();i++){
			ll nowb=b[i];
			chy.insert(nowb+now);
			chy.insert(nowb-now);
		}
	}
	if(chx.count(x)==true&&chy.count(y)==true){
		cout << "Yes";
	}
	else{
		cout << "No";
	}
	// your code goes here
	return 0;
}

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

int main() {
    string s;
    cin >> s;
    rep(i, s.size()) {
        s[i] = 'x';
    }
    cout << s << endl;

    return 0;
}

Measured memory_bytes: 256
import sys

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

a = []
while True:
	n = int(input())
	if n == 0:
		break
	a.append(n)

N = max(a)
dp = [0 for _ in range(N+1)]
dp[0] = 1

for i in range(N+1):
	for j in range(1,4):
		if i+j >= N+1:
			break
		dp[i+j] += dp[i]

for ans in a:
	print((int((dp[ans]/10)//365))+1)


Measured memory_bytes: 5616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define int long long
int hmt() {int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';if(n) x=-x;return x;}
#define in hmt()
#define ins ({string x;char c=getchar();for(;c==' '||c=='\n';c=getchar());for(;c!=' '&&c!='\n';c=getchar()) x+=c;x;})
#define forinc(i,a,b) for(int i=a,_b=b;i<=_b;++i)
#define fordec(i,a,b) for(int i=a;i>=b;--i)
#define forb(i,BS) for(int i=BS._Find_first();i< BS.size();i = BS._Find_next(i))
#define forv(a,b) for(auto &a:b)
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define reset(f,x) memset(f,x,sizeof(f))
#define bit(x,i) ((x>>(i-1))&1)
#define onbit(x,i) (x|(1<<(i-1)))
#define offbit(x,i) (x&~(1<<(i-1)))
using namespace std;
const int N=205,M=40005;
int ft[N],cu[N],q[N],h,t,tot=1,ans,S,T,d[N];
struct edge
{
    int t,f,n;
} E[M];
void add(int x,int y,int f)
{
    E[++tot]=(edge) {y,f,ft[x]},ft[x]=tot;
    E[++tot]=(edge) {x,0,ft[y]},ft[y]=tot;
}
#define FOR for (int o=cu[u],v;v=E[o].t;o=E[o].n)
void bfs(int u=S)
{
    memset(d,0,sizeof(d));
    memcpy(cu,ft,sizeof(cu));
    for (d[q[h=t=1]=u]=1; h<=t; u=q[++h])
        FOR if (E[o].f&&!d[v])
            d[q[++t]=v]=d[u]+1;
}
int dfs(int u,int f)
{
    if (u==T||!f)
        return f;
    int g=0,t;
    FOR if (cu[u]=o,d[v]==d[u]+1&&(t=dfs(v,min(f,E[o].f))))
        g+=t,f-=t,E[o].f-=t,E[o^1].f+=t;
    return g;
}
int n,m;
main()
{
    scanf("%d%d",&n,&m);
    forinc(i,1,n) forinc(j,1,m)
    {
        char c;
        cin>>c;
        if (c=='.') continue;
        int f=1;
        if (c=='S') S=i,f=1000;
        if (c=='T') T=i,f=1000;
        add(i,j+n,f);
        add(j+n,i,f);
    }
    while (bfs(),d[T]&&ans<1e7) ans+=dfs(S,1e8);
    printf("%d\n",ans>n+m?-1:ans);
}


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

using namespace std;

typedef long long ll;
typedef long double ld;

const int INF = 1e9 + 7;

int main()
{
    int n, k;
    cin>> n >> k;
    int cost[n];
    vector<int> dp(n, INF);
    for(int i = 0; i < n; i++){
        cin>> cost[i];
    }
    dp[0] = 0;
    for(int i = 1; i < n; i++){
        for(int j = i; j >= 0 && j >= i - k; j--){
            dp[i] = min(dp[i], dp[j] + abs(cost[i] - cost[j]));
        }
    }
    cout<< dp[n - 1];
}


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

using namespace std;

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

    int s_size = s.size(), t_size = t.size();

    // インデックス0にダミー文字を挿入して、文字列をインデックス1から始めて扱いやすくする
    s.insert(0, "#");
    t.insert(0, "#");
    
    // sのi文字目までとtのj文字目までの共通部分文字列の最大の大きさdp[i][j]
    vector<vector<int>> dp(s_size + 1, vector<int>(t_size + 1, 0));

    // 初期条件
    dp[0][1] = 0, dp[1][0] = 0;

    // dp開始
    for (int i = 1; i <= s_size; i++) {
        for (int j = 1; j <= t_size; j++) {
            // sのi文字目とtのj文字目が同じ文字のとき
            if (s[i] == t[j]) {
                dp[i][j] = max({dp[i-1][j-1] + 1, dp[i-1][j], dp[i][j-1]});
            } else {
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }
    }

    string answer = "";
    int i = s_size, j = t_size;

    // 逆にたどって答えの文字列を作る
    while (i >= 1 && j >= 1) {
        if (dp[i][j] == dp[i-1][j]) {
            i--;
        } else if (dp[i][j] == dp[i][j-1]) {
            j--;
        } else {
            answer = s[i] + answer;
            i--, j--;
        }
    }

    cout << answer << endl;
	return 0;
}

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


//TEMPLATE
#define pb              push_back
#define mp              make_pair
#define ll              long long
#define ld              long double
//#define pi              3.1415926536
#define pi              acos(-1)
//#define mod             1000000007
#define newline         printf("\n")
#define printminusone   printf("-1\n")
#define scl1(n)         scanf("%lld", &n)
#define scl2(a, b)      scanf("%lld %lld", &a, &b)
#define scl3(a, b, c)   scanf("%lld %lld %lld", &a, &b, &c)
#define printl(n)       printf("%lld\n", n)
#define ssl1(str)       scanf(" %[^\n]", str)
#define scd1(n)         scanf("%lf", &n)
#define scd2(a, b)      scanf("%lf %lf", &a, &b)
#define printd(n)       printf("%lf\n", n)
#define printld(n)      printf("%Lf\n", n)
#define printcase       printf("Case %lld: ", i)
#define reversed(s)     reverse(s.begin(), s.end())
#define asorted(s)      sort(s.begin(), s.end())
#define dsorted(s)      sort(s.begin(), s.end(), cmp)
#define for0(i, n)      for (i = 0; i < n; i++)
#define for1(i, n)      for (i = 1; i <= n; i++)
#define fori(itt, stt)  for(auto itt = stt.begin(); itt != stt.end(); itt++)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
//#define SIZE            100005
//#define INF             1000000005
#define F               first
#define S               second
#define FR              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ms(arr, x)      memset(arr, x, sizeof arr)
#define bitcount(n)     __builtin_popcountll(n)

const ll INF = LLONG_MAX;
const ll SIZE = 4e5+5;
const ll mod = 1e9+7;




int main() {
    ll t = 0, n, x, y, z, i, j, k, g, p, q, ans = 0, sum = 0, c = 0;
    string s, s1, s2;

    cin >> x >> y;

    ans = (x / y) + (x%y != 0);
    printl(ans);


    return 0;
}



Measured memory_bytes: 256
import sys

H, W = map(int, input().split())

a = [None for _ in range(H)]
for i in range(H):
    a[i] = list(input())

skipedIdx_I = set()
skipedIdx_J = set()

# print(a)

for i in range(H):
    skip = True
    for j in range(W):
        if a[i][j] == "#":
            skip = False
    if skip == True:
        skipedIdx_I.add(i)

for j in range(W):
    skip = True
    for i in range(H):
        if a[i][j] == "#":
            skip = False
    if skip == True:
        skipedIdx_J.add(j)

# print(skipedIdx_I)
# print(skipedIdx_J)

for i in range(H):
    if not i in skipedIdx_I:
        for j in range(W):
            if not j in skipedIdx_J:
                print(a[i][j], end="")
        print()

sys.exit(0)


Measured memory_bytes: 4596
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

const int INF=1e18;

signed main()
{
    int A,B,Q; 
    cin>>A>>B>>Q;
    vint s(A+2),t(B+2);
    REP(i,A) cin>>s[i+1];
    REP(i,B) cin>>t[i+1];

    s[0]=-INF; s[A+1]=INF;
    t[0]=-INF; t[B+1]=INF;

    while(Q--){
        int x; cin>>x;
        int idxs=lower_bound(ALL(s),x)-s.begin();
        int idxt=lower_bound(ALL(t),x)-t.begin();

        int ans=INF;
        for(int i=idxs-1;i<=idxs;i++){
            for(int j=idxt-1;j<=idxt;j++){
                ans=min(ans,abs(x-s[i])+abs(s[i]-t[j]));
                ans=min(ans,abs(x-t[j])+abs(t[j]-s[i]));
            }
        }
        cout<<ans<<endl;
    }

}


Measured memory_bytes: 2944
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
    int hoge;
    double X;
    hoge = scanf("%lf",&X);
    double A=100;
    int count=0;
    while(A<X){
        A=floor(1.01*A);
        count +=1;
    }
    //最終出力
    printf("%d",count);
    return 0;
}

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

typedef int integer;

#define FIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ld long double
#define pb push_back
#define bs binary_search
#define up upper_bound
#define lw lower_bound
#define fs first 
#define sd second 
#define mp make_pair    

#define fore(i,a,b) for(ll i = a; i < b; i++)
#define rfore(i, a, b) for(ll i = a - 1; i >= b; i--)
#define forev(a,b) fore(i,0,b)cout<<a[i]<<" "; 
#define mm(a,b) memset(a , b , sizeof a) 
#define ALL(a) a.begin(),a.end() 
#define SZ(n) ((ll) (n).size())

#define infi  2e9
#define int long long
#define endl '\n'
const ld pi = 3.14159265358979323846;
const ll mod = 1e9+7;
const ll INF = 1e10;
const ld EPS = 1e-8;

typedef pair<ll,ll> pll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b,a%b); } 
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }

const int MAXN = 200000;
const int K=20;

int n,m;
vector<int> g[MAXN];
int dp[MAXN];

int solve(int node){
	int &r = dp[node];
	if(r!=-1)return r;
	r = 0;
	for(auto x : g[node]){
		r = max(r,1+solve(x));
	}
	return r;
}

integer main(){
	cin>>n>>m;
	fore(i,0,m){
		int a,b; cin>>a>>b; a--;b--;
		g[a].pb(b);
	}
	mm(dp,-1); int res=0;
	fore(i,0,n){
		res=max(res,solve(i));
	}
	cout<<res;
    return 0;
}



Measured memory_bytes: 11008
s=list(input())	
t=list(input())	
def c(l, x):
    return [i for i, _x in enumerate(l) if _x == x]
ss = []
tt = []
ss.append(c(s,'a'))
tt.append(c(t,'a'))
ss.append(c(s,'b'))
tt.append(c(t,'b'))
ss.append(c(s,'c'))
tt.append(c(t,'c'))
ss.append(c(s,'d'))
tt.append(c(t,'d'))
ss.append(c(s,'e'))
tt.append(c(t,'e'))
ss.append(c(s,'f'))
tt.append(c(t,'f'))
ss.append(c(s,'g'))
tt.append(c(t,'g'))
ss.append(c(s,'h'))
tt.append(c(t,'h'))
ss.append(c(s,'i'))
tt.append(c(t,'i'))
ss.append(c(s,'j'))
tt.append(c(t,'j'))
ss.append(c(s,'k'))
tt.append(c(t,'k'))
ss.append(c(s,'l'))
tt.append(c(t,'l'))
ss.append(c(s,'m'))
tt.append(c(t,'m'))
ss.append(c(s,'n'))
tt.append(c(t,'n'))
ss.append(c(s,'o'))
tt.append(c(t,'o'))
ss.append(c(s,'p'))
tt.append(c(t,'p'))
ss.append(c(s,'q'))
tt.append(c(t,'q'))
ss.append(c(s,'r'))
tt.append(c(t,'r'))
ss.append(c(s,'s'))
tt.append(c(t,'s'))
ss.append(c(s,'t'))
tt.append(c(t,'t'))
ss.append(c(s,'u'))
tt.append(c(t,'u'))
ss.append(c(s,'v'))
tt.append(c(t,'v'))
ss.append(c(s,'w'))
tt.append(c(t,'w'))
ss.append(c(s,'x'))
tt.append(c(t,'x'))
ss.append(c(s,'y'))
tt.append(c(t,'y'))
ss.append(c(s,'z'))
tt.append(c(t,'z'))
ss.sort()
tt.sort()
#print(ss)
#print(tt)
if ss == tt:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 22688
while true
  n = gets.to_i
  break if n==0

  s = 2*n
  x = 2  
  ptn = 0
  while x<n
    if s%x == 0
      l2 = s/x-x+1
      ptn += 1 if l2>0 && l2%2==0
    end
    x += 1
  end

  puts ptn
end

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

using namespace std;

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

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


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

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

//-----------------------------------------

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

    ll a, b, c, k;
    cin >> a >> b >> c >> k;

    while(k){
        if(a>=b){
            b *= 2;
        }
        else if(b>=c){
            c *= 2;
        }
        k--;
    }

    if(a < b && b < c) yes();
    else no();

    
    return 0;
}



Measured memory_bytes: 3652