akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <deque>
#include <list>
#include <sys/timeb.h>
#include <fstream>
#include <set>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	
	int n;
	cin >> n;
	
	vi x(n); rep(i, n)cin >> x[i];

	vi t = x;
	sort(all(t));
	int m = t[t.size() / 2];
	int a = t[t.size() / 2 - 1];

	rep(i, n) {
		if (x[i] == m) {
			cout << a << endl;
			continue;
		}
		if (x[i] == a) {
			cout << m << endl;
			continue;
		}
		if (x[i] > m) {
			cout << a << endl;
		}
		else {
			cout << m << endl;
		}

	}

	/*
	
	rep(i, n) {
		auto itr = find(all(t), x[i]);
		auto a = itr - t.begin();
		t.erase(itr);

		cout << t[(n/2)-1] << endl;
		t.insert(t.begin()+a, x[i]);
	}

	*/
	

	return 0;
}


Measured memory_bytes: 3840
#include<bits/stdc++.h>
using namespace std;
int main(){
  //int inf=1000000000;
  int n;cin>>n;
  int a[n-1],b[n-1];
  bool used[n+1];
  for(int i=0;i<=n;i++)used[i]=false;
  vector<int>list[n+1];
  for(int i=0;i<n-1;i++){
    cin>>a[i]>>b[i];
    list[a[i]].push_back(b[i]);
    list[b[i]].push_back(a[i]);
  }
  //cout<<list[4][0]<<list[4][1];return 0;
  int d[n+1];
  d[1]=0;
  used[1]=true;
  queue<int>q,dis;
  q.push(1);dis.push(0);
  for(;;){
    int x=q.front();int di=dis.front();
   // cout<<x<<endl;
    q.pop();dis.pop();
    if(x==n)break;
    for(int i=0;i<list[x].size();i++){
      int y=list[x][i];
      if(!used[y]){
      d[y]=di+1;
      q.push(y);dis.push(di+1);
        used[y]=true;
      }
    }
  }
  
  vector<int>str;
  str.push_back(n);
  int t=d[n];
  //cout<<t;return 0;
  int now=n;
  for(;;){
    for(int i=0;i<list[now].size();i++){
      if(d[list[now][i]]==t-1){
        str.push_back(list[now][i]);
        now=list[now][i];
        t--;
        break;
      }
    }
    if(t==0)break;
  }
  //cout<<3<<endl;return 0;
  int w=str.size()/2-1;
  for(int i=0;i<=n;i++)used[i]=false;
  queue<int>qn;
  qn.push(str[w]);
  int sum=1;
  used[str[w]]=true;
  int out=str[w+1];
  for(;;){
    int r=qn.front();
    qn.pop();
    
    for(int i=0;i<list[r].size();i++){
      int u=list[r][i];
      if(u!=out){
        if(used[u]==false){
          sum++;
          qn.push(u);
          used[u]=true;
          
        }
      }
    }
    if(qn.size()==0)break;
  }
  int summ=n-sum;
  if(sum<summ)cout<<"Fennec"<<endl;
  else cout<<"Snuke"<<endl;
}
    



Measured memory_bytes: 7676
#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
	int N, M;
	cin >> N >> M;

	vector<bool> start(N, false), goal(N, false);
	for(int i=0; i<M; i++)
	{
		int a, b;
		cin >> a >> b;

		a--;
		b--;

		if(a == 0)
			start[b] = true;

		if(b == N-1)
			goal[a] = true;
	}

	string ret = "IMPOSSIBLE";
	for(int i=1; i<N; i++)
		if(start[i] == true && goal[i] == true)
			ret = "POSSIBLE";

	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 256
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt, gcd
from copy import deepcopy
from functools import reduce


def gcd_list(numbers):
    return reduce(gcd, numbers)

def main():
    n,x = map(int, input().split())
    x_list = list(map(int, input().split()))

    
    list_s = []
    for i in range(n):
        list_s.append(abs(x_list[i]-x))
        
    ans = gcd_list(list_s)
    print(ans)


if __name__ == "__main__":
    main()


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

int main() {
 int a,b,c,d;
 cin >>a >>b >>c >>d;
 int x,y;
 x=c-a;
 y=d-b;
 for(int i=0;i<x;i++){
   cout<<"R";
 }
 for(int i=0;i<y;i++){
   cout<<"U";
 }
 for(int i=0;i<x;i++){
   cout<<"L";
 }
 for(int i=0;i<y;i++){
   cout<<"D";
 }
cout<<"D";
for(int i=0;i<x+1;i++){
  cout<<"R";
}
for(int i=0;i<y+1;i++){
  cout<<"U";
}
cout<<"L";
cout<<"U";
for(int i=0;i<x+1;i++){
  cout<<"L";
}
for(int i=0;i<y+1;i++){
  cout<<"D";
}
cout<<"R" <<endl;
}


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

