akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace easy_Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] ab = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            Console.WriteLine((ab[0]*ab[1])%2==0?"Even":"Odd");
        }   
            // float[] ABN = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // long[] NK = Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // long N = NK[0];
            // long K = NK[1];
            // long K = long.Parse(Console.ReadLine());
            // int[] abc = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // string S = Console.ReadLine();
            // int x = int.Parse(Console.ReadLine());
            // int b = int.Parse(Console.ReadLine());
            // int N = int.Parse(Console.ReadLine());
            // float N = float.Parse(Console.ReadLine());
            // string c = Console.ReadLine();
            // string B = Console.ReadLine();
            // string[] s = Console.ReadLine().Split();
            // var s = (new string[] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }).Select(float.Parse);
            // float[] a = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // var X = Console.ReadLine();
            // int[,] abcd = new int[NMQ[2],4];
            // int[] A = new int[NMQ[0]];
            // int[] A_num = new int[NMQ[0]];
            // long[] s=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // var hs=new Dictionary<long,long>();
            // for(int i=0;i<s[0];i++){
            //     long[] q=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            //     if(hs.ContainsKey(q[0])){hs[q[0]]+=q[1];}
            //     else{hs.Add(q[0],q[1]);}
            // }
        
        // //最小公倍数
        // static long Lcm(long a, long b)
        // {
        //     return a/Gcd(a,b)*b;
        // }

        // //最大公約数
        // static long Gcd(long m, long n)
        // {
        //     if(n==0)return m;
        //     return Gcd(n,m%n);
        // }
    }
}


Measured memory_bytes: 11220
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
#include <random>
#include <time.h>
#include <unordered_set>

using namespace std;
using Int = long long;

