akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
//#include<cmath>
//#include<algorithm>
//#include<cstring>
//#include<map>
using namespace std;
inline int read()
{
    int p=0,f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9'){p=p*10+c-'0';c=getchar();}
    return f*p;}
int c[4][4];
int main()
{
	for(int i=1;i<=3;i++)
	   for(int j=1;j<=3;j++)
	       c[i][j]=read();
	for(int a1=0;a1<=100;a1++)
	   {int b11=c[1][1]-a1,b21=c[2][1]-a1,b31=c[3][1]-a1;
	    for(int a2=0;a2<=100;a2++)
	       {int b12=c[1][2]-a2,b22=c[2][2]-a2,b32=c[3][2]-a2;
	        if(b11!=b12||b21!=b22||b31!=b32)continue;
	        for(int a3=0;a3<=100;a3++)
	           {int b13=c[1][3]-a3,b23=c[2][3]-a3,b33=c[3][3]-a3;
				if(b11==b13&&b21==b23&&b31==b33){cout<<"Yes";return 0;}
			   }
	       }
	   }	
    cout<<"No";
	return 0;
}

Measured memory_bytes: 256
//include
//--------------------------------------------------
#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<ctime>

using namespace std;

//conversion
//--------------------------------------------------
inline int toInt(const string &s){
    int v;istringstream sin(s);sin>>v;
    return v;
}
template<class T> inline string toString(T x){
    ostringstream sout;sout<<x;
    return sout.str();
}

//math
//--------------------------------------------------
template<class T> inline T sqr(T x){return x*x;}

//typedef
//--------------------------------------------------
typedef vector<int>VI;
typedef vector<VI>VVI;
typedef vector<string>VS;
typedef pair<int,int>PII;
typedef long long LL;

//container util
//--------------------------------------------------
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//--------------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

//constant
//--------------------------------------------------
const int INF=1e9+7;
const int dx[]={0,-1,0,1};
const int dy[]={-1,0,1,0};

//clear memory
#define CLR(a) memset((a),0,sizeof(a))

//debug
#define dump(x) cerr<<#x<<" = "<<(x)<<endl
#define debug(x) cerr<<#x<<" = "<<(x)<<"(L"<<__LINE__<<")"<<endl

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


int N,W,H;
int xs[100000];
int ys[100000];
int wids[100000];

bool solve(){
    int ximos[100001]={0};
    int yimos[100001]={0};
    REP(i,N){
        ximos[max(0,xs[i]-wids[i])]++;
        ximos[min(W,xs[i]+wids[i])]--;
        yimos[max(0,ys[i]-wids[i])]++;
        yimos[min(H,ys[i]+wids[i])]--;
    }
    bool flag=true;
    REP(i,W){
        ximos[i+1]+=ximos[i];
        if(ximos[i]==0)flag=false;
    }
    if(flag)return true;
    REP(i,H){
        yimos[i+1]+=yimos[i];
        if(yimos[i]==0)return false;
    }

    return true;
}


int main(){
    cin>>N>>W>>H;
    REP(i,N)cin>>xs[i]>>ys[i]>>wids[i];
    cout<<(solve()?"Yes":"No")<<endl;

    return 0;
}

Measured memory_bytes: 3116
# input
n = int(input())
a = [int(i) for i in input().split()]
ans = 1
nowmin = a[0]

# main
if n != 1:
  for i in range(1, n):
    if a[i] < nowmin:
      ans += 1
      nowmin = a[i]
    if nowmin == 1:
      break

# output
print(ans)


Measured memory_bytes: 24744
package main

import (
	"fmt"
)

func dfs(m byte, n int, s []byte) {
	if len(s) == n {
		fmt.Println(string(s))
		return
	}
	for i := byte('a'); i <= m; i++ {
		dfs(m, n, append(s, i))
	}
	m++
	dfs(m, n, append(s, m))
}

func main() {
	var n int
	fmt.Scan(&n)
	s := make([]byte, 0, n)
	s = append(s, 'a')
	dfs('a', n, s)
}


Measured memory_bytes: 5504
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<bitset>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//等差数列の和
ll fact(ll x, ll k, ll p) {//最大値、個数、あまり
	ll sum = 1;
	for (int i = 0; i < k; i++) {
		sum *= (x--);
		sum %= p;
	}
	return sum;
}//階乗(正）
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res*x%p;
		x = x*x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
short ctos(char a) {
	return (int)(a - '0');
}
#define int long long
const long long Inf = 4523372036854775807;
const int inf = 15000000000;
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	int n,m;
	cin>>n>>m;
	if(n<2&&m<2){
		cout<<1<<endl;
	}
	else if(n<2){
		cout<<m-2<<endl;
	}
	else if(m<2){
		cout<<n-2<<endl;
	}
	else{
		cout<<n*m-2*n-2*m+4<<endl;
	}
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void)
{
	int i, n, k, d, min;
	cin>>k>>n;
	int a[n];
	for(i=0; i<n; i++)
	{cin>>a[i];}
	min = a[n-1]-a[0];
	for(i=1; i<n; i++){
		d = k-(a[i]-a[i-1]);
		if(d<min){
			min = d;
		}
	}
	cout<<min;
	
}


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

#define ll long long int

typedef pair<ll,ll> pii;

#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define vvl vector<vector<ll,ll> >
#define vvs vector<vector<string> >
#define pb push_back
#define mk make_pair
#define sbit(a)  __builtin_popcount(a)
#define f(i,a,n) for(i=a;i<n;i++)
#define fb(i,a,n) for(i=a;i>=n;i--)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define nextp(s) next_permutation(s.begin(), s.end()); 
#define ignor cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define bsearch(a,x) binary_search(a.begin(),a.end(),x)
#define ini ll i,j,k,l,m,n,x,y,sm=0,cnt=0
const ll mod=1e9+7;
const double pi=acos(-1);