int main() {
  int N, sum;
  cin >> N;
  sum = 0;
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    
    if (S == "Y") {
      sum++;
    }
    if (sum == 1) {
      cout << "Four" << endl;
      break;
    }
    
  }
  if (sum == 0) {
    cout << "Three" << endl;
  }
}
  

Measured memory_bytes: 256
n = input()
*A, = map(int, input().split())
max_A = max(A)
count = {a:0 for a in A}
for a in A:
    count[a] += 1
is_OK = {a:True for a in A}
for a in A:
    i = 2
    if not is_OK[a]:
        continue
    while a * i < max_A + 1:
        is_OK[a * i] = False
        i += 1
ans = 0
for a in A:
    if count[a] == 1 and is_OK[a]:
        ans += 1
print(ans)

Measured memory_bytes: 104304
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
import networkx as nx
def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    total = sum(a for a in A if a > 0)

    # minimum cut
    G = nx.DiGraph()
    G.add_nodes_from(range(1, n + 1))
    G.add_nodes_from(["source", "termination"])
    for i, a in enumerate(A, 1):
        if a >= 0:
            G.add_edge("source", i, capacity = 0)
            G.add_edge(i, "termination", capacity = a)
        else:
            G.add_edge("source", i, capacity = -a)
            G.add_edge(i, "termination", capacity = 0)

    for i in range(1, n + 1):
        for j in range(2 * i, n + 1, i):
            G.add_edge(i, j, capacity = INF)

    flow = nx.algorithms.flow.maximum_flow_value(G, "source", "termination")
    print(total - flow)
resolve()

Measured memory_bytes: 53780
#include <iostream>
#include <string>
#include <cstdio>
#include <cctype>

using namespace std;


int main(void) {

    string line;
    getline(cin, line);

    for (int i = 0; i < line.size(); ++i) {
        char ch = line[i];
        if (isalpha(ch)) {
            if (islower(ch)) { putchar(toupper(ch)); }
            else             { putchar(tolower(ch)); }
        }
        else {
            putchar(ch);
        }
    }
    printf("\n");

    return 0;
}

Measured memory_bytes: 1168
class UnionFindTree():
    # Union find tree
    # 2つの効率化　経路圧縮、ランク
    # つなげることはできるか分離することはできないので、木をつなげる方向に利用する
    # 
    def __init__(self, node_size):
        # node_num: 全体のノード数
        # parent: ノードがrootなら-1、親がいれば親の番号を入れる
        # size:
        # rank:  
        self.parent =[-1] * node_size 
        self.size = [1] * node_size
        self.rank = [1] * node_size
    
    def find_root(self,node):
        # node属する木のrootを探す
        # たどった経路に含まれるnodeの親をrootにつなぎ替える
        if self.parent[node] == -1:             # 自身がrootの場合
            root = node
        else:                                   # 自身がrootでない場合
            root = self.find_root(self.parent[node]) # 再帰的にrootを探す
            self.parent[node] = root            # たどった経路に含まれるnodeの親をrootにつなぎ替える(経路圧縮)
        return root

    def unite(self,node0, node1):
        # node0とnode1が含まれる木を結合する
        
        #node0 node1のrootを求める
        root0 = self.find_root(node0) 
        root1 = self.find_root(node1)

        if root0 != root1:
            # rankを比較しrankが小さい方の木を大きい方の木のrootにつなげる
            # rank is sameのときのみrankが増える
            rank0 = self.rank[root0]
            rank1 = self.rank[root1]

            if rank0 == rank1: # rank is same
                self.parent[root1] = root0
                self.size[root0] += self.size[root1]
                self.rank[root0] += 1
            elif rank0 > rank1:
                self.parent[root1] = root0
                self.size[root0] += self.size[root1]
            else:
                self.parent[root0] = root1
                self.size[root1] += self.size[root0]

            


N,M = map(int,input().split())
bridges = [list(map(int,input().split())) for i in range(M)]

UFT = UnionFindTree(N)

a = int(N*(N-1)/2) # 不便さ
ans = [a]

for i in range(1,M)[::-1]:
    island0_num, island1_num = bridges[i][0]-1, bridges[i][1]-1 
    root0 = UFT.find_root(island0_num)
    root1 = UFT.find_root(island1_num)
    if root0 != root1:
        size0 =  UFT.size[root0]
        size1 =  UFT.size[root1]
        UFT.unite(island0_num,island1_num)
        a -= size0 * size1
    ans.append(int(a))

[print(ans[i]) for i in range(M)[::-1]]


Measured memory_bytes: 37048
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

vector<int> init(int size){
  vector<int> par(size,-1);
  return par;
}

int root(int x, vector<int>& par){
  if(par[x] < 0){
    return x;
  }else{
    return par[x] = root(par[x],par);
  }
}

