akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
 
int main() {
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;
  int total = 100 * A, sugar = 0;
  for (int a = 0; a <= F; a += A * 100) {
    for (int b = 0; a + b <= F; b += B * 100) {
      int w = a + b;
      if (w > 0) {
        for (int c = 0; w + c <= F && c * 100 <= w * E; c += C) {
          int d = min(F - w - c, (w * E - c * 100) / 100) / D * D;
          int s = c + d;
          int t = w + s;
          if (s * total > sugar * t) {
            total = t;
            sugar = s;
          }
        }
      }
    }
  }
  cout << total << " " << sugar << endl;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<int, int> P;


ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

int N, K;

/******************************************
** A main function is start from here  ****
*******************************************/
int main(){
  cin >>N >>K;
  vector<int> h(N);
  rep(i, N){
    cin >> h[i];
  }

  sort(ALL(h));
  
  int ans=1e9;
  rep(i, N-K+1){
    ans = min(h[i+K-1]-h[i],ans);
  }

  cout << ans;
  
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
#define watch cerr << 
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using namespace std;

int32_t main(){

	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int a,b,c;
	cin>>a>>b>>c;
	if(c<a+b){
		cout << "No" << endl; 
		return 0;
	}
	int res = c*c+a*a+b*b-2*a*b-2*c*a-2*c*b;
	if(res<=0){
		cout << "No" << endl; 
		return 0;
	}
	cout << "Yes" << endl ;

	return 0;
}


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

using namespace std;

template <class T>inline T updmax(T& a, T b) {return a = max(a, b);}
template <class T>inline T updmin(T& a, T b) {return a = min(a, b);}

class Solution {
public:
	void solve() {
		int n, m;
		cin >> n >> m;
		vector<int> a(n, 0);
		for(int i=0; i<n; i++)cin >> a[i];
		priority_queue<int> q;
		for(int i=0; i < n; i++)q.push(a[i]);
		for(int i=0; i < m; i++){
			int tmp = q.top();
			q.pop();
			q.push(tmp/2);
		}
		long long ret = 0;
		while(!q.empty()){
			ret += q.top();
			q.pop();
		}
		cout << ret << "\n";
		
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Measured memory_bytes: 1276
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define VPII vector<pair<int,int> >
#define F first
#define S second
#define RF(x) freopen(x,"r",stdin)
#define WF(x) freopen(x,"w",stdout)
typedef long long LL;
using namespace std;
typedef pair<LL,LL> PLL;
typedef pair<int,int> PII;
const LL MOD = 1e9+7;
const LL INF = 1LL<<50;
const double eps = 1e-13;

int fq[100009];

int main(){
	DRI(n);
	REP(i,n){
		DRI(x);
		fq[x]++;
	}
	for(int i=n-1;i<n;i--){
		if(fq[i]==0)continue;
		if(fq[i]+fq[i-1]!=n){
			puts("No");return 0;
		}
		if(fq[i]==n){
			if(i==n-1){
				puts("Yes");
				return 0;
			}
		}
		int mincol=fq[i-1]+1;
		int maxcol=fq[i-1]+fq[i]/2;
		if(mincol<=i&&i<=maxcol){
			puts("Yes");return 0;
		}
		else{
			puts("No");return 0;
		}
	}
}


Measured memory_bytes: 640
import java.util.Random;
import java.util.Scanner;

public class Main {

	int[] dice = new int[6];

	public Main(int[] nums, String order) {
		dice = nums;
	}

	public void move(String order) {

		for(Character s : order.toCharArray()) {
			int buf;
	        switch(s){
	            case 'N':{
	                buf = dice[0];
	                dice[0] = dice[1];
	                dice[1] = dice[5];
	                dice[5] = dice[4];
	                dice[4] = buf;
	                break;
	            }
	            case 'E':{
	                buf = dice[0];
	                dice[0] = dice[3];
	                dice[3] = dice[5];
	                dice[5] = dice[2];
	                dice[2] = buf;
	                break;
	            }
	            case 'W':{
	                buf = dice[0];
	                dice[0] = dice[2];
	                dice[2] = dice[5];
	                dice[5] = dice[3];
	                dice[3] = buf;
	                break;
	            }
	            case 'S':{
	                buf = dice[0];
	                dice[0] = dice[4];
	                dice[4] = dice[5];
	                dice[5] = dice[1];
	                dice[1] = buf;
	                break;
	            }
	        }
		}
	}

	public int[] checkRight(int upper, int front) {

		Random rnd = new Random();
		for(int i=0; i<10000; i++) {
			int r = rnd.nextInt(4);
			switch(r) {
				case 0:
					move("W");
					break;
				case 1:
					move("E");
					break;
				case 2:
					move("S");
					break;
				case 3:
					move("N");
					break;
				default:
					break;
			}
			if(dice[0] == upper && dice[1] == front) break;
		}

		return dice;

	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] nums = new int[6];
		for(int i=0; i<6; i++) {
			nums[i] = sc.nextInt();
		}

//		Dice dice = new Dice(nums, "");
		Main dice = new Main(nums, "");

//		String order = sc.next();

		int n = sc.nextInt();
		for(int i=0; i<n; i++) {
			int upper = sc.nextInt();
			int front = sc.nextInt();
			int[] surface = dice.checkRight(upper, front);
			System.out.println(surface[2]);
		}
		sc.close();

	}

}


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

int head(int a){
  int X = 1 ;
  while(a >= X) X *= 10 ;
  X /= 10 ;
  return (a / X) ;
}  

int main() {
  int N, ans = 0 ;
  cin >> N ;
  int num[10][10] ;
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      num[i][j] = 0 ;
    }  
  }  
  for(int i=1;i<=N;i++){
    num[head(i)][(i % 10)]++ ;
  }  
  for(int i=1;i<10;i++){
    for(int j=1;j<i;j++){
      ans += (num[i][j] * num[j][i] * 2) ;
    }  
    ans += num[i][i] * num[i][i] ;
  }  
    
  cout << ans << endl ;
  return 0 ;
}

Measured memory_bytes: 256
using System;
class c
{
    static void Main()
    {
        var nt = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int ans = int.MaxValue;
        for (int i = 0; i < nt[0]; i++)
        {
            var line = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            if (line[0] < ans && nt[1] >= line[1]) ans = line[0];
        }
        Console.WriteLine((ans == int.MaxValue) ? "TLE" : ans.ToString());
    }
}

Measured memory_bytes: 13140
//ALDS1_3_D

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

#define STR_MAX_LEN 20000

int main(void)
{
    char            buf[STR_MAX_LEN];
    unsigned int    length[STR_MAX_LEN] = {}, depth;
    unsigned int    ii, jj, kk, field_len, floos[STR_MAX_LEN] = {};
    unsigned int    valley = 1, hill[STR_MAX_LEN] = {}; 
    unsigned int    total = 0;
    
    fgets(buf, sizeof(buf), stdin);
    
    field_len = strlen(buf);
    depth = 0;

    for(ii = 0; ii < field_len; ii++){
        switch(buf[ii]){
            case '\\':
                for(jj = 0; jj <= depth; jj++){
                    length[jj]++;
                }
                if(valley == 1){
                    hill[++hill[0]] = depth;
                    floos[0]++;
                    valley = 0;
                }
                depth++;
                break;
            case  '_':
                for(jj = 0; jj <= depth; jj++){
                    length[jj]++;
                }
                break;
            case  '/':
                for(jj = 0; jj <= depth; jj++){
                    length[jj]++;
                }
                if(0 < depth){
                    floos[floos[0]] += length[depth];
                    length[depth] = 0;
                    while(depth == hill[hill[0]]){
                        floos[0]--;
                        floos[floos[0]] += floos[floos[0] + 1];
                        floos[floos[0] + 1] = 0;
                        hill[hill[0]--] = 0;
                    }
                    depth--;
                    valley = 1;
                }
                break;
            default:
                break;
        }
    }
    
    if(valley == 0){
        floos[0]--;
        floos[floos[0]] += floos[floos[0] + 1];
        floos[floos[0] + 1] = 0;
    }

    for(ii = 1; ii <= floos[0]; ii++){
        total += floos[ii];
    }
    printf("%d\n", total);
    printf("%d", floos[0]);
    for(ii = 1; ii <= floos[0]; ii++){
        printf(" %d", floos[ii]);
    }
    printf("\n");
}


Measured memory_bytes: 2104
/* Coached by Dukkha */
#include <stdio.h>

#define N 10

int main() {
	static int aa[N];
	int n, m, i, j, a, b, cnt;

	scanf("%d%d", &n, &m);
	for (j = 0; j < m; j++) {
		int k;

		scanf("%d", &k);
		while (k--) {
			scanf("%d", &i), i--;
			aa[i] |= 1 << j;
		}
	}
	a = 0;
	for (j = 0; j < m; j++) {
		int p;

		scanf("%d", &p);
		a |= p << j;
	}
	cnt = 0;
	for (b = 0; b < 1 << n; b++) {
		int s = 0;

		for (i = 0; i < n; i++)
			if (b & 1 << i)
				s ^= aa[i];
		if (s == a)
			cnt++;
	}
	printf("%d\n", cnt);
	return 0;
}


Measured memory_bytes: 128
#include <cmath>
#include <string.h>
#include <iostream>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <algorithm>

#define rep(i, j, n) for (int i = j; i < n; i++)
#define rep_nested(i, s, n) for (int i = s; i <= n; i++)
#define ll long long
#define ull unsigned long long

const int N = 500;
const ll INF = 1e9 + 7;

using namespace std;

template <class T>
T limit(T n, T k) {
	return (n > k) ? k : n;
}

template <class T>
T has_order(T a, T b, T c) {
	return (b > a && b < c) || (b < a && b > c);
}

template <class T>
float points_distance(T a) {
	return sqrt(a);
}

template <class T>
T is_integer(T a) {
	return floor(a) == a;
}

int main() {
	ll l, r, min, mod = 2019;
	
	cin >> l >> r;
	
	if (r - l >= 2019) {
		cout << 0 << endl;
		return 0;
	}
	
	min = (l * r) % mod;
	
	for (ll i = l; i < r; i++) {
		for (ll j = i + 1; j < r + 1; j++) {
			min = limit(min, (i * j) % mod);
		}
	}
	
	cout << min << endl;
	
    return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    int n,w;
    cin >> n >> w;
    vector<pair<int,int> > v(n);
    long long int ans = 0;
    for(int i=0;i<n;i++)
        cin >> v[i].first >> v[i].second;
    vector<vector<long long int> > dp(n+1,vector<long long int>(w+1,0));
    
    // first = weight & second = value
    for(int i=1;i<=n;i++){
        for(int j=1;j<=w;j++){
            if(j<v[i-1].first)
                dp[i][j] = dp[i-1][j];
            else
                dp[i][j] = max(dp[i-1][j],dp[i-1][j-v[i-1].first]+v[i-1].second);
        }
    }
    cout << dp[n][w] << "\n";
    
    return 0;
}


Measured memory_bytes: 83256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n; cin>>n;
    ll sum = 0;
    vector<ll> nums(100001);
    rep(i,n){
        ll a; cin>>a;
        nums[a]++;
        sum+=a;
    }
    ll q;cin>>q;
    rep(i,q){
        ll b,c;cin>>b>>c;
        sum += (c-b)*nums[b];
        nums[c]+=nums[b];
        nums[b]=0;
        cout<<sum<<endl;
    }
    return 0;
}

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

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  cout << a+b+c-max(a,max(b,c)) << endl;
}

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