constexpr double EPS = 1e-10;
constexpr long long MOD = 998244353;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for (int i = 0;i < 60; i++) {
        if (n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

long long my_mod_pow(long long x, long long n) {
	long long ret = 1;
	for (; n > 0; n >>= 1, x = x * x % MOD) {
		if (n & 1) {
			ret = ret * x % MOD;
		}
	}
	return ret;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

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

void fastInput() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int dist[100005];
vector<pair<int, int>> G[100005];

int dist_calc(int v, int parent) {
    int ret = 0;
    for (int i = 0; i < G[v].size(); i++) {
        int child = G[v][i].first;
        int weight = G[v][i].second;
        if (child == parent) continue;

        ret = max(dist_calc(child, v) + weight, ret); 
    }
    return dist[v] = ret;
}

int calc_ans(int v, int parent) {
    int ret = 0;
    vector<int> d;
    int max_1 = 0;
    int max_2 = 0;
    for (int i = 0; i < G[v].size(); i++) {
        int child = G[v][i].first;
        int weight = G[v][i].second;
        if (child == parent) continue;

        ret = max(calc_ans(child, v), ret);
        d.push_back(dist[child] + weight);
    }

    for (int i = 0; i < d.size(); i++) {
        max_1 = max(max_1, d[i]);
    }
    int flag = 1;
    for (int i = 0; i < d.size(); i++) {
        if (d[i] == max_1) {
            if (flag) {
                flag = 0;
            } else {
                max_2 = max(max_2, d[i]);
            }
        } else {
            max_2 = max(max_2, d[i]);
        }
    }
    return max(ret, max_1 + max_2);
}

int main(void) {
    int N; cin >> N;
    for (int i = 0; i < N-1; i++) {
        int s, t; cin >> s >> t;
        int w; cin >> w;
        G[s].push_back({t, w});
        G[t].push_back({s, w});
    }

    dist_calc(0, -1);

    // cout << "end" << endl;
    
    cout << calc_ans(0, -1) << endl;
}



Measured memory_bytes: 21364
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <iomanip>

typedef long double ld;
typedef long long ll;

using namespace std;


/* TEMPLATE ENDS HERE */

int main() {
	cout << fixed << setprecision(12);	
	string s;
	cin >> s;
	int ret = 0;
	for (int i = 0; i < s.length(); i++) {
		ret += s[i] - '0';
	}
	if (ret % 9 == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}


ll MOD = ((ll)1e9 + 7);

struct mod {
	ll x;

	mod(ll tx = 0) {
		x = tx;
		x %= MOD;
	}
	
	mod& operator=(const ll & tx) {
		x = tx % MOD;
		return *this;
	}
	
	mod& operator=(const mod & m2) {
		x = m2.x;
		return *this;
	}

	mod operator+(const mod& m2) const {
		return mod((x + m2.x) % MOD);
	}

	mod& operator+=(const mod& m2) {
		x += m2.x;
		x %= MOD;
		return *this;
	}

	mod operator-(const mod & m2) const {
		return mod((x - m2.x + MOD) % MOD);
	}

	mod& operator-=(const mod & m2) {
		x -= m2.x;
		x = (x + MOD) % MOD;
		return *this;
	}

	mod operator*(const mod & m2) const {
		return mod((x * m2.x) % MOD);
	}

	mod& operator*=(const mod & m2) {
		x *= m2.x;
		x %= MOD;
		return *this;
	}

	mod mypow(ll k) const {
		mod ret = 1;
		mod cur = x;
		while (k) {
			if (k & 1) {
				ret *= cur;
			}
			cur *= cur;
			k >>= 1;
		}
		return ret;
	}

	mod inv() const {
		return mypow(MOD - 2);
	}

	mod operator/(const mod & m2) const {
		return (*this) * m2.inv();
	}

	mod& operator/=(const mod & m2) {
		x *= m2.inv().x;
		x %= MOD;
		return *this;
	}

	bool operator<(const mod & m2) const {
		return x < m2.x;
	}
};

ostream &operator<<(ostream & os, const mod & m) {
	return os << m.x;
}



Measured memory_bytes: 3668
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
  int n, h, ai, bi;
  vector<int> a, b;
  scanf("%d%d", &n, &h);

  for (int i = 0; i < n; i++)
  {
    scanf("%d%d", &ai, &bi);
    a.push_back(ai);
    b.push_back(bi);
  }

  sort(a.begin(), a.end());
  sort(b.begin(), b.end());

  int maxA = a.back();
  int maxB = b.back();

  int attackCount = 0;
  while (h > 0)
  {
    if (maxA >= maxB)
    {
      int c = h / maxA;
      if (h % maxA != 0)
        c++;
      h -= c * maxA;
      attackCount += c;
    }
    else
    {
      h -= maxB;
      attackCount++;
      b.pop_back();
      maxB = b.back();
    }
  }

  printf("%d\n", attackCount);
  return 0;
}


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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		int n = Integer.parseInt(br.readLine());

		for (int i = 1; i <= n; i++) {
			if (i % 3 == 0) {
				sb.append(" ").append(i);
				continue;
			}
			int tmp = i;
			do {
				if (i % 10 == 3) {
					i = tmp;
					sb.append(" ").append(i);
					break;
				}
				i /= 10;
			} while (i != 0);
			i = tmp;
		}
		System.out.println(sb);
	}
}

Measured memory_bytes: 25040
import math
import re
import copy

neko = "Yes"
n = int(input())
w = []
for i in range(n):
    w.append(input())
s = copy.copy(w)
if len(set(s)) != len(w):
    neko = "No"
for i in range(len(w)-1):
    if w[i][len(w[i])-1] != w[i+1][0]:
        neko = "No"
        break
print(neko)

Measured memory_bytes: 3700
#include<iostream>
#include<vector>
#include<map>
 
using namespace std;
 
int n,k,ans;
vector<string> V;
map<string,bool> M;
 
void init(){
  V.clear();
  M.clear();
  ans = 0;
}
 
void solve(string s, int rev, int used){
  // cout << "s " << s << endl;
  if(rev == k){
    if(M[s] == false){
      M[s] = true;
      ans++;
    }
    return;
  }
 
  for(int i = 0; i < V.size(); i++)
    if(((1<<i)&used) == 0)
      solve(s+V[i],rev+1,used+(1<<i));
   
}
 
int main(){
  while(cin >> n >> k && n+k){
    init();
    for(int i = 0; i < n; i++){
      string in;
      cin >> in;
      V.push_back(in);
    }
    solve("",0,0);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1512
#include <cstdio>
#include <utility>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _il inline
#define _in _il int in
#define _sc _il bool scan
template <typename T>
T in(int c){T n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
_in() {return in<int>(gcu());}
template <typename T>
T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
//_sc(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename H,typename... T> _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
template <typename T>
_vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
//_vo(string &s){for(char c:s)pcu(c);}
//_vo(string s){for(char c:s)pcu(c);}
template <typename H,typename... T> _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename T> _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
_vl(){out('\n');}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	vector<int> v(in());
	iota(v.begin(), v.end(), 1);
	do {
		out(v);
	} while (next_permutation(v.begin(), v.end()));
}


Measured memory_bytes: 2556
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define INF (1<<29)
using namespace std;
typedef long long ll;
int main(){
      int n;
      int p[200];
      int a[3][200];
      int c[3][101];
      REP(i,3)REP(j,101)c[i][j]=0;
      REP(i,200)p[i]=0;
      cin>>n;
      REP(i,n)REP(j,3){
            cin>>a[j][i];
            c[j][a[j][i]]++;
      }
      REP(i,n)REP(j,3){
            if(c[j][a[j][i]]==1){
                  p[i]+=a[j][i];
            }
      }
      REP(i,n){
            cout<<p[i]<<endl;
      }
}

Measured memory_bytes: 1164
//************************
//*  Date: 2018.9.28     *
//*  Problem:            *
//*  Author: xuziyuan    * 
//************************

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int n,m;
vector <int> dd;

int main()
{
	cin>>n>>m;
	for(int i=1;i*i<=m;i++)
	{
		if(m%i==0) dd.pb(i),dd.pb(m/i);
	}
	sort(dd.begin(),dd.end());
	int p=lower_bound(dd.begin(),dd.end(),n)-dd.begin();
	cout<<m/dd[p]<<endl;
	rt0;
}

Measured memory_bytes: 256
let to_list str =
  let rec doit i acc =
    if i < 0 then acc
    else doit (i - 1) (str.[i] :: acc) in
  doit (String.length str - 1) []

let calc_area lst =
  let doit (i, idxs, acc) = function
    | '_' -> (i + 1, idxs, acc)
    | '\\' -> (i + 1, i :: idxs, acc)
    | _ ->
      match idxs with
      | [] -> (i + 1, idxs, acc)
      | j :: js -> (i + 1, js, ((j, i), i - j) :: acc) in
  List.fold_left doit (0, [], []) lst
  |> fun (_, _, t) -> t

let integrale lst =
  let rec doit acc = function
    | [] -> acc
    | [e] -> e :: acc
    | (((j1, i1), area1) as xs) :: ((((j2, i2), area2) :: tl) as ys) ->
      if j1 < j2 && i1 > i2 then doit acc (((j1, i1), area1 + area2) :: tl)
      else doit (xs :: acc) ys in
  doit [] lst

let () =
  let areas = integrale (calc_area (to_list (read_line ()))) in
  Printf.printf "%d\n" (List.fold_left (fun acc (_, n) -> acc + n) 0 areas);
  Printf.printf "%d" (List.length areas);
  List.iter (fun (_, n) -> Printf.printf " %d" n) areas;
  print_newline ()

Measured memory_bytes: 5016
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool etmin(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//https://www.creativ.xyz/dump-cpp-652/
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
 
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

#ifdef DEBUG_
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif

int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}

signed main(void) { cin.tie(0); ios::sync_with_stdio(false);
    int n;
    	cin>>n;
	for (int i = 0; i < n; i++) {
		
        cin>>x[i]>>y[i];
		X += x[i]; Y += y[i];
	}
	X /= n; Y /= n;
	double P = 0.1;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(X - x[0], Y - y[0]);
		for (int j = 1; j < n; j++) {
			e = dist(X - x[j], Y - y[j]);
			if (d < e) { d = e; f = j; }
		}
		X += (x[f] - X)*P;
		Y += (y[f] - Y)*P;
		P *= 0.999;
	}
	printf("%.16Lf\n", sqrt(d));
}

Measured memory_bytes: 256
N = gets.chomp.to_i
m1 = 0
m2 = 0
a = []
N.times do |n|
  a << gets.chomp.to_i
  if a[n] >= m1
    m2 = m1
    m1 = a[n]
  elsif a[n] > m2
    m2 = a[n]
  end
end

a.each do |a|
  puts a == m1 ? m2 : m1
end

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

#pragma GCC optimize("Ofast")
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const ll powll = 1LL<<1;

int main(void){
    string s; cin >> s;
    string f = "No";
    rep(i,3){
        if(s[i] == '7') f = "Yes";
    }
    cout << f << "\n";
}

Measured memory_bytes: 3624
import collections
def bfs(start):
    d = [-1]*n
    d[start] = 0
    q = collections.deque([start])
    while q:
        c = q.popleft()
        next_v = edge[c] 
        for v in next_v:
            if d[v] == -1:
                q.append(v)
                d[v] = d[c] + 1
    return d

n,m = map(int,input().split())
koho = []
edge = [[] for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    koho.append([a,b])
    edge[a].append(b)
    edge[b].append(a)
cnt = 0
for i in range(m):
    edge = [[] for _ in range(n)]
    for j in range(m):
        if i == j:
            continue
        edge[koho[j][0]].append(koho[j][1])
        edge[koho[j][1]].append(koho[j][0])
    a = bfs(0)
    flag = 0
    for j in a:
        if j == -1:
            flag = 1
    if flag == 1:
        cnt+=1
print(cnt)

Measured memory_bytes: 3316
#include<stdio.h>

int pop();
void push(int x);

int stack[11];
int stack_top = 0;

int main(void){

	int n, num;


	while(scanf("%d", &n) != EOF){
		if(n == 0){
			num = pop();
			printf("%d\n", num);
		}else{
			push(n);
		}
	}

	return 0;
}

int pop(){
	stack_top--;
	return stack[stack_top];
}

void push(int x){
	stack[stack_top] = x;
	stack_top++;

	return;
}

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

struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;
using intpair = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define ceiv(a, b) ((int)((a) + (b) - 1)/(int)(b))
#define int long long

signed main(){
    string s, t;
    cin >> s >> t;
    sort(ALL(s));
    sort(rALL(t));
    cout << (s < t ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
n = int(input())

s = []
for _ in range(n):
    s.append(input())

it = iter(s)
for p, ne in zip(it, it):
    if p[-1] != ne[0]:
        print("No")
        exit()

if s[-2][-1] != s[-1][0]:
    print("No")
    exit()

if len(set(s)) == n:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9132
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

#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;
	cin >> N;

	int num = 1;

	while (true)
	{
		if ((num*2) > N)
		{
			break;
		}

		num *= 2;
	}

	cout << num << endl;

	return 0;
}

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

int main(){
    int w,a,b;
    cin >> w >> a >> b;

    cout << max(0,abs(b-a)-w) << endl;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
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 all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
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<Pll> vPll;
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;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
int main(void)
{
	int n, ans1=0, ans2=0, ans3=1e9;

	string s;

	cin>>n>>s;

	vi w(n+1, 0), b(n+1, 0);

	rep(i, n){
		if(s[i]=='#'){
			b[i+1]=b[i]+1;
			w[i+1]=w[i];
		}else{
			w[i+1]=w[i]+1;
			b[i+1]=b[i];
		}
	}

	rep(i, n){
		w[i]=w[n]-w[i+1];
		ans3=min(ans3, b[i]+w[i]);
	}


	int start=n, end=0;
	rep(i, n){
		if(s[i]=='#'){
			start=i;
			break;
		}
	}
	reprev(i, n){
		if(s[i]=='.'){
			end=i+1;
			break;
		}
	}

	rep(i, n){
		if(i>start&&s[i]=='.') ans1++;
		if(i<end&&s[i]=='#') ans2++;
	}


	cout<<min(ans1, min(ans2, ans3))<<endl;
}


Measured memory_bytes: 2180
n = gets.chomp.split(" ").map(&:to_i)
a = []
que = []
n[0].times do |i|
  a[i] = gets.chomp.split(" ")
  a[i][1] = a[i][1].to_i
  que.push(a[i])
end
time = 0
while(que.size > 0)
  t = que.shift
  if(t[1] <= n[1])
    time += t[1]
    puts("#{t[0]} #{time}")
  else
    time += n[1]
    que.push([t[0],t[1] - n[1]])
  end
end

Measured memory_bytes: 20248
#include<bits/stdc++.h>
using namespace std;
#define ff          first
#define ss          second
#define ll         	long long int
#define pb          push_back
#define ar 			array
#define mp 			make_pair
#define f(i,n)   	for(ll i =0;i<n;i++)
#define inf 		INT_MAX
#define pll 		pair<ll, pair<ll,ll>>
const ll INF = 5e18;
void init(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE 
		freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#endif
}
ll A,B,C,D;
map<ll,ll> mapka;

void min_self(ll &a , ll b){
	a = min(a,b);
}

ll fo(ll goal){
	if(goal == 0){
		return 0;
	}
	if(goal == 1){
		return D;
	}
	if(mapka.count(goal)){
		return mapka[goal];
	}
	ll best = INF;
	if(D < INF / goal){
		min_self(best , D * goal);
	}

	for(int i = 0;i<3;++i){
		int mul = vector<int>{2,3,5}[i];
		ll cost = vector<ll>{A,B,C}[i];
		if(goal % mul == 0){
			min_self(best , cost + fo(goal / mul));
		}
		else{
			ll down = goal / mul * mul;
			min_self(best , cost + D * (goal - down) + fo(goal / mul));
			ll up = down + mul;
			min_self(best , cost  + D*(up - goal) + fo(goal / mul + 1));
		}
	}
	mapka[goal] = best;
	return mapka[goal];
}



void solve() {
	
	ll N;
	cin>>N;
	cin>>A>>B>>C>>D;
	cout<<fo(N)<<endl;
	mapka.clear();


}
int main(){
	//init();
	ll t = 1;
	cin>>t;
	for(ll i=1;i<=t;i++){
		//cout<<"Case #"<<i<<": ";
		solve();
	}
}


Measured memory_bytes: 4400
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <sstream>
#include <set>
#include <queue>
#include <stack>
#include <cctype>
#include <map>
#include <climits>
#include <bitset>
using namespace std;
#define MATH_PI 3.14159265358979323846
int main(){
	ios::sync_with_stdio(false);
	unsigned long long arrNums[90] = { 2, 1 };
	int iIndex;
	register int i;
	cin >> iIndex;
	for (i = 2; i <= 88; ++i){
		arrNums[i] = arrNums[i - 1] + arrNums[i - 2];
	}
	cout << arrNums[iIndex] << endl;
endapp:
	//system("pause > nul");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f40;
const long long mod=2e9+7;
const long double PI = acos(0);
// }}} End Header
int main() {
	ll a, b;
	cin >> a >> b;
	cout << (a*b)/__gcd(a, b) << endl;
	return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	string S;
	cin >> S;
	int x = 0;
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == '1') {
			x++;
		}
	}
	cout << x << endl;
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int main(void) {
	char x, y; cin >> x >> y;
	if(x < y) printf("<\n");
	else if(x > y) printf(">\n");
	else printf("=\n");
	return 0;
}

Measured memory_bytes: 256
use proconio::input;
use proconio::marker::{Chars};
use std::iter::Iterator;
use std::collections::HashSet;

fn main() {
    input! {
    n: i32,
    m: i32,
    mut s: [i32; m],
    }

    let sum : i32 =  s.iter().sum();

    if sum <= n {
        println!("{}", n - sum);
    }else{
        println!("-1");
    }

}


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

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int main() {
  int n, a, b;
  cin >> n >> a >> b;

  int ans = 0;
  for (int i=1; i<=n; ++i) {
    int sum = 0;
    for (int j=i; j!=0; j/=10) {
      sum += j%10;
    }
    if (a <= sum && b >= sum) ans += i;
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
ln = max(a) + 1
l = [0]*ln
ans = 0

for i in a:
    for j in range(i, ln, i):
        l[j] += 1

for i in a:
    if l[i] == 1:
        ans += 1

print(ans)

Measured memory_bytes: 32068
import qualified Data.IntMap as M
import qualified Data.ByteString.Lazy.Char8 as B
import Data.List
import Debug.Trace
import Test.QuickCheck

main = do
  _ <- getLine
  input <- B.getContents
  let as = map readInt . B.words $ input
  print (solve as)

readInt :: B.ByteString -> Int
readInt s = case B.readInt s of Just (n,_) -> n

solve :: [Int] -> Int
solve xs =
  sum . map (comb 2) .  filter (>1) . map length . group . sort . scanl (+) 0 $ xs

comb k n = product[n-k+1..n]`div`product[1..k]


Measured memory_bytes: 33020
implicit none
integer, parameter :: PREC=16
integer(PREC), parameter :: P=5
integer :: i
integer(PREC) :: c(P), n
read *,n
do i = 1, P
   read *,c(i)
enddo
print '(i0)',ceiling(n/real(minval(c),kind=PREC),kind=PREC)+(P-1)
end

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}



int h,w;


main(){

  cin>>w>>h;
  vector<int> a,b;
 
  rep(i,w){
    int c;
    cin>>c;
    a.PB(c);
  }
 
  rep(i,h){
    int c;
    cin>>c;
    b.PB(c);
  }

  sort(all(a));
  sort(all(b));

  int as=w+1,bs=h+1;
  int ans=0;
  int i=0,j=0;
  rep(_,w+h){
    if(i<a.size()&&j==b.size()||i<a.size()&&a[i]<b[j]){
      ans+=a[i]*bs;
      as--;
      i++;
    }else if(i==a.size()||a[i]>b[j]){
      ans+=b[j]*as;
      bs--;
      j++;
    }else{
      if(as>bs){
        ans+=a[i]*bs;
        as--;
        i++;
      }else{
        ans+=b[j]*as;
        bs--;
        j++;
      }
    }
    //cout<<ans<<' '<<i<<' '<<j<<endl;
  }

  cout<<ans<<endl;
}


Measured memory_bytes: 2548
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#define ordered_set tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;
#define int long long int
#define pb push_back
#define vec vector<int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define foo(i, a, b) for (int i = a; i < b; i++)
#define mp make_pair
#define deb(x) cout << #x << " --> " << x << endl;
#define deb1a(v)                  \
    cout << #v << "--->" << endl; \
    for (auto it : v)             \
        cout << it << " ";        \
    cout << endl;
#define deb2a(v)                  \
    cout << #v << "--->" << endl; \
    for (auto it : v)             \
    {                             \
        for (auto it1 : it)       \
        {                         \
            cout << it1 << " ";   \
        }                         \
        cout << endl;             \
    }
#define deb3a(v)                               \
    cout << #v << "-->" << endl;               \
    for (auto it : v)                          \
    {                                          \
        cout << it.fi << " " << it.se << endl; \
    }
#define mod 1000000007
#define so(v) sort(v.begin(), v.end())
#define fi first
#define se second
#define db1(x) cout << #x << "=" << x << endl
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
int mI(int a, int m)
{
    return power(a, m - 2, m);
}
vector<vector<int>> dir = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};

void solve()
{
    int n;
    cin>>n;
    vec v(n);
    fo(i, n) {
        cin >> v[i];
    }
    int ans = 0;
    foo(i,1,n){
        if(v[i]<v[i-1])
        {

            ans += v[i - 1] - v[i];
            v[i] = v[i - 1];
        }
    }
    cout << ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    srand(time(0));

    // FILE *fin = freopen("ip.txt","r",stdin);
    // FILE *fout = freopen("op.txt","w",stdout);
    int t = 1, nn = 1;
    //cin >> t;
    while (t--)
    {
        // cout << "Case #" << nn << ":"
        //      << " ";
        // nn++;
        solve();
    }
}

Measured memory_bytes: 4744
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#include<cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;

const ll MOD = INF + 7;



int main(){
    string s;
    cin >> s;
    int len = s.size();

    int cnt = 0;
    for(char c : s)if(c == 'o')cnt++;
    cout << (cnt >= len - 7 ? "YES" : "NO");
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
  int part, start, answer, i, j, member[100001] = {0}, right;
  scanf("%d %d %d", &part, &start, &answer);
  /* for (i = 0; i < part; i++) {
    member[i] = start;
  }*/
  for (i = 0; i < answer; i++) {
    scanf("%d", &right);
    member[right - 1]++;
    /*for (j = 0; j < part; j++) {
      member[j]--;
    }*/
  }
  for (i = 0; i < part; i++) {
    member[i] += start - answer;
  }
  for (i = 0; i < part; i++) {
    if (member[i] > 0)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  map<int ,int> mp;
  mp[a]++;
  mp[b]++;
  mp[c]++;
  for(auto p : mp) {
    if(p.second == 1) {
      cout << p.first << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
#define long long long

int const N = 1e3 + 10;
const int MOD = 1e9 + 7;

int m, n, f[N][N];
char a[N][N];

int main()
{
//    freopen("tam.inp", "r", stdin);
    cin.tie(nullptr); ios_base::sync_with_stdio(false);

    cin >> m >> n;
    for (int i = 1; i <= m; ++i) cin >> a[i] + 1;

    for (int i = 1; i <= m; ++i)
        for (int j = 1; j <= n; ++j) if (a[i][j] == '.')
            if (i == j && i == 1) f[i][j] = 1;
            else {
                if (a[i - 1][j] == '.') f[i][j] = ((long) f[i][j] + f[i - 1][j]) % MOD;
                if (a[i][j - 1] == '.') f[i][j] = ((long) f[i][j] + f[i][j - 1]) % MOD;
            }
    cout << f[m][n];

    return 0;
}


Measured memory_bytes: 5248
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
typedef long long unsigned int ll;

using namespace std;

ll n;
ll a[5];
ll b[5];
int main(){
  cin >> n;
  REP(i,5) cin >> a[i];
  sort(a,a+5);
  cout << (n+a[0]-1)/a[0]+ 4 << endl;
  return 0;
}


Measured memory_bytes: 256
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define ifYN(x) cout<<(x?"Yes":"No")<<"\n" 
#define dcml(n) fixed<<setprecision(n)

 
ll GCD(ll a,ll b) { return b ? GCD(b,a%b) : a; } 
ll LCM(ll a,ll b) { return a/GCD(a,b)*b; } 
ll Factorial(ll n){ ll m=1;while(n>=1)m*=n--;return m; } 
ll modPow(ll x,ll n,ll mod=MOD){ 
    return (!n?1:!n%2?modPow(x*x,n/2,mod)%mod:x%mod*modPow(x,n-1,mod)%mod); 
} 
ll GetDigit(ll num){ 
    ll digit=0; 
    while(num!=0){num/=10;digit++;} 
    return digit; 
} 


using namespace std;
//-------------------------------------------
int main(){
  ll N;cin>>N;
  string S;cin>>S;
  char c=S[0];ll cnt=0;
  REP(i,N){
    if(c!=S[i]){
      c=S[i];
      cnt++;
    }
    if(i==N-1)cnt++;
  }
  cout<<cnt;
}


Measured memory_bytes: 512
#include <stdio.h>
#include <string.h>
int main(){
	char w[100], t[100];
	char *p;
	int c = 0;
	scanf("%s", w);

	while(1){
		scanf("%s", t);
		if(strcmp(t, "END_OF_TEXT")==0)break;
		for(p = t; *p!='\0'; p++){
			if('A'<=*p && *p <= 'Z')
				*p+='a'-'A';
		}
		if(strcmp(t, w)==0)c++; 
	}
	printf("%d\n", c);

	return 0;
}

Measured memory_bytes: 548
/**
*
* Author: MARC
* Lang: GNU C++14
*
**/

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

#define F first
#define S second
#define ii pair < int , int >
#define LS pair < ll , string >

typedef unsigned long long ull;
typedef long double ldbl;
typedef long long ll;
typedef double dbl;

const ldbl E = 2.71828182845904523536;
const ldbl pi = acos(-1);
const dbl eps = 1e-9;
const ll mod = 1e9+7;
const ll inf = 1LL<<30;

/** /////////// ** Code ** /////////// **/

const int N=100100;

int main()
{
    int n; scanf("%d",&n);
    int ans=0;
    while(n--){
        int l,r; scanf("%d%d",&l,&r);
        ans+=r-l+1;
    }

    printf("%d",ans);
}


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


int main(){

    int n, q;
    string s;
    vector<set<int>> A(26);
    
    cin >> n >> s >> q;

    for(int i = 0; i < n; i++){
        A[s[i] - 'a'].insert(i);
    }

    for(int i = 0; i < q; i++){
        int x;
        cin >> x;
        if(x == 1){
            int y;
            char c;
            cin >> y >> c;
            y--;
            A[s[y] - 'a'].erase(y);
            A[c - 'a'].insert(y);
            s[y] = c;
        }
        else{
            int l, r;
            cin >> l >> r;
            l--; r--;
            int ans = 0;
            for(int i = 0; i < 26; i++){
                auto it = A[i].lower_bound(l);
                if( it != A[i].end() && *it <= r ){
                    ans++;
                }
            }
            printf("%d\n", ans);
        }
    }

    return 0;
}

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


int main() {
    int n;
    cin>>n;
    char s[n];
    int c[n+1][26];
    for (int k = 0; k < 26; ++k) {
        c[0][k]=0;
    }
    for (int i = 0; i < n; ++i) {
        char t;
        for (int j = 0; j < 26; ++j) {
            c[i+1][j]=c[i][j];
        }
        cin>>t;
        c[i+1][t-97]++;
    }
    int ma=0;
    for (int l = 0; l < n; ++l) {
        int co=0;
        for (int i = 0; i < 26; ++i) {
            if(c[l+1][i]*(c[n][i]-c[l+1][i])>0)co++;
        }
        ma=max(ma,co);
    }
    cout<<ma<<endl;
}


Measured memory_bytes: 256
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end


def min(a,b)
  return a>b ? b : a
end
N,M,R=get_i
r=get_i
R.times do|i|
  r[i]-=1
end
d=array(N,N)
N.times do|i|
  N.times do|j|
    if i==j
      d[i][j]=0
    else
      d[i][j]=10**9
    end
  end
end
M.times do|i|
  a,b,c=get_i
  a-=1
  b-=1
  if d[a][b]>c
    d[a][b]=c
    d[b][a]=c
  end
end
N.times do|k|
  N.times do|i|
    N.times do|j|
      d[i][j]=min(d[i][j],d[i][k]+d[k][j])
    end
  end
end
ans=10**9
r.permutation(R).to_a.each do|arr|
  temp=0
  (R-1).times do|i|
    temp+=d[arr[i]][arr[i+1]]
  end
  ans=temp if ans>temp
end
puts ans

Measured memory_bytes: 7164
#include <iostream>
#include <string>

int main()
{
    std::string s;
    std::cin >> s;

    int count_a = 0, count_b = 0;
    for (char c : s) {
        if (c == 'A') ++count_a;
        else ++count_b;
    }
    std::cout << (count_a > 0 && count_b > 0 ? "Yes" : "No") << std::endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define max(a, b)	(((a) > (b)) ? (a) : (b))		/* ２個の値の最大値 */
#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */
#define ENTER		printf("\n")					/* 改行プリント */
int DBG = 1;										/* デバッグプリント 提出時は0 */
/* main *************************************************************/
int main()
{
	int		a,b,c,i,j,k,n,m,x,y,ans = 0;
	char	str[256];
	
	scanf("%d", &x);
	
	for(i=1;;i++) {
		if ( ((i*100) > x) && ((i*105) > x) ) break;
		if ( ((i*100) <= x) && ((i*105) >= x) ) {
			ans = 1;
			break;
		}
	}
	
	printf("%d\n",ans);


	return 0;
}


Measured memory_bytes: 128
#!/usr/bin/env python3
from sys import stdin

MOD = int(1e9 + 7)


def solve(tc):
    n, k = map(int, stdin.readline().split())

    ans = 0
    for i in range(k, n + 2):
        lo = (i - 1) * i // 2
        hi = (n + n - i + 1) * i // 2

        ans += hi-lo+1
        ans %= MOD
    print(ans)


tcs = 1
LOCAL_TEST = not __debug__
if LOCAL_TEST:
    infile = __file__.split('.')[0] + "-test.in"
    stdin = open(infile, 'r')
    tcs = int(stdin.readline().strip())

tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

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

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

    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];

    vector<int> price;
    int cur = a[0], bigorsmall = -1;
    for (int i = 1; i < n; i++){
        if (a[i] > cur){
            if (bigorsmall == -1){
                price.push_back(cur);
                bigorsmall = 1;
                cur = a[i];
            }
            else if (bigorsmall == 1)
                cur = a[i];
            else{
                price.push_back(cur);
                cur = a[i];
                bigorsmall = 1;
            }
        }
        else{
            if (bigorsmall == -1){
                cur = a[i];
                bigorsmall = 0;
            }
            else if (bigorsmall == 0)
                cur = a[i];
            else{
                price.push_back(cur);
                cur = a[i];
                bigorsmall = 0;
            }
        }
    }
    
    if ((int) price.size() > 0 && cur > price.back())
        price.push_back(cur);

    
    long long m = 1000;
    for (int i = 0; i < (int) price.size() && i + 1 < (int) price.size(); i += 2){
        long long x = m / price[i];
        m -= x * price[i];
        m += x * price[i + 1];
    }

    cout << m << '\n';

    return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    int ans=0;
    rep(i,n){
        if((i+1)%2==1&&a[i]%2==1) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,i,sum;cin >> n;
  int a[n];
  for (i=0;i<n;i++){
    cin >> a[i];sum += a[i];
  }
  sort(a,n+a);
  cout << ((a[n-1] < sum-a[n-1]) ? "Yes":"No") << endl;
}

Measured memory_bytes: 256
N = int(input())
ls = [0 for i in range(10**5)]
now = 0
A = list(map(int,input().split()))
for i in range(N):
    now += A[i]
    ls[A[i]-1] += 1
q = int(input())
for i in range(q):
    a,b = map(int,input().split())
    now += (b-a)*ls[a-1]
    print(now)
    ls[b-1] += ls[a-1]
    ls[a-1] = 0

Measured memory_bytes: 21792
# unionfind
class Uf:
	def __init__(self, N):
		self.p = list(range(N))
		self.rank = [0] * N
		self.size = [1] * N
	#検索 ノード番号を受け取って一番上の親ノードの番号を帰す
	def root(self, x):
		if self.p[x] != x:
			self.p[x] = self.root(self.p[x])

		return self.p[x]
	#同じ集合に属するか判定
	def same(self, x, y):
		return self.root(x) == self.root(y)
	#併合
	def unite(self, x, y):
		# 根を探す
		u = self.root(x)
		v = self.root(y)

		if u == v: return

		#木の高さを比較し、低いほうから高いほうに辺を張る
		if self.rank[u] < self.rank[v]:
			self.p[u] = v
			self.size[v] += self.size[u]
			self.size[u] = 0
		else:
			self.p[v] = u
			self.size[u] += self.size[v]
			self.size[v] = 0
			#木の高さが同じなら片方を1増やす
			if self.rank[u] == self.rank[v]:
				self.rank[u] += 1
	#ノード番号を受け取って、そのノードが含まれている集合のサイズを返す
	def count(self, x):
		return self.size[self.root(x)]

from collections import Counter	
N, K, L = map(int, input().split())
uf_load = Uf(N)
uf_rail = Uf(N)

for i in range(K):
	p, q = map(int, input().split())
	p-=1
	q-=1
	uf_load.unite(p, q)
for _ in range(L):
	r, s = map(int, input().split())
	r-=1
	s-=1
	uf_rail.unite(r, s)

union_sets = [(uf_load.root(i), uf_rail.root(i)) for i in range(N)]
counts=Counter(union_sets)
ans = [counts[union_set] for union_set in union_sets]
print(*ans)

Measured memory_bytes: 171284
#include<iostream>

 using namespace std;

int n, m;
int l[100015], r[100015];
int mini, maxi;

int solver(){  
  mini = 1;
  maxi = n;
  for(int i = 1; i < m + 1; ++i){
    if(mini < l[i]){
      mini = l[i];
    }
    if(maxi > r[i]){
      maxi = r[i];
    }
  }
  if(mini <= maxi){
    return maxi - mini + 1;
  }else{
    return 0;
  }
  
}

 int main(){
   cin >> n >> m;
   for(int i = 1; i < m + 1; ++i){
     cin >> l[i] >> r[i];
   }
   cout << solver() << endl;
 }

Measured memory_bytes: 1024
(declaim (optimize (speed 3) (debug 0) (safety 0)))
(declaim (inline sum-seq))
(defun sum-vec (vec)
  (declare (type vector vec))
  (loop for x across (the vector vec) summing x))

(defparameter solve-times
  (concatenate 'vector (loop for i from 1 to (read)
                          collect (read))))

(defparameter total-time
  (sum-vec solve-times))

(defparameter drinks
  (loop for i from 1 to (read)
       collect (cons (read) (read))))

(loop for drink in drinks
   do (progn (prin1 (+ (cdr drink)
                       (- (aref solve-times (1- (car drink))))
                       total-time))
             (terpri)))


Measured memory_bytes: 4584
//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
//Atcoder Educational DP
//N-Slimes
/*
    I ♥ CLARICE STARLING

    EXPLAINATION BELOW->
    Dp+segment tree

*/
//Iterative Solution
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(x) x.begin(),x.end()
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define MOD7 1000000007
const ll INF=(ll)1e18+5;
const int N=(int)2e5+5;
int n;
ll a[N],h[N];
ll dp[N],segment_tree[2*N+1];
/*void update(int node,int start,int end,int idx,ll val)
{
    if(start==end)segment_tree[node]=max(segment_tree[node],val);
    else
    {
        int mid=start+(end-start)/2;
        if(start>=idx&&idx<=mid)update(2*node,start,mid,idx,val);
        else update(2*node+1,mid+1,end,idx,val);
        
        segment_tree[node]=max(segment_tree[2*node],segment_tree[2*node+1]);
    }
}*/
void update(int node,int st,int en,int id,long long val)
{
    if(st>en || st>id || en<id) return ;
    if(st==en && st==id){
        segment_tree[node]=max(segment_tree[node],val);
        return ;
    }
    int mid=(st+en)/2;
    if(st<=id && id<=mid){
        update(2*node,st,mid,id,val);
    }
    else{
        update(2*node+1,mid+1,en,id,val);
    }	
    segment_tree[node]=max(segment_tree[2*node],segment_tree[2*node+1]);
}
ll query(int node,int start,int end,int l,int r)
{
    if(start>r||end<l)return 0;
    if(start>=l&&end<=r)return segment_tree[node];
    int mid=start+(end-start)/2;
    return max(query(2*node,start,mid,l,r),query(2*node+1,mid+1,end,l,r));
}
//dp[i] indicates max possible sum when i is the last height considered 
void solve()
{
    int i;cin>>n;
    foe(i,1,n)cin>>h[i];
    foe(i,1,n)cin>>a[i];
    dp[0]=0;
    
    ll ans=0;
    foe(i,1,n)
    {
       ll tmp=query(1,1,n,1,h[i]-1);
        dp[h[i]]=a[i]+tmp;
        update(1,1,n,h[i],dp[h[i]]);
    }
    
    foe(i,0,n)ans=max(ans,dp[i]);
    cout<<ans<<"\n";

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



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

int main() {
    int N, K; cin >> N >> K;
    vector<int> p(N);
    for (int i = 0; i < N; i++) cin >> p.at(i);
    sort(p.begin(), p.end());
    int sum = 0;
    for (int i = 0; i < K; i++) {
        sum += p.at(i);
    }
    cout << sum << endl;
}

Measured memory_bytes: 3632