bool same(int x, int y, vector<int>& par){
  return root(x, par) == root(y, par);
}

void unite(int x, int y, vector<int>& par){
  x = root(x, par), y = root(y, par);
  if(same(x,y, par))return;
  par[x] += par[y];
  par[y] = x;
}

int size(int x, vector<int>& par){
  return -par[root(x, par)];
}

int pow(int x, int n){
  if(n == 0)return 1;
  if(n % 2 == 0)return pow(x * x % MOD, n/2);
  else return x * pow(x, n-1) % MOD;
}

signed main(){
  int n;cin>>n;
  int ans = 0;int a = 100;
  repd(i,1,n+1){
    if(to_string(i).length() % 2 == 1){
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
typedef long long  ll;
//typedef tree<ld,null_type,less<ld>,rb_tree_tag,tree_order_statistics_node_update> indexed_set
// this for long double
#define press_F_to_pay_respect ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn for(int i=0;i<n;i++) 
#define form for(int j=0;j<n;j++) 
#define fore(i,a,b) for(int i = a; i < (b); i++)
#define pb push_back 
#define pob pop_back()
#define mp make_pair 
#define sc second 
#define f first 
#define ld long double
#define kek cout<<endl; 
#define rep(i,a,b) for(int i=a;i<b;i++)
#define all(v) ((v).begin()), ((v).end()) 
#define pob pop_back() 
#define halt {cout<<-1; return 0;}
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const int N = 1010;
const int INF = 1e8;
const ll MOD1=1073741824;
const long double pi=3.1415926535;
using namespace std;
using namespace __gnu_pbds;
typedef tree<ld,null_type,less<ld>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
string bin_rep(int n)
{
          string s="";
      for(int i=31;i>=0;i--)
   {
           if(n&(1<<i)) s+='1';
           else s+='0';
   }
   return s;
}
int main()
{
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
 press_F_to_pay_respect;
 // cout << fixed << setprecision(12) << ans;
 // string al = "abcdefghijklmnopqrstuvwxyz";
 
 int a;
 cin>>a;
 cout<<a+a*a+a*a*a;
 
 
 
 
    
 
 
 
  // cout <<"Runtime is:"<<clock() * 1.0 / CLOCKS_PER_SEC <<endl;
   return 0;
   
   
 
}

Measured memory_bytes: 3636
#if 0
http://blog.csdn.net/pipisorry/article/details/46383947
#endif
#include<iostream>
#include<string>
using namespace std;

int main()
{
	string str1, str2;
	int count = 0;
	cin >> str1 >> str2;
		if (str1.length() < str2.length())
		{
			string temp;
			temp = str1;
			str1 = str2;
			str2 = temp;
		}
		int **d = new int*[str1.length()+1];
		for (int i = 0; i < str1.length()+1; i++)
			d[i] = new int[str2.length()+1];
		for (int i = 0; i < 1+str1.length(); i++)
			for (int j = 0; j < 1+str2.length(); j++)
			{
				if (i == 0 || j == 0)
				{
					if (i == 0)
						d[i][j] = j;
					else if (j==0)
						d[i][j] = i;
				}
				else if (str1[i-1] == str2[j-1])
					d[i][j] = d[i - 1][j - 1];
				else
				{
					int min = d[i][j - 1] < d[i - 1][j] ? (d[i][j - 1] + 1) : (d[i - 1][j] + 1);
					min = min < d[i - 1][j - 1] + 1 ? min : d[i - 1][j - 1] + 1;
					d[i][j] = min;
				}
			}
		cout << d[str1.length()][str2.length()] << endl;
	//system("pause");
}

Measured memory_bytes: 7088
S = list(input())
T = list(input())

match = 0

for _ in S:
    i = S.pop()  # 末尾を削除し値を取得
    S.insert(0, i)  # index[0]の位置にiを追加
    ''.join(S)  # リストを結合
    if S == T:
        match += 1
        break

if match == 0:
    print('No')
else:
    print('Yes')


Measured memory_bytes: 8996
#include <iostream>

using namespace std;

const int N = 1e6+10;
int a[N];

int main(){
	int n;
	cin >> n;
	while (n--){
		int t;
		cin >> t;
		a[t]++;
		a[t+1]++;
		a[t+2]++;
	}
	int max=0;
	for (int i=0;i<1e5+5;i++){
		if (a[i]>max) max=a[i];
	}
	cout << max << endl;
	
	return 0;
}

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

int main() {
    int n;
    cin>>n;
    int num[105];
    for(int i=0; i<n; i++) {
        cin>>num[i];
    }
    for(int i=n-1; i>=0; i--) {
        cout<<num[i];
        if(i!=0)cout<<" ";
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  ll n,m;
  cin>>n>>m;
  vector<LP> v;
  REP(i,n){
    LP lp;
    cin>>lp.first>>lp.second;
    v.pb(lp);
  }
  VSORT(v);

  ll ans = 0;

  int now = m-1;
  int count = 0;
  priority_queue<ll> q;
  while(now>=0){
    while(count<n&&v[count].first<=(m-now)){
      q.push(v[count].second);
      count++;
    }
    if(!q.empty()){
      ans += q.top();
      q.pop();
    }

    now--;
  }

  cout<<ans<<endl;
 

  return 0;
}

Measured memory_bytes: 3568
package main

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

func main() {
	log.SetFlags(log.Lshortfile)
	s := nextString()
	rtn := make([]byte, 0)
	for i := 0; i < len(s); i++ {
		switch s[i] {
		case '0':
			rtn = append(rtn, '0')
		case '1':
			rtn = append(rtn, '1')
		case 'B':
			if len(rtn) > 0 {
				rtn = rtn[:len(rtn)-1]
			}
		}
	}
	out := bufio.NewWriter(os.Stdout)
	fmt.Fprintf(out, "%s\n", string(rtn))
	out.Flush()
}
func Max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func Min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func Sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func Abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	return p[i].b < p[j].b
}

var nextReader func() string

func init() {
	nextReader = NewScanner()
}

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}
func nextString() string {
	return nextReader()
}
func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}
func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}
func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}
func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(nextReader(), 64)
	return f
}


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