import numpy as np
pi=np.pi

A,B,H,M=input().split()

p=int(H)/12+int(M)/60/12
q=int(M)/60
s=abs(p-q)
ans=np.sqrt(int(A)**2+int(B)**2-2*int(A)*int(B)*np.cos(2*pi*s))
#print(s)
print(ans)

Measured memory_bytes: 27212
#include <stdio.h>
int main(void){
    int n;
    scanf("%d\n", &n);

    for (int i = 9; i > 0; i--)
    {
        if ( (n % i == 0) && (n / i <= 9) )
        {
            printf("Yes\n");
            return(0);
        }
    }
    printf("No\n");
    
    return(0);
}

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

#define int 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; }

map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

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

	if(n == 1){
		cout << 0 << endl;
		return 0;
	}

	auto mp = prime_factor(n);

	int ans = 0;

	for(auto e : mp){
		int tmp = e.second;
		int tt = 1;
		while(tt <= tmp){
			ans++;
			tmp -= tt;
			tt += 1;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3628
i1 = [int(s) for s in input().split()]
a = i1[0]
b = i1[1]
m = i1[2]

ia = [int(s) for s in input().split()]
ib = [int(s) for s in input().split()]

mina = min(ia)
minb = min(ib)
mv = mina + minb

for x in range(m):
  vouch = [int(s) for s in input().split()]
  if mv >= ia[vouch[0]-1] + ib[vouch[1]-1] - vouch[2]:
    mv = ia[vouch[0]-1] + ib[vouch[1]-1] - vouch[2]

print(mv)

Measured memory_bytes: 18252
#include<bits/stdc++.h>
#define mxn 1000010
#define LL long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pii pair<int,int> 
#define mp make_pair
#define fr first
#define sc second
using namespace std;
int n,sl,fh,ans,a[mxn];
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
int main()
{
	n=rd();
	for(int i=1;i<=n;++i) a[i]=rd();
	for(int i=2;i<n;++i)
		if(a[i-1]<a[i]&&a[i]<a[i+1])
			ans++;
	for(int i=2;i<n;++i)
		if(a[i+1]<a[i]&&a[i]<a[i-1])
			ans++;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
import bisect
N, C, K =map(int, input().split())
T = sorted([int(input()) for i in range(N)])

ans = 0
front = 0
while front < N:
    standard = T[front] + K
    front = min(bisect.bisect_right(T, standard), front+C)
    ans += 1
print(ans)

Measured memory_bytes: 8284
loop do
	n = STDIN.gets.to_i
	break if n.zero?

	pattern = ''
	replace = ''
	n.times do
		p, r = STDIN.gets.split
		pattern += p
		replace += r
	end

	str = ''
	STDIN.gets.to_i.times do
		str += STDIN.gets.chomp
	end

	puts str.tr(pattern, replace)
end

Measured memory_bytes: 14196
#include <iostream>
#define MAX_N 100000
using namespace std;
int cnt[MAX_N+1] = {0};
int max(int a, int b){
  return a > b ? a : b;
}
int main(void){
  int n;
  int ma = 0;
  cin >> n;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    ma = max(ma, a);
    if(a != 0) cnt[a-1]++;
    cnt[a]++;
    cnt[a+1]++;
  }
  int ans = 0;
  for(int i = 0; i <= ma+1; i++) ans = max(ans, cnt[i]);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

template<typename T>
ostream& operator << (ostream& os, vector<T>& v){
	rep(i,v.size()){ os << v[i] << (i == v.size() - 1 ? "" : " "); } return os;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& v){
	for(T& x: v){ is >> x; } return is;
}

template<typename T> struct sumGroup {
	using value_type = T;
	constexpr value_type id() { return 0; }
	constexpr value_type operator()(const value_type &a, const value_type &b) { return a + b; }
	constexpr value_type inv(const value_type &x) { return -x; }
};

template<typename CommutativeGroup> class WeightedUnionFind {
	using T = typename CommutativeGroup::value_type;
	CommutativeGroup g;

	vector<int> tree, rank;
	vector<T> diffWeight;

	public:
	WeightedUnionFind(const int &n) : tree(n), rank(n), diffWeight(n, g.id()) { iota(all(tree), 0); }

	int root(const int &x) {
		if (tree[x] == x) {
			return x;
		} else {
			int r = root(tree[x]);
			diffWeight[x] += diffWeight[tree[x]];
			return tree[x] = r;
		}
	}

	T weight(const int &x) {
		root(x);
		return diffWeight[x];
	}

	bool same(const int &a, const int &b) { return root(a) == root(b); }

	bool unite(int a, int b, T w) {
		w = g(w, g(weight(a), g.inv(weight(b))));
		a = root(a), b = root(b);
		if (a == b) return false;
		if (rank[a] < rank[b]) swap(a, b), w = g.inv(w);
		tree[b] = a;
		diffWeight[b] = w;
		if (rank[a] == rank[b]) ++rank[a];
		return true;
	}

	T diff(int x, int y) { return g(weight(y), g.inv(weight(x))); }
};

int main(){
	int n, m;
	while(cin >> n >> m, n||m){
		WeightedUnionFind<sumGroup<int>> uf(n);
		rep(i,m){
			char c;
			cin >> c;
			if(c == '!'){
				int a, b, w;
				cin >> a >> b >> w;
				uf.unite(--a, --b, w);
			}else{
				int a, b;
				cin >> a >> b;
				a--; b--;
				if(not uf.same(a,b)){
					cout << "UNKNOWN" << endl;
				}else{
					cout << uf.diff(a, b) << endl;
				}
			}
		}
	}
}



Measured memory_bytes: 3992
#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;

int main(){

    ll N;
    cin >> N;

    cout << "ABC" << N << endl;

}

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

int main(){
	int h, w;
	cin >> h >> w;
	char gra[h][w];
	for (int i = 0; i < h; i++){
		for (int j = 0; j < w; j++)
			cin >> gra[i][j];
	}
	bool ans = true;
	//4 corners
	if (gra[0][0] == '#' && gra[0][1] == '.' && gra[1][0] == '.')
		ans = false;
	if (gra[0][w-1] == '#' && gra[0][w-2] == '.' && gra[1][w-1] == '.')
		ans = false;
	if (gra[h-1][0] == '#' && gra[h-1][1] == '.' && gra[h-2][0] == '.')
		ans = false;
	if (gra[h-1][w-1] == '#' && gra[h-1][w-2] == '.' && gra[h-2][w-1] == '.')
		ans = false;
	//edge
	for (int i = 1; i < w-1; i++){
		if (gra[0][i] == '#' && gra[0][i-1] == '.' && gra[0][i+1] =='.' && gra[1][i] == '.')
			ans = false;
	}
	for (int i = 1; i < w-1; i++){
		if (gra[h-1][i] == '#' && gra[h-1][i-1] == '.' && gra[h-1][i+1] =='.' && gra[h-2][i] == '.')
			ans = false;
	}
	for (int i = 1; i < h-1; i++){
		if (gra[i][0] == '#' && gra[i-1][0] == '.' && gra[i+1][0] =='.' && gra[i][1] == '.')
			ans = false;
	}
	for (int i = 1; i < h-1; i++){
		if (gra[i][w-1] == '#' && gra[i-1][w-1] == '.' && gra[i+1][w-1] =='.' && gra[i][w-2] == '.')
			ans = false;
	}
	//inside
	for (int i = 1; i < h-1; i++){
		for (int j = 1; j < w-1; j++){
			if (gra[i][j] == '#' && gra[i-1][j] == '.' && gra[i+1][j] == '.' && gra[i][j-1] == '.' && gra[i][j+1] == '.')
				ans = false;
		}
	}
	//output
	if(ans == true)
		cout << "Yes" << endl;
	if(ans == false)
		cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>


int main()
{
	int n, x, i, j, sum = 0;
	int tako[256];

	scanf("%d", &n);

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

	for (i = 0; i < n; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			sum = sum + tako[i] * tako[j];
		}
	}
	printf("%d", sum);


	return 0;

}


Measured memory_bytes: 128
while True:
    a,op,b=input().split()
    a,b=map(int,[a,b])
    if op=='?':
        exit()
    if op=='+':
        print(a+b)
    elif op=='-':
        print(a-b)
    elif op=='/':
        print(a//b)
    elif op=='*':
        print(a*b)
    else:
        pass


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

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define Modulo 1000000007ll

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

void init()
{
    int n,k;
    cin >> n >> k ;
    if(n%k == 0)
        cout << 0;
    else
        cout << 1;
}

int main()
{
    clock_t time1 = clock();
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC * 100000 <<" seconds" <<endl;
	return 0;
    }


Measured memory_bytes: 256
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int main()
{
	lint a,b,n,ma,mi;
	cin>>n>>a>>b;
	if(a>b){
		cout<<0<<endl;return 0;
	}
	if(n==1){
		if(a==b) cout<<1<<endl;
		else cout<<0<<endl;
		return 0;
	}
	ma=a+(n-1)*b;mi=b+(n-1)*a;
	cout<<(ma-mi+1)<<endl;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	
	public static final int MAX = 24 * 60 * 60;
	
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);

		while (sc.hasNext()) {
			final int n = sc.nextInt();
			
			if(n == 0){
				break;
			}
			
			int[] imos = new int[MAX];
			
			for(int i = 0; i < n; i++){
				String[] start_str = sc.next().split(":");
				final int start = (Integer.parseInt(start_str[0]) * 60 + Integer.parseInt(start_str[1])) * 60 + Integer.parseInt(start_str[2]);
				
				String[] end_str = sc.next().split(":");
				final int end = (Integer.parseInt(end_str[0]) * 60 + Integer.parseInt(end_str[1])) * 60 + Integer.parseInt(end_str[2]);
				
				imos[start]++;
				if(end < MAX){
					imos[end]--;
				}
			}
			
			int max = 0;
			for(int i = 1; i < MAX; i++){
				imos[i] += imos[i-1];
				max = Math.max(max, imos[i]);
			}
			
			System.out.println(max);
		}
	}

}

Measured memory_bytes: 100388
#include <stdio.h>
int main (void) {
double a, b, c, pi;
scanf ("%lf",&a);
pi = 3.141592653589;
a = 1.00000*a;
b = a * a * pi;
c = 2 * a * pi;
printf("%f %f\n",b ,c);

return 0;
}

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

int main() {
  LL N, ans;
  vector<LL> a(5);
  cin >> N;
  for (int i = 0; i < 5; i ++) cin >> a[i];
  sort(a.begin(), a.end());

  LL x = N / a[0];
  if (N % a[0] != 0) x ++;

  ans = x + 4;

  cout << ans << endl;
}

Measured memory_bytes: 256
/* ***********************************************
Author        :yang12138
Created Time  :2018年01月14日 星期日 20时14分00秒
File Name     :B.cpp
************************************************ */
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long ll;
typedef pair<int,int>pii;
#define lson (root<<1)
#define rson (root<<1|1)

const int N=1e5+10;
const ll INF=1e18;
int a[N],n;

ll getans(ll x){
	for(int i=1;i<=n;i++){
		x=(x/a[i])*a[i];
	}
	return x;
}

ll getmin(){

	ll l=2,r=INF;
	while(l<r){
		ll m=(l+r)>>1;
		if(getans(m)>=2) r=m;
		else l=m+1;
	}
	if(getans(l)!=2) return -1;
	return l;
}

ll getmax(){

	ll l=2,r=INF;
	while(l<r){
		ll m=(l+r+1)>>1;
		if(getans(m)>2) r=m-1;
		else l=m;
	}
	if(getans(l)!=2) return -1;
	return l;
}

void solve(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",a+i);

	ll l=getmin();
	if(l==-1) printf("-1\n");
	else{
		printf("%lld %lld\n",l,getmax());
	}
}

int main(){
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    
	solve();
    return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
int main(){
	int n;
	int a[200009];
	scanf("%d",&n);
	for(int i = 1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	if(n==1) printf("%d\n",a[1]);
	else{
		printf("%d",a[n]);
		if(n%2==0){
			for(int i = n-2;i>0;i=i-2){
				printf(" %d",a[i]);
			}
			for(int i = 1;i<n;i=i+2){
				printf(" %d",a[i]);
			}
		}
		else{
			for(int i = n-2;i>0;i=i-2){
				printf(" %d",a[i]);
			}
			for(int i = 2;i<n;i=i+2){
				printf(" %d",a[i]);
			}	
		}
		printf("\n");
	}
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1.0);

int main()
{
    int m;
    cin >> m;
    cout << 24 + 24 - m << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

const long long mod = pow(10, 9) + 7;

int main() {
	int N; cin >> N;
	bool x = 0;
	for (int i = 1; i < 10; i++) {
		int n = N;
		if (N%i != 0)continue;
		n /= i;
		if (n < 10)x = 1;
	}
	if (x == 1)cout << "Yes" << endl;
	else cout << "No" << endl;
}





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

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

int main() {
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;
    long long ans1, ans2, ans3;
    ans1 = A * X + B * Y;
    if (X < Y) {
        ans2 = 2 * C * X + B * (Y - X);
    } else {
        ans2 = 2 * C * Y + A * (X - Y);
    }
    ans3 = 2 * C * max(X, Y);
    cout << min(ans1, min(ans2, ans3)) << endl;
}

Measured memory_bytes: 3644
// #include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
// using namespace __gnu_pbds;
// template <class c, class cmp = less<c> > using ordered_set = tree<c, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::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...);
}
#else
#define trace(...) 
#endif
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template <typename T,typename U>pair<T,U> operator+(const pair<T,U> & l,const std::pair<T,U> & r) { return {l.first+r.first,l.second+r.second};}
typedef long long int ll;
const ll mod =1e9+7;
const int maxn = 81;
#define endl '\n'
#define ld long double
//#define int ll
#define all(x)  (x).begin(),(x).end()

int32_t main(){

  IOS

  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0;i<n; i++) cin >> a[i];
  deque<int> dq;
  for(int i = 0; i<n; i++){
    if(i%2 == 0) dq.push_back(a[i]);
    else dq.push_front(a[i]);
  }

  while(!dq.empty()){
    if(n%2 == 0) {
      cout << dq.front() << " ";
      dq.pop_front();
    }
    else{
      cout << dq.back() <<" ";
      dq.pop_back();
    }
  }


  




  

  
    
}



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

# issafe => 0段目からN段目まで, 安全ならTrue, 壊れているならFalse
issafe = [1] * (N+1)
for i in range(M):
  a = int(input())
  issafe[a] = 0

# dp => 0段目からN段目まで, その移動方法の数
dp = [0] * (N+1)
dp[0] = 1
if issafe[1]: dp[1] = 1
for i in range(2, N+1):
  if issafe[i-1]: dp[i] += dp[i-1]
  if issafe[i-2]: dp[i] += dp[i-2]
  dp[i] %= 10**9+7
    
print(dp[N])

Measured memory_bytes: 13404
n=int(input())
v=list(map(int,input().split()))

odd=[0]*(10**5+1)
even=[0]*(10**5+1)
for i in range(0,n,2):
    odd[v[i]]+=1
for i in range(1,n+1,2):
    even[v[i]]+=1

odd_mx=0
odd_sec=0
even_mx=0
even_sec=0
for i in range(len(odd)):
    if odd[i]>odd_mx:
        odd_sec=odd_mx
        odd_mx=odd[i]
        odd_idx=i
    elif odd[i]>odd_sec:
        odd_sec=odd[i]
for i in range(len(even)):
    if even[i]>even_mx:
        even_sec=even_mx
        even_mx=even[i]
        even_idx=i
    elif even[i]>even_sec:
        even_sec=even[i]

if odd_idx!=even_idx:
    ans=n-(odd_mx+even_mx)
elif odd_mx==even_mx and odd_sec==0 and even_sec==0:
    ans=n//2
else:
    a=max(even_mx+odd_sec,odd_mx+even_sec)
    ans=n-a

print(ans)

Measured memory_bytes: 20756
#include<iostream>
using namespace std;
int main(){
  int x1,y1,x2,y2;
  int a ,b;
  cin >> x1 >> y1 >> x2 >> y2;
  a = x2 - x1,b = y2 - y1;
  cout << x2 - b << " " << y2 + a << " "
       << x1 - b << " " << y1 + a << endl;

  return 0;
}

Measured memory_bytes: 256
module app;

import core.bitop;

import std.algorithm;
import std.array;
import std.bigint;
import std.container.rbtree;
import std.conv;
import std.stdio;
import std.string;
import std.traits;

struct Input
{
	string s;
}

void parseInput(T)(out Input input, T file)
{
	with (file) with (input)
	{
		s = readln().strip();
	}
}

auto main2(Input* input)
{
	with (input)
	{
        switch (s)
        {
            case "hi":
            case "hihi":
            case "hihihi":
            case "hihihihi":
            case "hihihihihi":
                return "Yes";
            default:
                return "No";
        }
	}
}

alias retType = ReturnType!main2;
static if (!is(retType == void))
{
	unittest { writeln("begin unittest"); }
	auto _placeholder_ = ReturnType!main2.init;

	unittest // example1
	{
		string example =
`hihi`;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == "Yes");
	}

	unittest // example2
	{
		string example =
`hi`;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == "Yes");
	}

	unittest // example3
	{
		string example =
`ha`;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == "No");
	}

	unittest { writeln("end unittest"); }

	void parseExample(out Input input, string example)
	{
		struct Adapter
		{
			string[] _lines;
			this(string input) { _lines = input.splitLines(); }
			string readln() { auto line = _lines[0]; _lines = _lines[1..$]; return line; }
		}
		parseInput(input, Adapter(example));
	}
}