bool prime[1000000];
void sieve(ll n) 
{ 
    memset(prime, true, sizeof(prime)); 
  
    for (ll p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (ll i=p*2; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
} 

ll primefunc(ll n)
{
    ll i;
    if(n<2)
    return 0;
    f(i,2,sqrt(n)+1)
    {
        if(n%i==0)
        return 0;
    }
    return 1;
}

ll bs(ll arr[], ll l, ll r, ll x)
{
   if (r >= l)
   {
        ll mid = l + (r - l)/2;
        if (arr[mid] == x)  
            return mid;
        if (arr[mid] > x) 
            return bs(arr, l, mid-1, x);
        return bs(arr, mid+1, r, x);
   }
   return -1;
}


ll moex(ll x,ll n,ll mod)

{
    
	if(n==0)
        
       		return 1;
    
	else if(n%2 == 0)   
        	
		return moex((x*x)%mod,n/2,mod);
    
	else 
              return (x*moex((x*x)%mod,(n-1)/2,mod))%mod;

}


ll modi(ll a, ll m) 
{ 
      	ll k=moex(a, m-2, m); 
	return k;
} 

void subString(string s, int n) 
{
    for (int i = 0; i < n; i++) 
        for (int len = 1; len <= n - i; len++)
            cout << s.substr(i, len) << endl;
}


int main(){
    	fast;
        ll t;
        cin>>t;
			cout << 3*t*t<<endl;      
       
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int i = 0;
		int j = 0;
		int f = 0;
		int s = 0;
		//２つのサイコロを用意
		int dice1[] = new int[6];
		int dice2[] = new int[6];

		for (i = 0; i < 6; i++) {
			dice1[i] = sc.nextInt();
		}
		for (i = 0; i < 6; i++) {
			dice2[i] = sc.nextInt();
		}
		for (i = 0; i <= 6; i++) {
			//１と６が同じなら次へ
			if (dice1[0] == dice2[0] && dice1[5] == dice2[5]) {
				//他の数字も回していく
				for (j = 0; j < 4; j++) {
					if (dice1[1] == dice2[1] && dice1[2] == dice2[2] && dice1[3] == dice2[3] && dice1[4] == dice2[4]) {
						//色づけする
						f = 1;
						break;
					}
					s = dice2[1];
					dice2[1] = dice2[2];
					dice2[2] = dice2[4];
					dice2[4] = dice2[3];
					dice2[3] = s;
				}
			}
			if (i % 2 == 0) {
				s = dice2[0];
				dice2[0] = dice2[1];
				dice2[1] = dice2[5];
				dice2[5] = dice2[4];
				dice2[4] = s;
			}

			else {
				s = dice2[0];
				dice2[0] = dice2[3];
				dice2[3] = dice2[5];
				dice2[5] = dice2[2];
				dice2[2] = s;
			}
			if (f == 1) {
				break;
			}
		}
		//あっている場合出力
		if (f == 1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 26288
import qualified Data.ByteString.Char8 as BS
import           Data.List
import           Data.Maybe

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

solve :: Integer -> [Integer] -> Integer
solve n [] = n
solve n xs = head [n + b * a | a <- [1..n], b <- [-1, 0, 1], (n + b * a) `notElem` xs]

main :: IO ()
main = do
  [n,m] <- getIntList
  fl <- if m == 0 then return [] else getIntList
  print $ solve n fl


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

using namespace std;

const int MAXN=4e3+1;

int n,sum[MAXN][3]={0};
string s;
long long ans=0;

int main() {
	ios::sync_with_stdio(0);
	cin>>n>>s;
	for(int i=0,j; i<n; ++i) {
		for(j=0; j<3; ++j) sum[i][j]=sum[i-1][j];
		if(s[i]=='R') sum[i][0]+=1;
		else if(s[i]=='G') sum[i][1]+=1;
		else sum[i][2]+=1;
	}
	for(int i=0,j,del; i<n-2; ++i)
		for(j=i+1; j<n-1; ++j) {
			if(s[i]==s[j]) continue;
			del=0;
			if(s[i]=='R') {
				if(s[j]=='G') {
					if(2*j-i<n && s[2*j-i]=='B') del=1;
					ans+=sum[n-1][2]-sum[j][2];
				}
				if(s[j]=='B') {
					if(2*j-i<n && s[2*j-i]=='G') del=1;
					ans+=sum[n-1][1]-sum[j][1];
				} 
			}
			if(s[i]=='G') {
				if(s[j]=='R') {
					if(2*j-i<n && s[2*j-i]=='B') del=1;
					ans+=sum[n-1][2]-sum[j][2];
				}
				if(s[j]=='B') {
					if(2*j-i<n && s[2*j-i]=='R') del=1;
					ans+=sum[n-1][0]-sum[j][0];
				} 
			}
			if(s[i]=='B') {
				if(s[j]=='G') {
					if(2*j-i<n && s[2*j-i]=='R') del=1;
					ans+=sum[n-1][0]-sum[j][0];
				}
				if(s[j]=='R') {
					if(2*j-i<n && s[2*j-i]=='G') del=1;
					ans+=sum[n-1][1]-sum[j][1];
				} 
			}
			ans-=del;
		}
	cout<<ans<<endl;
	return 0;
}

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

int main()
{
  int a,b,c;
  cin>>a>>b>>c;
  if((((a==b)&&(a!=c))||((a==c)&&(a!=b)))||((b==c)&&(a!=b)))
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i=(a); i<(b); i++)

int main() {
  int c[9];
  FOR(i, 0, 9) cin >> c[i];
  int a21, a31 ,b21, b31; //a2-a1みたいな感じ
  a21 = c[1]-c[0];
  a31 = c[2]-c[0];
  b21 = c[3]-c[0];
  b31 = c[6]-c[0];

  if (c[4] == (a21 + b21 + c[0])) {
    if (c[5] == (a31 + b21 + c[0])) {
      if (c[7] == (a21 + b31 + c[0])) {
        if (c[8] == (a31 + b31 + c[0])) {
          cout << "Yes" <<endl;
          return 0;
          
        }
      }
    }
  }
  
  cout << "No" << endl;
  return 0;
}




Measured memory_bytes: 3628
from collections import deque
q = deque()
N, M = map(int, input().split())

pref = [[0] for i in range(N+1)]
for i in range(M):
    p, y = map(int, input().split())
    pref[p].append(y)
    q.append((p, y))
for p in pref:
    p.sort()
import bisect
for p, y in q:
    print('%06d%06d'%(p, bisect.bisect_left(pref[p], y)))

Measured memory_bytes: 31104
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


int main()
{
	string str;
	while(getline(cin, str))
	{
		rep(i, 26)
		{
			rep(j, str.size())
				if(str[j] != ' ' && str[j] != '.')
					str[j] = (++str[j] > 'z' ? 'a' : str[j]);
		
			if(str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos)
			{
				cout << str << endl;
				break;
			}
		}
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
int n;

#define FOR(i,a,b) for(int i = (a); i <(b); ++i)

constexpr int MAXN = 100;

int main() {
    std::cin >> n;
    FOR(i,0,n) {
        std::string S;
        std::cin >> S;
        if (S == "Y") {
            std::cout << "Four" << std::endl;
            return 0;
        }
    }
    std::cout << "Three" << std::endl;
    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
using sint = int64_t;

template<class T> T read() {
	T t;
	cin >> t;
	return t;
}

template<class T> vector<T> read_vector(sint n) {
	vector<T> vs;
	for (sint i = 0; i < n; ++i) {
		vs.push_back(read<T>());
	}
	return vs;
}

inline void write() {
}

template<class T> void write(T const& t) {
	cout << t;
}

template<class T> void write(vector<T> const& ts) {
	if (ts.size() > 0) {
		cout << ts[0];
	}
	for (size_t i = 1; i < ts.size(); ++i) {
		cout << ' ' << ts[i];
	}
}

template<class T, class... Args> void write(T const& t, Args const&... args) {
	cout << t << ' ';
	write(args...);
}

template<class... Args> void writeln(Args const&... args) {
	write(args...);
	cout << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
	cin .exceptions(ios_base::badbit | ios_base::failbit);
	cout.exceptions(ios_base::badbit | ios_base::failbit);
	cin .tie(nullptr);
	cout.tie(nullptr);
	cout.precision(16);
	void run();
	run();
	return 0;
}

vector<sint> factors(sint n) {
	vector<sint> fs;
	sint i_max = sint(sqrt(double(n))) + 1;
	sint i = 2;
	while (i <= i_max) {
		if (n % i == 0) {
			fs.push_back(i);
			n /= i;
		}
		else {
			++i;
		}
	}
	if (n > 1) {
		fs.push_back(n);
	}
	return fs;
}

void run() {
	auto const A = read<sint>();
	auto const B = read<sint>();
	auto fa = factors(A);
	auto fb = factors(B);
	auto fae = unique(fa.begin(), fa.end());
	auto fbe = unique(fb.begin(), fb.end());
	vector<sint> rs;
	set_intersection(fa.begin(), fae, fb.begin(), fbe, back_inserter(rs));
	writeln(rs.size() + 1);
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
#include <functional>
#include <queue>

using namespace std;

constexpr int MOD = 1000000007;
constexpr int INF = 1050000000;

int main() {
	int n, q; cin >> n >> q;
	string s; cin >> s;

	int a[100000 + 1];
	memset(a, 0, sizeof(a));

	for (int i = 0; i < n - 1; i++) {
		if (s[i] == 'A' && s[i + 1] == 'C') {
			a[i + 1]++;
		}
	}

	for (int i = 0; i < n - 1; i++) {
		a[i + 1] = a[i] + a[i + 1];
	}


	for (int i = 0; i < q; i++) {
		int l, r; cin >> l >> r;

		cout << a[r-1] - a[l-1] << endl;
	}








}

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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    string S;
    cin >> S;

    if (S[0] == 'S') {
        cout << "Cloudy" << endl;
    } else if (S[0] == 'C') {
        cout << "Rainy" << endl;
    } else {
        cout << "Sunny" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FOR0(i,n) for(int i=0;i<n;i++)
#define FOR1(i,n) for(ll i=1;i<=n;i++)
#define FORl(i,l,n) for(ll i=l;i<n;i++)
using namespace std;
#define pi pair<ll, ll>
#define pb push_back
#define ll long long
#define ld long double	
#define ff first
#define ss second
#define mp make_pair
#define mst0(x) memset(x,0,sizeof(x));
#define vi vector<ll>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define sp <<" "<<
#define intmax 1e18
ll power(ll num, ll g, ll mod) {
	if (g == 0)return 1;
	if (g % 2 == 1)return (num * power((num * num) % mod, g / 2, mod)) % mod;
	return power( (num * num) % mod, g / 2, mod);
}

bool comp(pi a, pi b){
	return a.ss - a.ff > b.ss - b.ff;
}

int main(){
	int n;
	cin >> n;
	ll val = 0;
	vector<pi> pos, neg, zer;
	FOR0(i, n){
		string s;
		cin >> s;
		val = 0;
		ll mini = 0;
		for(auto c : s){
			if (c == '(') {
				val++;
			}
			else{
				val--;
			}
			mini = min(mini, val);
		}
		if (val>0) pos.pb({mini, val});
		else if (val == 0) zer.pb({mini, val});
		else neg.pb({mini, val});
		// cout << mini << " " << val << endl;
	}
	sort(pos.begin(), pos.end(), greater<pi>());
	sort(neg.begin(), neg.end(), comp);
	val = 0;
	int i = 0;
	while(i < pos.size() && val + pos[i].ff >= 0){
		val += pos[i].ss;
		i++;
	}
	if (i != pos.size()){
		cout << "No";
		return 0;
	}
	i = 0;
	while(i < zer.size() && val + zer[i].ff >= 0){
		i++;
	}
	if (i != zer.size()){
		cout << "No";
		return 0;
	}
	i = 0;
	while(i < neg.size() && val + neg[i].ff >= 0){
		val += neg[i].ss;
		i++;
	}
	if (i != neg.size() || val != 0){
		cout << "No";
		return 0;
	}
	cout << "Yes";


}

Measured memory_bytes: 19136
#include <stdio.h>

char s[5001], t[6];
int sl, tl;
int k, i, iM, j;
char c[6];
inline int strin() {
  i = 0;
  iM = sl - tl;
  while (i <= iM) {
    for (j = 0; j < tl; ++j) {
      if (s[i + j] != t[j]) goto continue_while;
    }
    return 1;
  continue_while:
    ++i;
  }
  return 0;
}
void solve() {
  if (!strin()) return;
  if (k == 0) {
    printf("%s\n", t);
    k = -1;
    return;
  }
  --k;
  ++tl;
  for (c[tl] = 'a'; c[tl] <= 'z'; ++c[tl]) {
    t[tl - 1] = c[tl];
    solve();
    if (k < 0) return;
  }
  --tl;
  t[tl] = 0;
}
int main() {
  scanf("%s", s);
  sl = 5000;
  while (sl - i > 1) {
    j = (sl + i) >> 1;
    if (s[j]) {
      i = j;
    } else {
      sl = j;
    }
  }
  scanf("%d", &k);
  solve();
}


Measured memory_bytes: 1616
#include<bits/stdc++.h>
using namespace std;
void fast(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
}

int main(){
	fast();	
	int n , k;
	cin >> n >> k;
	vector<int>a(n);
	for(int i = 0; i < n; ++i){
		cin >> a[i];
	}
	sort(a.begin() , a.end());
	long long sum = 0;
	for(int i = 0; i < n - k; ++i){
		sum += a[i];
	}
	cout << sum << "\n";
}


Measured memory_bytes: 1024
// MAGRANT - GNC19 - TEMPLATE 3.1
// 2017/8/19 - AtCoder Regular Contest 059 - C
// PRACTISING TIME TAGS:
// ALGORITHM: ##MIN, STARTED AT:
// CODING: ##MIN, STARTED AT:
// SUMMARY: [MISTAKES / REQUISITES]

// FOR COMPATIBILITY:
#define _CRT_SECURE_NO_WARNINGS

// UNIVERSAL DEFINITIONS:
#define N (1<<17)
#define MODULO (1000000007)
#define HA1 (2420609)
#define HA2 (19260817)

// FREQUENT HEADER FILES:
#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <complex>
using namespace std;

// TEMPLATE BEGINS HERE.
//#define MAGRANT_ALLOWS_CTMP
// IMPORTANT: DO NOT OPEN UNLESS AS CONTESTANT.
// CAUTION: BEWARE OF CONFLICT.
#ifdef MAGRANT_ALLOWS_CTMP
namespace CTMP
{
	// ELEMENTARY MATHEMATICAL COMPUTATIONS:
	long long fact[N], inv[N];
	long long KissMe(long long xx, long long yy)
	{
		if (yy == 0LL)
		{
			return 1LL;
		}
		long long Res = KissMe((xx*xx) % (long long)MODULO, yy >> 1);
		if (yy % 2LL == 1LL)
		{
			Res *= xx;
			Res %= (long long)MODULO;
		}
		return Res;
	}
	inline void InitFactInv()
	{
		fact[0] = 1LL;
		for (int i = 1;i < N - 4;i++)
		{
			fact[i] = fact[i - 1] * (long long)i;
			fact[i] %= (long long)MODULO;
		}
		inv[N - 5] = KissMe(fact[N - 5], (long long)(MODULO - 2));
		for (int i = N - 6;i >= 0;i--)
		{
			inv[i] = inv[i + 1] * (long long)(i + 1);
			inv[i] %= (long long)MODULO;
		}
	}
	inline long long Choose(int xx, int yy)
	{
		if (xx < yy)
		{
			return 0LL;
		}
		else if (xx == yy)
		{
			return 1LL;
		}
		long long Res = fact[xx];
		Res *= inv[yy];
		Res %= (long long)MODULO;
		Res *= inv[xx - yy];
		Res %= (long long)MODULO;
		return Res;
	}
	inline long long GridWays(int fx, int fy, int sx = 0, int sy = 0)
	{
		fx -= sx, fy -= sy;
		if (fx < 0 || fy < 0)
		{
			return 0LL;
		}
		long long Res = fact[fx + fy];
		Res *= inv[fx];
		Res %= (long long)MODULO;
		Res *= inv[fy];
		Res %= (long long)MODULO;
		return Res;
	}
}
#endif
// TEMPLATE FINISHES HERE.

int n;
int a[N];
int Ans;

int main()
{
	// IMPORTANT: DO NOT OPEN UNLESS AS CONTESTANT.
	// CAUTION: BEWARE OF CONFLICT.
	//using namespace CTMP;

	// REAFFIRM THE FOLLOWING BEFORE CODING.
	// 1. THE ALGORITHM IS CORRECT.
	// 2. THE COMPLEXITY IS PROPER.
	// 3. THE ALGORITHM CANNOT BE SIMPLER.
	// 4. CODING DETAILS WERE CONSIDERED.

	scanf("%d", &n);
	for (int i = 0;i < n;i++)
	{
		scanf("%d", &a[i]);
	}
	Ans = MODULO;
	for (int i = -100;i <= 100;i++)
	{
		int cst = 0;
		for (int j = 0;j < n;j++)
		{
			cst += (a[j] - i)*(a[j] - i);
		}
		if (cst < Ans)
		{
			Ans = cst;
		}
	}
	printf("%d\n", Ans);
	// REAFFIRM THE FOLLOWING BEFORE SUBMITTING.
	// 1. THE ARRAYS ARE IN PROPER SIZE.
	// 2. THE CORNER CASES WILL NOT LEAD TO VIOLATION.
	// 3. NO TYPO LIKE N->M EXISTS.
	// 4. THE INPUT/OUTPUT IS IN THE SPECIFIED FORMAT.
	//system("pause");
	return 0;
}


Measured memory_bytes: 256
/* B */

#include <iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	int* h = new int[n];

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

	int m = 0, cnt = 0;

	for(int i = 0; i < n; i++){
		if(h[i] >= m){
			cnt++;
			m = h[i];
		}
	}	

	cout << cnt << endl;
}

Measured memory_bytes: 256
from itertools import accumulate

def solve(left, right):
    if left == right:
        return 0
    ret = dp[left][right]
    if ret > 0:
        return ret
    ret = inf
    for mid in range(left, right):
        ret = min([ret, solve(left, mid)+solve(mid+1, right)])
    ret += s[right] - (s[left-1] if left > 0 else 0)
    dp[left][right] = ret
    return ret

inf = 10**15
N = int(input())
A = list(map(int, input().split()))
s = list(accumulate(A))
dp = [[0]*(N) for _ in range(N)]
print(solve(0, N-1))


Measured memory_bytes: 70772
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll mod=1e9+7;
int dy[]={1,-1,0,0};
int dx[]={0,0,1,-1};

int main(){
  string n;
  cin>>n;
  for(int i=0;i<3;i++){
      if(n[i]=='1') n[i]='9';
      else n[i]='1';
  }
  cout<<n<<endl;
  return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
using ll = long long;
template<typename T> using v2 = vector<vector<T>>;
template<typename T> inline v2<T> fill(int r, int c, const T& t){ return v2<T>(r, vector<T>(c, t)); }
#define F first
#define S second

void solve(){
    int h, w, m;
    cin >> h >> w >> m;
    vector<pair<int, int>> t(m);
    for(int i = 0; i < m; ++i){
        cin >> t[i].F >> t[i].S;
        --t[i].F, --t[i].S;
    }

    vector<int> rowc(h, 0), colc(w, 0);
    for(int i = 0; i < m; ++i){
        ++rowc[t[i].F], ++colc[t[i].S];
    }

    int ans = 0;
    for(int i = 0; i < m; ++i){
        ans = max(ans, rowc[t[i].F]+colc[t[i].S]-1);
    }

    map<int, vector<int>> rowmap;
    for(int i = 0; i < m; ++i) rowmap[t[i].F].push_back(t[i].S);

    // multiset<int> colset;
    map<int, int> colset;
    for(int i = 0; i < w; ++i) ++colset[colc[i]];


    for(auto& p : rowmap){
        // cout << p.F+1 << ": ";
        for(int col : p.S){
            // cout << col+1 << ' ';
            //colset.erase(colset.find(colc[col]));
            --colset[colc[col]];
            if(colset[colc[col]] == 0) colset.erase(colset.find(colc[col]));
        }
        // cout << '\n';

        if(colset.empty()) continue;
        ans = max(ans, rowc[p.F]+ (--colset.end())->F);

        for(int col : p.S){
            ++colset[colc[col]];
        }
    }

    cout << ans << '\n';
}

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

Measured memory_bytes: 40672
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed
#define endl '\n'

const ll MOD = 1e9 + 7;
struct mint {
    ll x;
    mint() : x(0) {}
    mint(ll x) : x((x % MOD + MOD) % MOD) {}
    mint& operator+=(const mint& r) { if ((x += r.x) >= MOD) { x -= MOD; } return *this; }
    mint& operator-=(const mint& r) { if ((x -= r.x) < 0) { x += MOD; } return *this; }
    mint& operator*=(const mint& r) { if ((x *= r.x) > MOD) { x %= MOD; } return *this; }
    mint& operator++() { if ((++x) >= MOD) { x -= MOD; } return *this; }
    mint operator++(int) { mint ret = x; if ((++x) >= MOD) { x-= MOD; } return ret; }
    mint& operator--() { if ((--x) < 0) { x += MOD; } return *this; }
    mint operator--(int) { mint ret = x; if ((--x) < 0) { x += MOD; } return ret; }
    mint operator+(const mint& r) { mint ret; return ret = x + r.x; }
    mint operator-(const mint& r) { mint ret; return ret = x - r.x; }
    mint operator*(const mint& r) { mint ret; return ret = x * r.x; }
    mint operator-() { return mint() - *this; }
    bool operator<(const mint& a) { return x < a.x; }
    bool operator>(const mint& a) { return x > a.x; }
    bool operator<=(const mint& a) { return x <= a.x; }
    bool operator>=(const mint& a) { return x >= a.x; }
    bool operator==(const mint& a) { return x == a.x; }
    bool operator!=(const mint& a) { return x != a.x; }
};
ostream& operator<<(ostream& os, const mint& r) { os << r.x; return os; }
ostream& operator>>(ostream& os, const mint& r) { os >> r.x; return os; }

void solve(istream& cin, ostream& cout) {
  int N, M;
  cin >> N >> M;
  vector<int> d(N+1, -1);
  int ans = 0;
  REP(i, M) {
    int s, c;
    cin >> s >> c;
    if (s == 1 && c == 0 && N != 1) {
      cout << "-1" << endl;
      return;
    }
    if (d[s] == -1) {
      d[s] = c;
    } else if (d[s] == c) {
      continue;
    } else {
      cout << "-1" << endl;
      return;
    }
  }
  if (d[1] == -1 && N != 1) d[1] = 1;
  else if (d[1] == -1 && N == 1) {
    cout << 0 << endl;
    return;
  }
  REP(i, N+1) {
    if (i == 0) continue;
    if (d[i] != -1) {
      ans += d[i] * pow(10, N-i);
    }
  }
  cout << ans << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
}
#endif


Measured memory_bytes: 256
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let mut a: Vec<i32> = (0..3).map(|_| input()).collect();
    a.sort();
    a.dedup();
    println!("{}", a.len());
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define ld long double
#define ll long long
#define f first
#define s second
using namespace std;	
pair<ld,ld> dp[3005][3005];
int main(){
	ll n;
	cin >> n;
	ld a[n + 5];
	for(ll i = 1;i <= n;i++){
		cin >> a[i];
	}
	dp[1][1] = {a[1],1.0 - a[1]};
	ld pro = 1.0 - a[1];
	for(ll i = 2;i <= n;i++){
		dp[i][1].f = dp[i - 1][1].f * (1.0 - a[i]) + pro * a[i];
		dp[i][1].s = 1.0 - dp[i][1].f;
		pro = pro * (1 - a[i]);
		for(ll j = 2;j < i;j++){
			dp[i][j].f = dp[i - 1][j].f * (1.0 - a[i]) + dp[i - 1][j - 1].f * a[i];
			dp[i][j].s = 1.0 - dp[i][j].f;
		}
		dp[i][i].f = dp[i - 1][i - 1].f * a[i];
		dp[i][i].s = 1.0 - dp[i][i].f;
	}
	
	ld sum = 0.0;
	for(ll i = (n / 2) + 1;i <= n;i++){
		sum = sum + dp[n][i].f;
	}
	cout << fixed << setprecision(15) << sum << "\n";
	return 0;
}

Measured memory_bytes: 280064
/**
 *  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_D
 */
#include <iostream>
#include <vector>

using namespace std;

int
checkfit(const vector<int> &w, const int p)
{
    int count = 1;
    int load = 0;
    for (int it : w) {
        if (load + it > p) {
            load = 0;
            count++;
        }
        load += it;
    }
    return count;
}

int
main()
{
    ios_base::sync_with_stdio(false);
    
    int n, k;
    cin >> n >> k; cin.ignore();

    vector<int> w(n);
    int total = 0;
    int wmax = 0;
    for (int i = 0; i < n; i++) {
        cin >> w[i]; cin.ignore();
        total += w[i];
        if (w[i] > wmax) wmax = w[i];
    }

    int p = max(total / k, wmax);
    while (checkfit(w, p) > k) p++;

    cout << p << endl;
    return 0;
}

Measured memory_bytes: 3368
#include<stdio.h>
#define N 250

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

int right(int i){
  return 2*i+1;
}

main(){
  
  int i, n, H[N];
  
  scanf("%d",&n);
  for(i=1; i<n+1; i++){
    scanf("%d",&H[i]);
  }
  
  for(i=1; i<n+1; i++){
	printf("node %d: key = %d, ",i, H[i]);
	if(parent(i) > 0) printf("parent key = %d, ",H[parent(i)]);
	if(left(i) <= n)printf("left key = %d, ",H[left(i)]);
	if(right(i) <= n)printf("right key = %d, ",H[right(i)]);
	
	printf("\n");
  }
  return 0;
}

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

LL inf = 1000000000000;
LL mod = 1000000007;

int main()
{
	LL a, b;
	cin >> a >> b;
	LL ans = -1;
	for (LL i = 1; i <= 10000; ++i) {
		if ((i*8)/100 == a && i/10 == b) {
			ans = i; break;
		}
	}

	cout << ans << "\n";

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<algorithm>	
using namespace std;
#define ll long long 
vector<vector<int>> l(100001);
//int used[100001][100001];
int col[100001];
const int MAX = 510000;
const int MOD = 1000000007;

int main() {
  int n,m,k;
  cin >> n >> m >> k;
  int a[n],b[m];
  ll al[n+1],bl[m+1];
  al[0] = 0;
  bl[0] = 0;
  
  for(int i = 0;i<n;i++){
    cin >> a[i];
    al[i+1] = a[i]+ al[i];
    
  }
  
  for(int i = 0;i<m;i++){
    cin >> b[i];
    bl[i+1] = b[i]+ bl[i];
  }
  //cout << bl.begin();
  int mx = -1;
  //int b = 0;
  int j = 0;
  for(int i = 0;i < n+1;i++){
    if(al[n-i] <= k){
      //j = lower_bound(bl.begin(), bl.end(), k-al[n-i]);
      while(al[n-i] + bl[j]<=k){
        if(j == m || al[n-i] + bl[j+1]>k){break;}
        j+=1;
      }
      mx = max(mx,n-i + j);
      //cout << n-i << " " << al[n-i] << " " << j << " " << bl[j]  <<endl;
    }
  }
  
  cout << mx;             
}

Measured memory_bytes: 10288
#include <stdio.h>

#define SIZE 10000

int main()
{
    int data[SIZE];
    int a=1,i=0;

    while(a != 0){
        scanf("%d",&a);
        data[i] = a;
        i++;
    }
    for(a=0;a<i-1;a++){
        printf("Case %d: %d\n",a+1,data[a]);
    }

    return 0;
}

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


typedef long long ll;

using namespace std;


const ll mod=1000000007;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)
//a,bの範囲的にこれだけ配列を用意していけば十分

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % mod;
        x = x*x % mod;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % mod;
    return tmp * fac[a] % mod;
}


int  main(){

    ll N,M;
    cin>>N>>M;

    fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<300000; i++){
        fac[i+1] = fac[i]*(i+1) % mod; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, mod-2) % mod; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }


    // cout<<"============"<<endl;
    ll p=M;

    vector<pair<ll,ll> > vec;
    for(ll i=2;i*i<=M;i++){
        if(p%i!=0)continue;
        ll count=0;
        while(p%i==0){
            p=p/i;
            ++count;
        }


        vec.push_back(make_pair(i,count));
    }
    if(p!=1)vec.push_back(make_pair(p,1));
/*
    for(int i=0;i<vec.size();++i){
        cout<<vec[i].first<<":"<<vec[i].second<<endl;
    }
*/

    ll ans=1;
/*
    for(ll i=0;i<vec.size();i++){
        cout<<comb((vec[i].second+N-1),N-1)<<endl;
    }
*/
    for(ll i=0;i<vec.size();i++){

        ans=(ans*comb((vec[i].second+N-1),N-1))%mod;
    }

    cout<<ans<<endl;
    
   
}


Measured memory_bytes: 7824
N,L = map(int,input().split())
A = list()
for i in range(N):
  A.append(L+i)
A.sort()
S = sum(A)
if min(A)*max(A)<=0:
  print(S)
else:
  if L>=0:
    print(S-min(A))
  else:
    print(S-max(A))


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

int d[15],n,k;

bool judge()
{
	int digit,nn=n;
	if(n==0 && d[1]==0)return false;
	while(nn>0)
	{
		digit=nn%10;
		for(int i=1;i<=k;i++)
			if(digit==d[i])return false;
		nn/=10;
	}
	return true;
}

int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=k;i++)
	{
		scanf("%d",&d[i]);
	}
	while(!judge())	
	{
		n++;
	}
	printf("%d",n);
}


Measured memory_bytes: 256
N = int(input())
W = list(map(int, input().split()))
i = 0
W_sum = sum(W)
ans_l = []
tmp_l = 0
for i in range(N):
    tmp_l += W[i]
    if((W_sum-tmp_l) - tmp_l < 0):
        ans_l.append(-((W_sum-tmp_l) - tmp_l))
    else:
        ans_l.append((W_sum-tmp_l) - tmp_l)
print(min(ans_l))

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


using namespace std;

#define fastio() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()


void go(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	ll s1=a*b;
	ll s2=c*d;
	cout << max(s1,s2);
}
int main(){
   
   fastio();
   cin.tie(0);
   cout.tie(0);

   go();

   return 0;
}




Measured memory_bytes: 3584
//By Don4ick
#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define forn(i, n) for (int i = 1; i <= n; i++)
#define all(x) x.begin(), x.end()
#define y2 qwerqwe

const int N = (int)1e5 + 228;

using namespace std;

int n, a[N];
map < int, bool > was;

int main()
{
	scanf("%d", &n);
	int mx1 = 0, mx2 = 0;
	forn(i, n)
	{
		scanf("%d", &a[i]);
		if (was[a[i]])
		{
			if (mx1 < a[i])
			{
				mx2 = mx1;
				mx1 = a[i];	 				
			}
			else
				mx2 = max(mx2, a[i]);
		}
		was[a[i]] ^= 1;
	}
	cout << 1ll * mx1 * mx2 << endl;

	return 0;
}





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

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> ps(n);
  rep(i, n) {
    cin >> ps[i];
  }

  auto e = [&](int num) {
    return (1+num)/double(2);
  };

  vector<double> s(n);
  s[0] = e(ps[0]);
  for(int i = 1; i < n; i++) {
    s[i] = s[i-1] + e(ps[i]);
  }
  double ans = s[k-1];
  for(int i = 1; i <= n-k; i++) {
    ans = max(ans, s[i+k-1]-s[i-1]);
  }
  cout << fixed << setprecision(15) << ans << endl;
  return 0;
}


Measured memory_bytes: 2688
#include<iostream>
#include <iomanip>
#include <ios>
#include <vector>
#include <string>
#include <algorithm>
#include <string>
#include<limits>
#include<cstdlib>
#include<functional>
#include<cassert>
#include <cstdio>
#include <stack>
#include <queue>
#define fi(p) for(int i=0;i<(p);i++)
using namespace std;
int N;
int L;
int P;
const int MAX_N = 100000;
const int MAX_W = 100000;


int A[MAX_N+1];
int B[MAX_N+1];

void solve() {
	int H;
	int W;
	cin >> H >> W;
	vector<string> map;
	vector<string> res;
	vector<int> h;
	vector<int> w;
	vector<int> w_delete;
	fi(H) {
		string temp;
		cin >>temp;
		int find = temp.find("#");
		if (find == string::npos) {
			continue;
		}
		else {
			map.push_back(temp);
		}
	}



	fi(W) {
		for (int j = 0; j < map.size(); j++) {
			if (map[j][i] == '.') {
				
				if (j == map.size() - 1) {
					w_delete.push_back(i);
				}
				continue;
			}
			else {
				break;
			}
		}
	}



	if (w_delete.size() != 0) {
		fi(map.size()) {
			for (int j = 0; j < W; j++) {
				for (int k = 0; k < w_delete.size(); k++) {
					if (j == w_delete[k]) {
						break;
					}
					else if (j != w_delete[k] && k == w_delete.size() - 1) {
						cout << map[i][j];
					}
				}
			}
			cout << endl;
		}
	}
	else {
		fi(map.size()) {
			cout << map[i] << endl;
		}
	}
}

int main()
{
	solve();

	int a;//止める用
	cin >> a;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}
//combination(Nが小さい時はこれを使う)
const int MAX = 330000;
int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
int COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int dight(int n) {
	int ans = 1;
	while (n >= 10) {
		n /= 10;
		ans++;
	}
	return ans;
}
int dight_sum(int n) {
	int sum = 0;
	rep(i, 20)sum += (n % (int)pow(10, i + 1)) / (pow(10, i));
	return sum;
}
signed main() {
	int s;
	cin >> s;
	if (s <= 1000000000)cout << 0 << " " << 0 << " " << 0 << " " << 1 << " " << s << " " << 0 << endl;
	else cout << 0 << " " << 0 << " " << 1000000000 << " " << 1 << " " << (1000000000 - s % 1000000000) % 1000000000 << " " << (s + 1000000000 - 1) / 1000000000 << endl;
	ggr
}


Measured memory_bytes: 256
t = gets.chomp
q = gets.to_i
p = []
min = 10 # << optimization variable
q.times{|i|
  p[i] = gets.chomp
}


hash = Hash.new{|h,k| h[k] = {}}
0.upto(t.size-min){|i|
  hash[t[i,min]][i] = 1
  hash[t[i]][i] = 1
}
(t.size-min+1).upto(t.size){|i|
  hash[t[i]][i] = 1
}


checked = {}
p.size.times{|i|
  unless checked[p[i]]
    unless hash[p[i][0,min]] || hash[p[i][0]] then
      checked[p[i]] = 0
    else
      ans = 0
      if p[i].size >= min then
        hash[p[i][0,min]].each_key{|j|
          if t[j,p[i].size] == p[i] then
            ans = 1
            break
          end
        }
      else
        hash[p[i][0]].each_key{|j|
          if t[j,p[i].size] == p[i] then
            ans = 1
            break
          end
        }
      end
      checked[p[i]] = ans
    end
  end
  puts checked[p[i]]
}

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

typedef long long ll;
typedef pair<int,int> P;
int dx[] = {-1, 1, 0,  0};
int dy[] = { 0, 0, 1, -1};
vector<ll> a(55), p(55);

 
int main(){
  int a,b;
  cin >> a >> b;
  int ans;
  if(b%a==0) ans = a+b;
  else ans = b-a;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
//In the name of God
//SMani24
#include<bits/stdc++.h>
#define debug(x) cerr << #x << " = " << x << endl
using namespace std;

int n, a;
bool ans = 1;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a;
		if (!(a & 1) && (a % 5 && a % 3))
			ans = 0;
	}
	cout << (ans? "APPROVED" : "DENIED") << endl;
	return 0;
}


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

int main(){
	char r[6][8]={{'.','.','r','r','.','.','.','.'},
								{'.','.','r','r','.','.','.','.'},
								{'g','g','y','y','b','b','w','w'},
								{'g','g','y','y','b','b','w','w'},
								{'.','.','o','o','.','.','.','.'},
								{'.','.','o','o','.','.','.','.'}};
	//string s;
	char s[101];
	char tmp;
	
	cin >> s;
	// cout << s << endl;
	for(int i = 0; i < sizeof(s); i++){
		if(s[i]=='U'){
			tmp=r[2][0]; r[2][0]=r[2][2]; r[2][2]=r[2][4]; r[2][4]=r[2][6]; r[2][6]=tmp;
			tmp=r[2][1]; r[2][1]=r[2][3]; r[2][3]=r[2][5]; r[2][5]=r[2][7]; r[2][7]=tmp;
			tmp=r[0][2]; r[0][2]=r[1][2]; r[1][2]=r[1][3]; r[1][3]=r[0][3]; r[0][3]=tmp;
		}
		else if(s[i]=='F'){
			tmp=r[2][1]; r[2][1]=r[4][2]; r[4][2]=r[3][4]; r[3][4]=r[1][3]; r[1][3]=tmp;
			tmp=r[3][1]; r[3][1]=r[4][3]; r[4][3]=r[2][4]; r[2][4]=r[1][2]; r[1][2]=tmp;
			tmp=r[2][2]; r[2][2]=r[3][2]; r[3][2]=r[3][3]; r[3][3]=r[2][3]; r[2][3]=tmp;
		}
		else if(s[i]=='R'){
			tmp=r[0][3]; r[0][3]=r[2][3]; r[2][3]=r[4][3]; r[4][3]=r[3][6]; r[3][6]=tmp;
			tmp=r[1][3]; r[1][3]=r[3][3]; r[3][3]=r[5][3]; r[5][3]=r[2][6]; r[2][6]=tmp;
			tmp=r[2][4]; r[2][4]=r[3][4]; r[3][4]=r[3][5]; r[3][5]=r[2][5]; r[2][5]=tmp;
		}
		else if(s[i]=='D'){
			tmp=r[3][0]; r[3][0]=r[3][6]; r[3][6]=r[3][4]; r[3][4]=r[3][2]; r[3][2]=tmp;
			tmp=r[3][1]; r[3][1]=r[3][7]; r[3][7]=r[3][5]; r[3][5]=r[3][3]; r[3][3]=tmp;
			tmp=r[4][2]; r[4][2]=r[5][2]; r[5][2]=r[5][3]; r[5][3]=r[4][3]; r[4][3]=tmp;
		}
		else if(s[i]=='B'){
			tmp=r[2][5]; r[2][5]=r[5][3]; r[5][3]=r[3][0]; r[3][0]=r[0][2]; r[0][2]=tmp;
			tmp=r[3][5]; r[3][5]=r[5][2]; r[5][2]=r[2][0]; r[2][0]=r[0][3]; r[0][3]=tmp;
			tmp=r[2][6]; r[2][6]=r[3][6]; r[3][6]=r[3][7]; r[3][7]=r[2][7]; r[2][7]=tmp;
		}
		else if(s[i]=='L'){
			tmp=r[0][2]; r[0][2]=r[3][7]; r[3][7]=r[4][2]; r[4][2]=r[2][2]; r[2][2]=tmp;
			tmp=r[1][2]; r[1][2]=r[2][7]; r[2][7]=r[5][2]; r[5][2]=r[3][2]; r[3][2]=tmp;
			tmp=r[2][0]; r[2][0]=r[3][0]; r[3][0]=r[3][1]; r[3][1]=r[2][1]; r[2][1]=tmp;
		}
	}

	for(int j=0;j<6;j++){
		for(int k=0;k<8;k++){
			cout << r[j][k];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1140
/* بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ */
//codeforces
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define mp make_pair
#define pb push_back
#define sz(v) ((int)v.size())
#define all(v) v.begin(), v.end()
void parseArray(ll* A,ll n){ for ( ll K = 0; K < n; K++){ cin >> A[K]; } }
ll modInverse(ll a, ll b){ return 1<a ? b - modInverse(b%a,a)*b/a : 1; }
ll gcd(ll a, ll b){ return b?gcd(b, a % b):a; }
ll lcm(ll a, ll b){ return (a*b)/gcd(a, b); }
ld dist(ll x, ll y, ll a, ll b){ return sqrt((x - a)*(x - a) + (y - b)*(y - b)); }
void debug(ll* a, ll n) { for ( int k = 0; k < n; k++ ){ cout << a[k] << " ";} cerr << "\n"; }

int main(){
	FASTIO;
	ll n, r; cin >> n >> r;
	ll ans = 0;
	while (n)
		n /= r, ans++;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int k,n;
    cin >> k >> n;
    int *A;
    A = new int[n];
    for(int i=0;i<n;i++){
        cin >> A[i];
    }
    int max = A[0]+k-A[n-1];
    for(int i=0;i<n-1;i++){
        if(A[i+1]-A[i]>max){
            max = A[i+1]-A[i];
        }
    }
    cout << k-max << endl;

    return 0;
}

Measured memory_bytes: 1024
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort()
from collections import deque
cr = 0
cg = 0
p = p[:x]
q = q[:y]
p = deque(p)
q = deque(q)
for i in range(c-1, -1, -1):
    x = p.pop()
    y = q.pop()
    z = min(x, y)
    if x < y:
        q.append(y)
        if r[i] > z:
            p.appendleft(r[i])
        else:
            p.append(x)
    else:
        p.append(x)
        if r[i] > z:
            q.appendleft(r[i])
        else:
            q.append(y)
print(sum(p) + sum(q))
    
        
        



Measured memory_bytes: 107856
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n, t, mini=10000000001, maxcount=0, maxi=0;
    cin>>n>>t;
    for(long long i =0; i<n; i++){
        long long a;
        cin>>a;
        long long cur_max = a-mini;
        if(cur_max>maxi){
            maxi=cur_max; maxcount=1;
        }
        else if(cur_max==maxi){
            maxcount++;
        }
        mini = min(mini, a);
    }
    cout<<maxcount;
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

int main(){
  int n;
  scanf("%d", &n);
  int c[n+1];
  int i;
  for(i=1;i<=n;i++){
    scanf("%d",&c[i]);
  }
  int c_idx[200001];
  for(i=1;i<=200000;i++){
    c_idx[i]=-1;
  }
  long long int ans[n+1];
  ans[1] = 1;
  c_idx[c[1]] = 1;
  for(i=2;i<=n;i++){
    if(c_idx[c[i]] == i-1 || c_idx[c[i]] == -1){
      ans[i] = ans[i-1];
    }else{
      ans[i] = (ans[i-1] + ans[c_idx[c[i]]]) % 1000000007;
    }
    c_idx[c[i]] = i;
  }
  printf("%lld\n", ans[n]);
  return 0;
}


Measured memory_bytes: 3328