int main() {
    int a, b, c, x, i = 0;
    cin >> a >> b >> c;
    x = a;
    while ((x >= a) && (x <= b)) {
        if (c % x == 0)
            i = i + 1;
        x = x + 1;
    }
    cout << i << endl;
    return 0;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define wi(t) int t;cin>>t;while(t--)
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve()
    {
      
      int r,g,b,k;
      cin>>r>>g>>b>>k;
      while(k>0)
      {
          if(b>g&&g>r)
          {
              cout<<"Yes"<<endl;
              return;
          }
          if(b<=g)
          {
              b=b*2;
              k--;
          }
          if(g<=r)
          {
              g=g*2;
              k--;
          }
          if(b>g&&g>r)
          {
              cout<<"Yes"<<endl;
              return;
          }

      }
      cout<<"No"<<endl;
      
  
  
  
    }

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

   // wi(t)
    {
      solve();
    }

    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}







Measured memory_bytes: 10680
n, p = map(int, input().split())
s = list(map(int, list(input())))
if p == 2 or p == 5:
    ans = 0
    for i in range(n):
        if s[i] % p == 0:
            ans += i + 1
    print(ans)
else:
    lis = [0] * p
    cnt = 0
    kurai = 1
    for i in s[::-1]:
        cnt += i * kurai % p
        cnt %= p
        lis[cnt] += 1
        kurai *= 10
        kurai %= p
    ans = 0
    for i in lis:
        ans += i * (i - 1) // 2
    ans += lis[0]
    print(ans)

Measured memory_bytes: 12096
a,b=map(int,input().split())
if a==0 and b!=100:
    print(b)
elif a==0 and b==100:
    print(101)
elif a==1 and b!=100:
    print(b*100)
elif a==1 and b==100:
    print(10100)
elif a==2 and b!=100:
    print(b*10000)
else:
    print(101*10**4)

  