void printResult(T)(T result)
{
	static if (isFloatingPoint!T) writefln("%f", result);
	else writeln(result);
}

void main()
{
	Input input = void;
	parseInput(input, stdin);
	static if (is(retType == void))
		main2(&input);
	else
	{
		auto result = main2(&input);
		printResult(result);
	}
}


Measured memory_bytes: 256
mod = 10**9 + 7
from collections import deque

def main():
    N, Q = iip(listed=False)

    ql = [0 for i in range(N)]
    ll = [[] for i in range(N)]

    for i in range(N-1):
        a, b = iip(True)
        ll[a-1].append(b-1)
        ll[b-1].append(a-1)

    for i in range(Q):
        p, x = iip(True)
        ql[p-1] += x

    que = deque([])
    que.append((0, None))

    result = [None for i in range(N)]
    while que:
        data = que.popleft()
        node = data[0]
        before_node = data[1]
        if before_node is None:
            before_num = 0
        else:
            before_num = result[before_node]

        result[node] = before_num + ql[node]

        for child in ll[node]:
            if child != before_node:
                que.append((child, node))


    print(" ".join([str(i) for i in result]))




#####################################################ライブラリ集ここから

def searchsorted(sorted_list, n, side):
    if side not in ["right", "left"]:
        raise Exception("sideはrightかleftで指定してください")

    l = 0
    r = len(sorted_list)

    while r-l > 1:
        x = (l+r)//2
        if sorted_list[x] > n:
            r = x
        elif sorted_list[x] < n:
            l = x
        else:
            if side == "left":
                r = x
            elif side == "right":
                l = x

    if side == "left":
        return r
    if side == "right":
        return l+1