Measured memory_bytes: 38384
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, C, K;
    cin >> N >> C >> K;
    int T[100010];
    rep(i, N) cin >> T[i];
    sort(T, T + N);
    int i = 0;
    int ans = 0;
    while(i < N) {
        int j = i;
        while(j + 1 < N && j + 1 - i + 1 <= C && T[j + 1] - T[i] <= K) j++;
        ans++;
        //cout << T[i] << " " << T[j] << endl;
        i = j + 1;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 640
/*
    A - Programming Education
    https://atcoder.jp/contests/abc112/tasks/abc112_a
*/
#include <bits/stdc++.h>
using namespace std;

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

    int n;
    cin >> n;

    if (n == 1) {
        cout << "Hello World" << endl;
    } else {
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
}

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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int A, B;
  cin >> A >> B;
  for(int i=1;i<=1000;++i){
	int l = i * (i+1) / 2;
	int r = (i+2) * (i+1) / 2;
	if(A <= l && B <= r && l - A == r - B){
	  cout << l - A << endl;
	  break;
	}
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n;
int a[200005],b[200005];
int main(){
	cin>>n;
	for(int i=0;i<n;++i){
		cin>>a[i]>>b[i];
	} 
	sort(a,a+n);
	sort(b,b+n);
	int l,r;
	if(n%2){
		l=a[(n-1)/2];
		r=b[(n-1)/2];
	}
	else{
		l=a[n/2]+a[n/2-1];
		r=b[n/2]+b[n/2-1];
	} 
	cout<<r-l+1<<'\n';
	return 0;
} 

Measured memory_bytes: 5172
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int H, W, N;
    cin >> H >> W >> N;
    H = max(H, W);
    cout << (N + H - 1) / H << endl;
}

Measured memory_bytes: 256
W, A, B = [int(i) for i in input().split()]

if B <= A <= B+W or B <= A+W <= B+W or A <= B <= A+W or A <= B+W <= A+W:
  print(0)
elif W + A <= B:
  print(B - (W + A))
else:
  print(A - (B + W))


Measured memory_bytes: 9124
import sys

def solve():
    input = sys.stdin.readline
    S = input().strip("\n")
    N = len(S)
    nL, nR = [N-1] * N, [0] * N
    cl, cr = N-1, 0
    for i in range(1, N):
        if S[i] == "R": cr = i
        nR[i] = cr
        if S[N-i-1] == "L": cl = N-i-1
        nL[N-i-1] = cl

    sumC = [0] * N
    for i in range(N):
        if S[i] == "R":
            move = nL[i] - i
            if move % 2 == 0: sumC[nL[i]] += 1
            else: sumC[nL[i] - 1] += 1
        else:
            move = i - nR[i]
            if move % 2 == 0: sumC[nR[i]] += 1
            else: sumC[nR[i] + 1] += 1
    print(" ".join(map(str, sumC)))



    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 15296
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

import math
import itertools

def main():
    def calc(i, j):
        return math.sqrt((xs[i] - xs[j]) * (xs[i] - xs[j]) +(ys[i] - ys[j]) * (ys[i] - ys[j]))
    n = II()
    xs = []
    ys = []
    for i in range(n):
        x, y = LI()
        xs.append(x)
        ys.append(y)
    ans = 0
    list_ = list(itertools.permutations(list(range(n))))
    for i in list_:
        for j in range(n-1):
            ans += calc(i[j], i[j+1])
    print(ans / len(list_))


if __name__ == '__main__':
    main()

Measured memory_bytes: 46192
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm> 
using namespace std;



int main() {
	int n, a=0, m, b;
	cin >> n;
	m = n;
	while (1) {
		if (n < 10) {
			a += n;
			break;
		}
		a += n % 10;
		n /= 10;
	}
	if (m%a == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}



Measured memory_bytes: 256
N,M=map(int,input().split())
l=[0]*N
ans=0
for i in range(M):
    s,c=map(int,input().split())
    if l[s-1]==0 or l[s-1]==c:
        l[s-1]=c
    else:
        print(-1)
        exit()
    if s==1 and c==0 and N!=1:
        print(-1)
        exit()
for i in range(N):
    ans+=int(l[i])*(10**(N-i-1))
if N==len(str(ans)):
    print(ans)
else:
    print(10**(N-1)+ans)



        





Measured memory_bytes: 3064
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

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

n = int(input())

ans = [-1 for i in range(80002)]
for i in range(50002):
    price = int((i*1.08)//1)
    ans[price] = i

if(ans[n]!=-1):
    print(ans[n])
else:
    print(':(')
    


Measured memory_bytes: 43376
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
int main(){
    ll h, w;
    ll ans = 0;
    cin >> h >> w;

if (h == 1 || w == 1)
        {
            ans = 1;
            cout << ans << endl; 

    return 0;
        }

    for (size_t i = 0; i < h; i++)
    {
        
        

        if (i % 2 == 0)
            {
                ans += (w + 1) / 2;
            }
            else
            {
                ans += w / 2;
            }
        
    }
    

    cout << ans << endl; 

    return 0;
}

Measured memory_bytes: 256
/*
      author : Nishikawa      created: 04.08.2020 00:24:48
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
#define inf 2147483647


int main(){
    int H,W;
    cin >> H >> W;
    int min_sum=inf;
    vector<vector<int> > A(H,vector<int>(W));
    rep(i,H) rep(j,W) cin >> A[i][j];
    rep(i,H){
        rep(j,W){
            int r_sum=0;
            rep(k,H){
                rep(l,W){
                    if(k==i || l==j) continue;
                    r_sum += min(abs(i-k),abs(j-l)) * A[k][l];
                }
            }
            min_sum = min(min_sum,r_sum);
        }
    }
    cout << min_sum << endl;
    return 0;
}


Measured memory_bytes: 3176
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
    ll n;
    cin >> n;
    ll ans = 1000000000000000;
    for(ll i= 1; i*i<=n; i++){
        if(n%i == 0) ans = min(ans,i+(n/i)-2);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = INT64_MAX;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i, n) for(ll i=0;i<n;i++)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

str alps = "abcdefghijklmnopqrstuvwxyz";

void solve() {
    str S, T;
    cin >> S >> T;
    map<char, vll> mps, mpt;
    map<ll, char> invmps, invmpt;
    REP(i, S.size()) {
        mps[S[i]].push_back(i);
        invmps[i] = S[i];
    }
    REP(i, S.size()) {
        mpt[T[i]].push_back(i);
        invmpt[i] = T[i];
    }
    for(auto &p:mps) {
        set<char> chrs;
        for(auto &s:p.second) {
            chrs.insert(invmpt[s]);
        }
        if(chrs.size() != 1) {
            out("No");
            return;
        }
    }
    for(auto &p:mpt) {
        set<char> chrt;
        for(auto &s:p.second) {
            chrt.insert(invmps[s]);
        }
        if(chrt.size() != 1) {
            out("No");
            return;
        }
    }
    out("Yes");
}

int main() {
    fast_io;
    solve();
    return 0;
}


Measured memory_bytes: 29204
#include <iostream>
#include <cmath>
#include<vector>
#include<map>

using namespace std;

int main()
{
    vector<vector<int>> A, hit;
    map<int, pair<int, int>> pos;
    int N;
    A.resize(3, vector<int>(3));
    hit.resize(3, vector<int>(3, 0));

    for (int i = 0; i < 3; i++){
        for (int j = 0; j < 3; j++){
            int a;
            cin >> a;
            A[i][j] = a;
            pos[a] = make_pair(i, j);
        }
    }
    cin >> N;
    for (int i = 0; i < N; i++){
        int b;
        cin >> b;
        if(pos.count(b)){
            hit[pos[b].first][pos[b].second] = 1;
        }
    }
    if((hit[0][0] && hit[1][1] && hit[2][2]) || (hit[0][2] && hit[1][1] && hit[2][0])){
        cout << "Yes" << endl;
        return 0;
    }
    for (int i = 0; i < 3; i++){
        if((hit[i][0] && hit[i][1] && hit[i][2]) || (hit[0][i] && hit[1][i] && hit[2][i])){
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}

Measured memory_bytes: 3600
using namespace std;
#include <iostream>
#include <string>
#include <set>
#include <functional>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
string cor(int num){
	if(num%3==0&&num%5==0)return "FizzBuzz";
	else if(num%3==0)return "Fizz";
	else if(num%5==0)return "Buzz";
	else{
		std::stringstream ss;
		ss << num;
		return ss.str();
	}
}
int main()
{
	int m,n;
	while(cin>>m>>n&&(m||n)){
		int alone=-1;
		bool ex[10001]={};
		for(int i=1;i<=m;i++)ex[i]=true;
		int last=0;
		int count=m;
		for(int i=1;i<=n;i++){
			if(count==1)alone=last;
			string num;cin>>num;
			int p=last!=m?last+1:1;
			while(!ex[p]){p==m?p=1:p++;}//sellect p
			if(num!=cor(i)){ex[p]=false;count--;}
			last=p;
		}
		if(alone==-1){
			int lex=1;
			for(int i=1;i<=m;i++)if(ex[i])lex=i;
			for(int i=1;i<=lex;i++)if(ex[i])printf(i==lex?"%d\n":"%d ",i);
		}else{
			printf("%d\n",alone);
		}
	}
    return 0;
}

Measured memory_bytes: 1272
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main() {

    string s;
    cin>>s;
    int a[4];
    int n=sizeof(a)/sizeof(a[0]);
    a[0]=(int)s[0];
    a[1]=(int)s[1];        
    a[2]=(int)s[2];
    a[3]=(int)s[3];
    
    sort(a,a+n);
    if(a[0]==a[1] && a[2]==a[3] && a[1]!=a[2]){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3632
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String str[] = br.readLine().split(" ");
        for(int i=n-1;i>=0;i--){
            System.out.print(str[i]);
            if(i>0){
                System.out.print(" ");
            }else{
                System.out.print("\n");
            }
        }
    }
}

Measured memory_bytes: 24228
#include <iostream>

using namespace std;

int main()
{
  string S;
  cin >> S;
  
  int count = 0;
  for (auto c: S) {
    if (c == 'x') {
      count++;
    }
  }
  
  if (count >= 8) {
    cout << "NO" << endl;
  } else {
  	cout << "YES" << endl;
  }
  
}

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

#define N 0
#define INF 0x3f3f3f3f
#define LL long long
#define mz(x) ms(x,0)
#define ms(x,y) memset(x,y,sizeof(x))
#define mc(x,y) memcopy(x,y,sizeof(y))
#define MOD 1000000007

using namespace std ;

int main()
{
	string s ;
	cin >> s ;
	if (s[s.size() - 1] == 's')
		cout << s << "es" << endl ;
	else
		cout << s << "s" << endl ;

	return 0 ;
}

Measured memory_bytes: 3040
#include <iostream> 
#include <cstdio> 
#include <cstdlib>  
#include <algorithm> 
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include<iomanip>
#include<functional>
using namespace std;
typedef long long ll;


long long GCD(long long a, long long b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}


int main() {
    int N;
    cin >> N;
    vector<int> B(N, 1e9);
    for (int i = 0; i < N - 1; i++) {
        cin >> B[i];
    }
    int ans = B[0];
    for (int i = 1; i < N; i++) {
        ans += min(B[i], B[i - 1]);
    }
    cout << ans << endl;
}


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

typedef long long int ll;
typedef vector<int> vi;			typedef vector<ll> vl;
typedef vector<vi> vvi; 		typedef vector<vl> vvl;
typedef pair<int, int> 	pii;	typedef pair<ll, ll> pll;
typedef vector<pii> vii; 		typedef vector<pll> vll;
typedef map<int,int> mii;
typedef vector<char> vc;
typedef vector<bool> vb;
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define rforne(i,n) for(int i=n;i>=1;i--)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size()
#define MOD 1000000007
#define F first
#define S second
#define pb push_back
#define in insert
#define mp(a, b) make_pair(a, b)
#define fill(a,x) memset(a,x,sizeof a);
#define trav(a,x) for(auto &a:x)
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max(a, b), max(c, d))
#define INF LLONG_MAX
#ifdef KARAN
	#include "../../trace.h"
#else
    #define trace(args...)
#endif

ll modpow(ll a, ll b, ll m = MOD){a %= m; ll res = 1; 
	while (b) {if (b & 1)res = (res * a) % m; a = (a * a) % m; b >>= 1;} return res;}
ll bpow(ll a, ll b){ll res = 1; while (b) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll modinv(ll a, ll m = MOD) {return modpow(a, m - 2, m);}
void graph(vvi &adj, int m) {int x, y; forn(i, m){cin>>x>>y; adj[--x].pb(--y); adj[y].pb(x);}}

void dfs(ll v, ll p, ll l, vvl &adj, vl &a, vl &dp, vl &ans){

	ll lo = lower_bound(dp.begin(), dp.end() + l, a[v]) - dp.begin();
	
	ll prev_val = dp[lo];
	dp[lo] = a[v];
	ans[v] = max(l, lo) + 1;
	
	for(auto u: adj[v]){
		if(u!=p)
			dfs(u, v, max(lo, l), adj, a, dp, ans);
	}
	dp[lo] = prev_val;
}

void solve(){
	ll n;
	cin>>n;
	vl a(n);
	forn(i, n) cin>>a[i];
	vvl adj(n);
	forn(i, n-1){ ll u, v; cin>>u>>v; u--; v--; adj[u].pb(v); adj[v].pb(u); }
	vl ans(n);
	vl dp(n);
	forn(i, n) dp[i] = INF;
	dfs(0, 0, 0, adj, a, dp, ans);
	for(auto elem: ans)
		cout<<elem<<endl;	
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifdef KARAN
		freopen("inp.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    	freopen("err.txt", "w", stderr);
	#endif
	int t=1;
	// cin>>t;
	while(t--)
		solve();
}

Measured memory_bytes: 38768
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  int vx[]={1,1,0,-1,-1,-1,0,1};
  int vy[]={0,1,1,1,0,-1,-1,-1};
  vector<string> s(h),t(h,"");
  REP(i,h){
    cin>>s[i];
  }
  int px,py;
  int cnt=0;
  char c;
  REP(i,h){
    REP(j,w){
      if(s[i][j]=='#'){
        t[i] += '#';
        continue;
      }
      REP(k,8){
        px = i+vx[k];
        py = j+vy[k];
        if(0<=px && px<=h-1 && 0<=py && py<=w-1 && s[px][py]=='#'){
          cnt++;
        }
      }
      c = cnt + '0';
      t[i] += c;
      cnt = 0;
    }
    cout<<t[i]<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

template <class T>
inline bool chmax(T &a, T b){
    if(a < b){ a = b; return true;}
    return false;
}
template <class T>
inline bool chmin(T &a, T b){
    if(a > b){ a = b; return true;}
    return false;
}

const int INF = 1001001001;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> h(n);
    rep(i, 0, n) cin >> h[i];
    vector<int> dp(n+1, INF);
    dp[0] = 0;
    rep(i, 0, n){
        rep(j, 1, k+1){
            chmin(dp[i+j], dp[i] + abs(h[i+j] - h[i]));
        }
    }
    cout << dp[n-1] << endl;
    return 0;
}


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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

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

Measured memory_bytes: 3592
#include<cstdio>
#include<algorithm>
int main(){
    int n,a[3];
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++,scanf){
            scanf("%d",&a[j]);
        }
        std::sort(a,a+3);
        if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2]) printf("YES\n");
        else printf("NO\n");
    }
}

Measured memory_bytes: 0
n = int(input())
s = [int(input()) for i in range(n)]

y = []
for i in range(n):
    if s[i] % 10 != 0:
        y.append(s[i])

if sum(s) % 10 != 0:
    print(sum(s))
elif len(y) > 0:
    print(sum(s)-min(y))
else:
    print(0)


Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main()
{
	int n,k;
	cin>>n>>k;
	int dqd2ef;
	int se2fv3idojoi2;
int kx=1+(k-1)*2;
    if(n>=kx) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll a,b,k; cin >> a >> b >> k;
    if(k <= a)a -= k;
    else{
        b -= (k-a);
        a = 0;
    }
    if(b < 0)b = 0;
    cout << a << " " << b << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main() {
	int a, b, k, i, val;
	val = scanf("%d%d%d", &a, &b, &k);
	if (val == 0) return 1;
	if (a + k - 1 >= b - k + 1) {
		for (i = a; i <= b; i++) {
			printf("%d\n", i);
		}
	}
	else {
		for (i = a; i < a + k; i++) {
			printf("%d\n", i);
		}
		for (i = b - k + 1; i <= b; i++) {
			printf("%d\n", i);
		}
	}
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;
typedef vector<ll> vll;

void solve(long long n, long long m, vector<long long> a, vector<long long> b){
	vector<pll> v;
	for (int i=0;i<m;i++) {
		v.PB(MP(a[i],b[i]));
	}
	sort(v.begin(),v.end());
	int blo=-1;
	int ans=0;
	for (auto &w:v) {
		int a=w.fst,b=w.snd;
		if (a>=blo) {
			ans++;
			blo=b;
		}
		chkmin(blo,b);
	}
	printf("%d\n",ans);
}

int main(){	
	ios_base::sync_with_stdio(false); cin.tie(0);
	long long N;
	long long M;
	scanf("%lld",&N);
	scanf("%lld",&M);
	vector<long long> a(M-1+1);
	vector<long long> b(M-1+1);
	for(int i = 0 ; i <= M-1 ; i++){
		scanf("%lld",&a[i]);
		scanf("%lld",&b[i]);
	}
	solve(N, M, a, b);
	return 0;
}



Measured memory_bytes: 5620
/*****************************************************
 *     created by: nayakashutosh9
 * "Winners Never Quit and Quitters Never Win".
*****************************************************/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
using namespace __gnu_pbds;
using namespace std;
#define int long long int
#define endl '\n'
#define mod 1000000007
#define inf 1e18
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
const int N = 300005;
/**********************************************************************************************/


void solve() {
	int a, b, n; cin >> a >> b >> n;
	int x = b * (n / b);
	if (x > 0) x--;
	else x = n;
	cout << (((a * x) / b) - (a * (x / b))) << endl;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int t = 1, z = 1;
	// cin >> t; cin.ignore();
	while (t--) {
		// cout << "Case #" << (z++) << ": ";
		// clock_t start = clock();
		solve();
		// clock_t end = clock();
		// cout << (end-start) << endl;
		//print execution time in ms
	}

	return 0;
}

Measured memory_bytes: 3664
import java.util.*;
import java.io.*;

/**
 * Made by egor https://github.com/chermehdi/egor.
 * 
 * @author Azuz
   
 */
public class Main {

    void solve(Scanner in, PrintWriter out) {
        double c = Math.PI * 2 * in.nextInt();
        out.println(c);
    }

    public static void main(String[] args) {
        try(Scanner in = new Scanner(System.in);
            PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }
}


Measured memory_bytes: 36016
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <cctype>
#include <cstdio>
using namespace std;

int main()
{
    char a[11], b[11], c[11];
    cin >> a >> b >> c;
    int alen=strlen(a), blen=strlen(b);
    if(a[alen-1]==b[0] && b[blen-1]==c[0]){
        cout << "YES";
    }else{
        cout << "NO";
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<string>

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

using namespace std;

typedef	unsigned long long	ull;

ull nCr[61][61];

string solve(int n,int num1,ull m){
	if(num1==0)	return string(n,'0');
	if(num1==n)	return string(n,'1');

	if(m<=nCr[n-1][num1])	return '0'+solve(n-1,num1,m);
	else					return '1'+solve(n-1,num1-1,m-nCr[n-1][num1]);
}

int main(){
	rep(n,61)	nCr[n][0]=1;
	for(int n=1;n<61;n++)rep(r,n+1)	nCr[n][r]=nCr[n-1][r]+nCr[n-1][r-1];

	int n; ull m;
	while(scanf("%d%llu",&n,&m),n){
		int num1;
		for(int i=0;;i++){
			if(m<=nCr[n][i]){ num1=i; break; }
			m-=nCr[n][i];
		}
		puts(solve(n,num1,m).c_str());
	}

	return 0;
}

Measured memory_bytes: 0