def iip(listed):
    ret = [int(i) for i in input().split()]
    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def soinsuu_bunkai(n):
    ret = []
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):
    if n <=0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n-r+1, n+1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r+1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        #print(f"{n}C{r} = {ret}")
        pass
    return ret


def inv(n, mod):
    return power(n, mod-2)

def power(n, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p//2) ** 2) % mod
    if p % 2 == 1:
        return (n * power(n, p-1)) % mod


if __name__ == "__main__":
    main()

Measured memory_bytes: 129272
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N=0,X=0,Y=0,result=0;
    cin>>N;
    X=(N/15)*200;
    Y=N*800;
    result=Y-X;
    cout<<result<<"\n";
    return 0;
 
}

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

int main(){
    ll n;
    cin >> n;
    ll res = LINF;
    for (ll i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            chmin(res, n/i + i - 2);
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include <vector>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
#define PI 3.141592653589793
using vll = vector<ll>;
using Graph = vii;
const ll MOD = 1e9 + 7;

int main() {
	ll n;
	cin >> n;
	vll a(n);
	rep(i, n) cin >> a[i];
	ll cnt = 1;
	bool f = true;
	rep(i, n) {
		if (a[i] == 1) {
			f = false;
			break;
		}
	}
	if (f) {
		cout << -1 << endl;
		return 0;
	}
	rep(i, n) {
		if (a[i] == cnt) {
			cnt++;
		}
	}
	cout << n - cnt + 1 << endl;
}


Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld  double
#define mod 1000000007
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
int n,m;
char arr[1000+9][1000+9];
ll dp[1000+9][1000+9];
bool val(int x , int y){
    return (x <n && x>-1 && y <m && y>-1);
}
ll solve(int i , int j) {
    if(j == m-1 && i == n-1)
        return 1;
    ll a= 0;
    if(dp[i][j] != -1)
        return dp[i][j];
    if(val(i,j+1) && arr[i][j+1] =='.')
        a += solve(i,j+1)%mod;
    if(val(i+1,j)&& arr[i+1][j] =='.')
        a += solve(i+1,j)%mod;
    return dp[i][j] = a%mod;
}
int main() {
    cin>>n>>m;
    for(int i = 0;i<n;i++){
        for(int j = 0;j<m;j++){
            cin>>arr[i][j];
        }
    }
    memset(dp,-1,sizeof dp);
    cout<<solve(0,0)%mod;
    return 0;
}


Measured memory_bytes: 9216
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define sc second
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
	int n, x;
	scanf("%d %d", &n, &x);
	
	int candy[n], ct = 0;
	for(int i = 0; i < n; i++) scanf("%d", &candy[i]);
	sort(candy, candy + n);
	
	for(int i = 0; i < n; i++){
		if(x < candy[i]) break;	
		x -= candy[i];
		ct++;
	}
	if(x > 0 and ct == n) ct--;
	printf("%d\n", ct);
}

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

using namespace std;

int main(){

   int cnt = 0;
   int data[10001][2];   

   for(;;){
      cin >> data[cnt][0] >> data[cnt][1];
      if(data[cnt][0] == 0 && data[cnt][1] == 0){
         break;
      }
      cnt++;
   }

   for(int i = 0; i < cnt; i++){
      if(data[i][0] < data[i][1]){
         cout << data[i][0] << " " << data[i][1] << endl;
      }
      else{
         cout << data[i][1] << " " << data[i][0] << endl;
      }
   }

   return 0;
}


Measured memory_bytes: 3140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < x; i++)
#define repn(i, x) for (long long i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
vector<pair<string, P> > vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long N, long long K, long long C, string S) {
    ll d1[K], d2[K];
    ll idx = 0;
    rep(i, N) {
        if (S[i] == 'o') {
            d1[idx] = i;
            i += C;
            idx++;
        }
        if (idx >= K) break;
    }
    idx = 0;
    rep(i, N) {
        if (S[N - 1 - i] == 'o') {
            d2[K - 1 - idx] = N - 1 - i;
            i += C;
            idx++;
        }
        if (idx >= K) break;
    }
    rep(i, K) {
        // cout << d1[i] << " " << d2[i] << endl;
        if (d1[i] == d2[i]) cout << d1[i] + 1 << endl;
    }
}

int main() {
    long long C;
    long long N;
    long long K;
    string S;
    scanf("%lld", &N);
    scanf("%lld", &K);
    scanf("%lld", &C);
    cin >> S;
    solve(N, K, C, S);
    return 0;
}


Measured memory_bytes: 5124
#include <algorithm>
#include <bitset>
#include <boost/dynamic_bitset.hpp>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <vector>

#define DEBUG(x) cout << #x << ": " << x << endl
#define INFILE() freopen("input.txt", "r", stdin)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define ALL(s) begin(s), end(s)
#define RALL(s) rbegin(s), rend(s)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_i = pair<ll, int>;
using i_ll = pair<int, ll>;
using d_i = pair<double, int>;
using ll_ll = pair<ll, ll>;
using d_d = pair<double, double>;

static constexpr ll LL_MOD = 1000000009;
static constexpr int I_MOD = 1000000007;
static constexpr double EPS = numeric_limits<double>::epsilon();
static constexpr double PI = 3.14159265358979323846264338327950288;

template <class T> static void scan(vector<T> &v);
static void scan(vector<string> &v, bool isWord = true);
static boost::dynamic_bitset<> scan(char trueValue = 'o');

int main(int argc, char *argv[]) {
	// INFILE();
	int n;
	cin >> n;
  string s;
  cin >> s;

  int x = 0, maxVal = 0;
	REP(i, 0, (int)s.size()) {
    if (s[i] == 'I') {
      x++;
      maxVal = max(maxVal, x);
      continue;
    }

    x--;
    maxVal = max(maxVal, x);
  }

  cout << maxVal << "\n";
  return 0;
}

template <class T> static void scan(vector<T> &v) {
  map<type_index, const char *const> m = {{typeid(int), "%d"},
                                          {typeid(ll), "%lld"},
                                          {typeid(double), "%lf"},
                                          {typeid(char), "%c"}};

  auto tFormat = m[typeid(T)];

  for (T &n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string> &v, bool isWord) {
  if (isWord) {
    for (auto &n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

static boost::dynamic_bitset<> scan(char trueValue) {
  string s;
  getline(cin, s);

  if (s.size() == 0) {
    getline(cin, s);
  }

  for_each(begin(s), end(s),
           [trueValue](char &c) { c = (c == trueValue) ? '1' : '0'; });
  return boost::dynamic_bitset<>(string(rbegin(s), rend(s)));
}


Measured memory_bytes: 256
/*
#include<rabbit>;
using blueHulkStress;
using AceOfSpades;
*/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = (1e-9);
typedef long long ll;
typedef unsigned long long ull;
#define flush fflush(stdout), cout.flush()
#define all(v) ((v).begin()),((v).end())
#define rall(v) ((v).rbegin()),((v).rend())
#define clr(v,line) memset(v,line,sizeof(v))
#define rep(i,n) for(int(i)=0;(i)<(int)(n);(i)++)
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define P 1000000007
#define endl '\n'
const int dx[] = {1,-1,0,0,1,-1,1,-1};
const int dy[] = {0,0,1,-1,1,-1,-1,1};
const int dxhorse[] = {-2,-2,-1,-1,1,1,2,2};
const int dyhorse[] = {1,-1,2,-2,2,-2,1,-1};


int main(int argc, char const *argv[])
{
	
	string s;cin>>s;
	int ans = s[0]-'0';
	for(int i=1;i<(int)s.size();i++)ans^=s[i]-'0';
	cout<<(ans?"No":"Yes");
}

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

int main(){
  int L,R,n;
  cin>>L>>R>>n;
  int cnt=0;
  
  for(int i=L;i<R+1;i++){
    if(i%n==0) cnt++;
  }
  cout<<cnt<<endl;
    
return 0;
}



Measured memory_bytes: 3592
#!/usr/bin/env ruby

INF = 1e100

x0, y0, x1, y1 = gets.split.map(&:to_i)
n = gets.to_i
xs = [x0, x1]
ys = [y0, y1]
rs = [0, 0]
n.times{
	x, y, r = gets.split.map(&:to_i)
	xs.push(x)
	ys.push(y)
	rs.push(r)
}

used = Array.new(n + 2)
ds = Array.new(n + 2, INF)
ds[0] = 0
u = 0
while u >= 0
	used[u] = true
	v = -1
	t = INF
	(n + 2).times{|i|
		next if used[i]
		d = ds[u] + [Math.hypot(xs[u] - xs[i], ys[u] - ys[i]) - (rs[u] + rs[i]), 0].max
		ds[i] = d if ds[i] > d
		if t > ds[i]
			t = ds[i]
			v = i
		end
	}
	u = v
end

puts ds[1]


Measured memory_bytes: 1916
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }

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

#define P pair<int,int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define st std::string 
#define pb push_back 
#define ll long long 
#define pq(x) std::priority_queue<x> 
#define ultapq(x) priority_queue<x,vector<x>,greater<x>> 
#define show_pq(x,n) for(int i = 0; i < n; i++){cout<<x.top(); x.pop();} 
#define itrt(yo) for(auto x:yo){std::cout<<x<<" ";} 
#define vec(x) std::vector<x> 
#define nl '\n' 
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define ALL(x) x.begin(),x.end() 
#define just int i= 0; i<n ; i++


void solve(){
    int a,b;
    char c;
    cin>>a>>c>>b;

    if (c=='-')
    {
        cout<<a-b;
    }else
    {
        cout<<a+b;
    }
    
    
}


int main()
{
    IOS;
    int t=1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    
}

    

    
	

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
  
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}
  
int main()
{
  int i;
  int ans = 0;
  int cnt = 0;
  int n; cin >> n;
  int k; cin >> k;
  string s; cin >> s;
  int t[n] = {};
  vector<int> a;
  rep(i,n){
      t[cnt]++;
      if(i<n-1 && s[i] != s[i+1]){cnt++;}
  }
  if(cnt == 0){cout << n-1 << endl; return 0;}

  cnt++;
  rep(i,cnt){
      ans += t[i] - 1;
  }
  ans += k * 2;
  ans = min(ans, n-1);
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll INF = 1000000000000000000LL;
using namespace std;


int main() {
    ll a,b,x;
    cin >> a >> b >> x;

    ll res;
    res = b/x - a/x + (a%x == 0); 
    
    cout << res << endl;

    return 0;
}



Measured memory_bytes: 256