akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

int main()
{
  int five = 0;
  int seven = 0;

  for (int i = 0; i < 3; ++i) {
    int n;
    cin >> n;
    if (n == 5) five++;
    if (n == 7) seven++;
  }

  if (five == 2 && seven == 1)
    printf("YES\n");
  else
    printf("NO\n");

  return 0;
}


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

using namespace std;

char s[maxn];
int n;
int ans;

int main(){
	scanf("%s", s + 1);
	n = strlen(s + 1);
	for(int i = 1;i <= n;i++) ans -= s[i] == 'p';
	printf("%d", ans + n / 2);
}

Measured memory_bytes: 3864
import std.stdio;
import std.string;
import std.format;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.concurrency;
import std.traits;
import std.uni;
import core.bitop : popcnt;
alias Generator = std.concurrency.Generator;

enum long INF = long.max/5;
enum long MOD = 10L^^9+7;

void main() {
  long N;
  scanln(N);
  long[] xs = readln.split.to!(long[]).map!"a-1".array;

  long ans = 0;
  long j = 0;
  foreach(i; 0..N) {
    while(j<N && xs[j] != i) {
      j++;
      ans++;
    }
    j++;
  }

  if (ans >= N) {
    writeln(-1);
  } else {
    ans.writeln;
  }
}

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


void times(alias fun)(long n) {
  // n.iota.each!(i => fun());
  foreach(i; 0..n) fun();
}
auto rep(alias fun, T = typeof(fun()))(long n) {
  // return n.iota.map!(i => fun()).array;
  T[] res = new T[n];
  foreach(ref e; res) e = fun();
  return res;
}

T ceil(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  // `(x+y-1)/y` will only work for positive numbers ...
  T t = x / y;
  if (y > 0 && t * y < x) t++;
  if (y < 0 && t * y > x) t++;
  return t;
}

T floor(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  T t = x / y;
  if (y > 0 && t * y > x) t--;
  if (y < 0 && t * y < x) t--;
  return t;
}

ref T ch(alias fun, T, S...)(ref T lhs, S rhs) {
  return lhs = fun(lhs, rhs);
}
unittest {
  long x = 1000;
  x.ch!min(2000);
  assert(x == 1000);
  x.ch!min(3, 2, 1);
  assert(x == 1);
  x.ch!max(100).ch!min(1000); // clamp
  assert(x == 100);
  x.ch!max(0).ch!min(10); // clamp
  assert(x == 10);
}

mixin template Constructor() {
  import std.traits : FieldNameTuple;
  this(Args...)(Args args) {
    // static foreach(i, v; args) {
    foreach(i, v; args) {
      mixin("this." ~ FieldNameTuple!(typeof(this))[i]) = v;
    }
  }
}

void scanln(Args...)(auto ref Args args) {
  enum sep = " ";
  enum n = Args.length;
  enum fmt = n.rep!(()=>"%s").join(sep) ~ "\n";
  static if (__VERSION__ >= 2071) {
    readf!fmt(args);
  } else {
    enum argsTemp = n.iota.map!(
      i => "&args[%d]".format(i)
    ).join(", ");
    mixin(
      "readf(fmt, " ~ argsTemp ~ ");"
    );
  }
}

// fold was added in D 2.071.0
static if (__VERSION__ < 2071) {
  template fold(fun...) if (fun.length >= 1) {
    auto fold(R, S...)(R r, S seed) {
      static if (S.length < 2) {
        return reduce!fun(seed, r);
      } else {
        return reduce!fun(tuple(seed), r);
      }
    }
  }
}

// popcnt with ulongs was added in D 2.071.0
static if (__VERSION__ < 2071) {
  ulong popcnt(ulong x) {
    x = (x & 0x5555555555555555L) + (x>> 1 & 0x5555555555555555L);
    x = (x & 0x3333333333333333L) + (x>> 2 & 0x3333333333333333L);
    x = (x & 0x0f0f0f0f0f0f0f0fL) + (x>> 4 & 0x0f0f0f0f0f0f0f0fL);
    x = (x & 0x00ff00ff00ff00ffL) + (x>> 8 & 0x00ff00ff00ff00ffL);
    x = (x & 0x0000ffff0000ffffL) + (x>>16 & 0x0000ffff0000ffffL);
    x = (x & 0x00000000ffffffffL) + (x>>32 & 0x00000000ffffffffL);
    return x;
  }
}


Measured memory_bytes: 11556
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int h,n;
    cin >> h >> n;

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

    if(h <= 0){
        cout << "Yes" << endl;
    }else {
        cout << "No" <<endl;
    }
    return 0;
}

Measured memory_bytes: 888
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007

//qsort用、昇順
int compare_int(const void *a, const void *b)
{
	return *(int*)a-*(int*)b;
}
//qsort(data, 10, sizeof(int), compare_int)


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

Measured memory_bytes: 1732
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void)
{
	char buf[200];
	int a[100][51],dp[100][51];
	int i,j,k,x,p,n,flg,len;
	i=0;
	while(scanf("%s",buf)!=EOF)	{
		len=strlen(buf);
		j=0;	p=0;
		while(p<len)	{
			if(buf[p+1]==',' || p+1>=len)	{
				a[i][j]=buf[p]-'0';
				p+=2;
			}
			else {
				a[i][j]=(buf[p]-'0')*10+(buf[p+1]-'0');
				p+=3;
			}
			j++;
		}
		i++;
	}
	n=i;
	for(i=0;i<n;i++)	{
		for(j=0;j<=n/2;j++)	{
			dp[i][j]=0;
		}
	}
	dp[0][0]=a[0][0];
	for(i=0;i<n/2;i++)	{
		for(j=0;j<=i;j++)	{
			dp[i+1][j]=max(dp[i+1][j],dp[i][j]+a[i+1][j]);
			dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+a[i+1][j+1]);
		}
	}
	p=n/2+1;
	for(i=n/2;i<n-1;i++)	{
		for(j=0;j<=p;j++)	{
			if(j-1>=0)	{
				dp[i+1][j-1]=max(dp[i+1][j-1],dp[i][j]+a[i+1][j-1]);			
			}
			if(j<p)	{
				dp[i+1][j]=max(dp[i+1][j],dp[i][j]+a[i+1][j]);
			}
		}
		p--;
	}
	printf("%d\n",dp[n-1][0]);
	return 0;
}


Measured memory_bytes: 1012
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <queue>
#include <math.h>
#include <assert.h>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <time.h>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <stack>
#include <ctype.h>
#include <numeric>
#include <sstream>
#include <unistd.h>
#include <unordered_map>
#include <unordered_set>
#include <limits>
#include <random>
#include <chrono>
#include <iomanip>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
#define endl '\n'
#define debug(name) DEBUG(#name, (name))
template<typename T>
void DEBUG(string label, T value) {
    cerr << "[" << label << " = " << value << "]\n";
}

void solve(){
    string a, b;
    cin >> a >> b;
    if(a.size() != b.size()){
        if(a.size() > b.size()){
            cout << "GREATER" << endl;
        }
        else{
            cout << "LESS" << endl;
        }
    }
    else{
        for(int i = 0; i < (int)a.size(); ++i){
            if(a[i] < b[i]){
                cout << "LESS" << endl;
                return;
            }
            else if(a[i] > b[i]){
                cout << "GREATER" << endl;
                return;
            }
        }
        cout << "EQUAL" << endl;
    }
}
int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    solve();
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#define ll long long
#define INF 1e+18
#define MOD 998244353
using namespace std;

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>

using namespace std;
const long long MOD = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ll> pdl;
typedef pair<ld, ld> pdd;
//typedef boost::multiprecision::cpp_int bigint;

int main() {
	ll N;
	string S;
	cin >> N;
	cin >> S;
	ll n = 0;
	ll l = 0, r = 0;
	while (n < S.size()) {
		if (S[n] == '(')l++;
		else r++;
		if (r <= l)n++;
		else {
			S.insert(0, "(");
			l++;
			n += 2;
		}
	}
	if (l != r) {
		for (ll d = 0; d < l - r; d++)S += string(")");
	}
	cout << S << endl;
	return 0;
}

Measured memory_bytes: 256
// In the name of god
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

inline void solve()
{
  ll n;
  cin>>n;
  n = n%1000;
  if(n==0)
  {
    cout<<n;
  }
  else
  {cout<<1000-n;}
}



int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);cout.tie(0);
  solve();
}


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

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,N,j) for(int i = (N-1);i >= (j);i--)
#define _rec(i,N,j) for(int i = (N);i >=(j);i--)
#define ALL(x) x.begin(),x.end()
#define MEM(a,n) memset(a,n,sizeof(a))
#define fst first
#define scd second
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

int get_int(){int x;scanf("%d",&x);return x;}
LL get_ll(){LL x;scanf("%lld",&x);return x;}
double get_db(){double x;scanf("%lf",&x);return x;}

template<typename T> int chmin(T &a,T b){if(a > b){a = b;return 1;}else return 0;}
template<typename T> int chmax(T &a,T b){if(a < b){a = b;return 1;}else return 0;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {_for(i,0,v.size()) os << v[i] << " ";return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){for(auto a:v) os << a <<" ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){os << v.fst <<" "<<v.scd << " ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& v){for(auto a:v) cout << a << endl;return os;}

static const int dx[8] = { -1,  0, 1, 0,  1, -1,  1, -1};
static const int dy[8] = {0,  1, 0,  -1,  1, -1, -1,  1};
const double pi  = acos(-1.0);
const double eps = 1e-8;
const LL  INF  = 0x3f3f3f3f3f3f3f3f;
const int inf  = 0x3f3f3f3f;

const int maxn = 2e5 + 5;
const LL maxm = LL(1e18)+5;

deque<char> que;
int Q;

int main()
{
    string s;
    cin >> s;
    _for(i,0,s.size()){
        que.push_back(s[i]);
    }
    cin >> Q;
    int order = 0;
    _for(i,0,Q){
        int T;cin >> T;
        if(T == 1) order ^= 1;
        else{
            int F;
            string b;
            cin >> F >> b;
            if((F == 1 && (!order)) || (F == 2 && order)){
                que.push_front(b[0]);
            }
            else{
                que.push_back(b[0]);
            }
        }
    }
    if(order) reverse(ALL(que));
    _for(i,0,que.size()){
        cout << que[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 896
import heapq as hp

n,q=[int(x) for x in input().rstrip().split()]
l=[[] for i in range(n)]
pul=[0]*n
for i in range(n-1):
  a,b=map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)


for i in range(q):
  p,x=map(int,input().split())
  pul[p-1]+=x


ans=[0]*n
def dfs():
  val=0
  que=[[0,val]]
  done=[0]*n  

  while(que):
    now,val=que.pop()
    if done[now]==1:
      continue
    val+=pul[now]
    ans[now]=val
    done[now]=1

    for i in l[now]:
      if done[i]==0:
        que.append([i,val])

dfs()
print(*ans)


Measured memory_bytes: 65804
#include <stdio.h>
#include <stdlib.h>
 
int main(void) {
  int N, M, C, i, j, ans=0;
  int B[20];
  scanf("%d %d %d", &N, &M, &C);

  for(i=0; i<M; i++)
    scanf("%d", &B[i]);
  
  for(i=0; i<N; i++) {
    int ac = 0;
    for(j=0; j<M; j++) {
      int A;
      scanf("%d", &A);
      ac += A*B[j];
    }
    ac += C;
    if(ac > 0)
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 128
import java.util.*;


/**
 * Created by Seiya on 2016/10/16.
 */

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] map = new int[51];

        int n = scanner.nextInt();
        int m = scanner.nextInt();

        for (int i = 0; i < m; i++) {
            int temp = scanner.nextInt();
            map[temp - 1]++;
            temp = scanner.nextInt();
            map[temp - 1]++;
        }

        for (int i = 0; i < n; i++) {
            System.out.println(map[i]);
        }

    } // mainMethod


} // MainClass


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

using namespace std;

struct StronglyConnectedComponents
{
  vector< vector< int > > gg, rg;
  vector< pair< int, int > > edges;
  vector< int > comp, order, used;

  StronglyConnectedComponents(size_t v) : gg(v), rg(v), comp(v, -1), used(v, 0) {}

  void add_edge(int x, int y)
  {
    gg[x].push_back(y);
    rg[y].push_back(x);
    edges.emplace_back(x, y);
  }

  int operator[](int k)
  {
    return (comp[k]);
  }

  void dfs(int idx)
  {
    if(used[idx]) return;
    used[idx] = true;
    for(int to : gg[idx]) dfs(to);
    order.push_back(idx);
  }

  void rdfs(int idx, int cnt)
  {
    if(comp[idx] != -1) return;
    comp[idx] = cnt;
    for(int to : rg[idx]) rdfs(to, cnt);
  }

  int build(vector< vector< int > > &t)
  {
    for(int i = 0; i < gg.size(); i++) dfs(i);
    reverse(begin(order), end(order));
    int ptr = 0;
    for(int i : order) if(comp[i] == -1) rdfs(i, ptr), ptr++;

    t.resize(ptr);
    set< pair< int, int > > connect;
    for(auto &e : edges) {
      int x = comp[e.first], y = comp[e.second];
      if(x == y) continue;
      if(connect.count({x, y})) continue;
      t[x].push_back(y);
      connect.emplace(x, y);
    }
    return (ptr);
  }
};

int main()
{
  int N, M;
  cin >> N >> M;
  StronglyConnectedComponents scc(N);
  for(int i = 0; i < M; i++) {
    int s, t;
    cin >> s >> t;
    scc.add_edge(s, t);
  }
  vector< vector< int > > g;
  if(scc.build(g) == 1) {
    cout << 0 << endl;
  } else {
    bool in[100000] = {}, out[100000] = {};
    for(int i = 0; i < g.size(); i++) {
      in[i] = !g[i].empty();
      for(auto &to : g[i]) out[to] = true;
    }
    int latte = 0, malta = 0;
    for(int i = 0; i < g.size(); i++) {
      latte += in[i] ^ 1;
      malta += out[i] ^ 1;
    }
    cout << max(latte, malta) << endl;
  }
}

Measured memory_bytes: 11736
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main(void) {
  int n;
  double input[1001];
  double sum, avg, sigma, alpha;
  while(true){
    sum = 0.0;
    sigma = 0.0;
    cin >> n;
    if(n == 0) break;
    for(int i = 0; i < n; i++){
      cin >> input[i];
      sum += input[i];
    }
    avg = sum / n;
    for(int i = 0; i < n; i++){
      sigma += (input[i] - avg) * (input[i] - avg);
    }
    alpha = sqrt(sigma / n);
    cout << setprecision(11) << alpha << endl;
  }
  return 0;
}



Measured memory_bytes: 3296
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep4(i, a, b, c) for (int i = int(a), i##__b = int(b), i##__c = int(c); i < i##__b; i += i##__c)
#define rep1(n) rep4(i, 0, n, 1)
#define rep2(i, n) rep4(i, 0, n, 1)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define REP(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep3(i, a, b) for (int i = int(b) - 1, i##__a = int(a); i >= i##__a; i--)
#define rrep1(n) rrep3(i, 0, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep4(i, a, b, c) for (int i = int(a + (b - a - 1) / c * c), i##__a = int(a), i##__c = int(c); i >= i##__a; i -= i##__c)
#define RREP(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define FOR(i, x) for (auto &i : x)
#define ALL(v) (v.begin()), (v.end())
#define pb(x) emplace_back(x)
#define mp(x, y) make_pair(x, y)
#define mt make_tuple
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vbool = vector<bool>;
using vvbool = vector<vector<bool>>;
using vstring = vector<string>;
template <class T> using vec = vector<T>;
template <class T> using vv = vector<vector<T>>;
template <class T> using pq = priority_queue<T>;
template <class T> using rpq = priority_queue<T, vector<T>, greater<T>>;
#define vvint(A, H, W) vvint A(H, vint(W))
const int MOD = 1e9 + 7;
const int INF = 1e9 + 9;
const ll LINF = 1e18;
template <class T> bool chmax(T &a, const T &b) {if (a < b) {a = b;return 1;}return 0;}
template <class T> bool chmin(T &a, const T &b) {if (b < a) {a = b;return 1;}return 0;}
template <class T> void print(T x){cout<<x<<endl;}
// clang-format on

int main() {
    string s;
    cin >> s;
    int n = s.size();
    REP(i, n) {
        if (s[i] != '?') continue;

        if (i == n - 1) {
            s[i] = 'D';
            continue;
        }

        if (i > 0 && s[i - 1] == 'P') {
            s[i] = 'D';
            continue;
        }

        if (s[i + 1] == 'D') s[i] = 'P';
        if (s[i + 1] == 'P') s[i] = 'D';
        if (s[i + 1] == '?') s[i] = 'P';
    }
    print(s);
}

Measured memory_bytes: 3924
import math
s = list(input())
n = len(s)

for i in range(n):
    if s[i] != s[n - i - 1]:
        print("No")
        exit()
        
aa = math.floor((n - 1) / 2)
bb = math.ceil((n + 3) / 2)
a = s[0:aa]
b = s[bb - 1:n]

alen = len(a)
blen = len(b)

for i in range(alen):
    if a[i] != a[alen - i - 1]:
        print("No")
        exit()

for i in range(blen):
    if b[i] != b[blen - i - 1]:
        print("No")
        exit()

print("Yes")

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

template <class T>
void printvec(vector<T>& vec) {
    if (vec.empty()) {
        cout << endl;
        return;
    }
    cout << vec.front();
    for (int i = 1; i < vec.size(); i++) {
        cout << " " << vec[i];
    }
    cout << endl;
}

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

    vector<int> as[n];
    while (q--) {
        int t;
        cin >> t;
        if (t == 0) {
            int a, x;
            cin >> a >> x;
            as[a].push_back(x);
        } else if (t == 1) {
            int k;
            cin >> k;
            printvec(as[k]);
        } else {
            int k;
            cin >> k;
            as[k].clear();
        }
    }
}


Measured memory_bytes: 5860
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
float count1=0.0;
cin>>n;
if(n>=1&&n<=100){
    for(int i=1;i<=n;i++){
        if(i%2!=0)
            count1+=1;
    }
    cout<<count1/n<<endl;
}

return 0;}


Measured memory_bytes: 3780
#include<iostream>
#include<stdio.h>
#include<math.h>

using namespace std;

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)

class Point {
public:
	double x, y;


	Point(double x = 0, double y = 0) :x(x), y(y) {}

	Point operator + (Point p) { return Point(x + p.x, y + p.y); }
	Point operator - (Point p) { return Point(x - p.x, y - p.y); }
	Point operator * (double a) { return Point(a * x, a * y); }
	Point operator / (double a) { return Point(x / a, y / a); }

	double abs() { return sqrt(norm()); }
	double norm() { return x * x + y * y; };

	bool operator < (const Point& p)const {
		return x != p.x ? x < p.x : y < p.y;
	}

	bool operator ==(const Point& p)const {
		return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
	}

};

typedef Point Vector;

double dot(Vector a, Vector b) {
	return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b) {
	return a.x * b.y - a.y * b.x;
}

bool isOrthogonal(Vector a, Vector b) {
	return equals(dot(a, b), 0.0);
}

bool isParallel(Vector a, Vector b) {
	return equals(cross(a, b), 0.0);
}
struct Segment {
	Point p1, p2;
	Segment() {}
	Segment(Point p1, Point p2) :p1(p1), p2(p2) {}
};
typedef Segment  Line;

double norm(Vector a) {
	return a.x * a.x + a.y * a.y;
}

Point project(Segment s, Point p) {
	Vector base = s.p2 - s.p1;
	double r = dot(p - s.p1, base) / norm(base);
	return s.p1 + base * r;
}

Point reflect(Segment s, Point p) {
	return p + (project(s, p)-p) * 2.0;
}

int main() {
	double x1, y1, x2, y2, x0, y0;
	cin >> x1 >> y1 >> x2 >> y2;
	int q;
	Line s = Line(Point(x1, y1), Point(x2, y2));

	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> x0 >> y0;
		Point ans = reflect(s, Point(x0, y0));

		//cout << ans.x << " " << ans.y << endl;
		printf("%.8lf %.8lf\n", ans.x, ans.y);
	}

	return 0;
}


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

int main()
{
  vector<string> C(2);
  cin >> C.at(0) >> C.at(1);

  for (int i = 0; i < 3; i++)
  {
    if (C.at(0).at(i) != C.at(1).at(2 - i))
    {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <limits.h>
#include <numeric>
#include <math.h>
#include <bits/stdc++.h>
#define rep(i,c) for (int i=0;i<c;i++)
using namespace std;
typedef long long ll;
 
 
int main(){
    string a, b;
    cin >> a>> b;
    string num = a+b;
    int s = stoi(num);
    string ans = "No";
    rep(i,100100){
        if( i*i == s){
            ans = "Yes";
        }
    }
    cout << ans <<endl;

}

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

int main(void) {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  ll maxmum;
  maxmum = a * c;
  maxmum = max(maxmum, a * d);
  maxmum = max(maxmum, b * c);
  maxmum = max(maxmum, b * d);
  cout << maxmum << '\n';
  return 0;
}

Measured memory_bytes: 3632
N, M = map(int, input().split())
class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)] 
        
uf = UnionFind(N)
for m in range(M):
    a,b,c = map(int, input().split())
    uf.Unite(a-1, b-1)
ls = []
for n in range(N):
    ls.append(uf.Find_Root(n))
print (len(set(ls)))


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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<LL> PQ_DESC;
typedef priority_queue<LL, VL, greater<LL>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;
typedef priority_queue<VL> PQ_DESC_VL;
typedef priority_queue<VL, vector<VL>, greater<VL>> PQ_ASC_VL;
typedef priority_queue<PLL> PQ_DESC_PLL;
typedef priority_queue<PLL, vector<PLL>, greater<PLL>> PQ_ASC_PLL;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF*(LL)INF;
const int MOD = 1e9+7;

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

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

void Main()
{
    int n,m,k;cin>>n>>m>>k;

    REP(i,n+1){
        int now = m*i;
        REP(j,m+1){
            now -= i;
            now += (n-i);
            if(now == k){
                cout<<"Yes"<<endl;
                return;
            }
        }
    }
    cout<<"No"<<endl;
    
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct para
{
    int x, y;
};

int main()
{
    ios_base::sync_with_stdio(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    sort(a.begin(), a.end());
    if (a[0] == 0 && a[n - 1] == 0)
    {
        cout << "0" << endl;
        cout << "0 0";
        return 0;
    }
    vector<para> odp;
    if (a[0] < 0 && a[n - 1] > 0)
    {
        int m = a[0];
        for (int i = 1; i < n - 1; ++i)
        {
            if (a[i] >= 0)
            {
                odp.push_back({m, a[i]});
                m -= a[i];
            }
        }
        int M = a[n - 1];
        for (int i = 1; i < n - 1; ++i)
        {
            if (a[i] < 0)
            {
                odp.push_back({M, a[i]});
                M -= a[i];
            }
        }
        odp.push_back({M, m});
        cout << M - m << endl;
    }
    if (a[0] <= 0 && a[n - 1] <= 0)
    {
        int m = a[0];
        int M = a[n - 1];
        for (int i = n - 2; i >= 1; --i)
        {
            odp.push_back({M, a[i]});
            M -= a[i];
        }
        odp.push_back({M, m});
        cout << M - m << endl;
    }
    if (a[0] >= 0 && a[n - 1] >= 0)
    {
        int m = a[0];
        int M = a[n - 1];
        for (int i = 1; i < n - 1; ++i)
        {
            odp.push_back({m, a[i]});
            m -= a[i];
        }
        odp.push_back({M, m});
        cout << M - m << endl;
    }
    for (int i = 0; i < n - 1; ++i)
        cout << odp[i].x << " " << odp[i].y << endl;
    return 0;
}


Measured memory_bytes: 3188
#include <cstdio>
#include <cstdint>
#include <vector>

int main() {
  int N, A, B, C, D;
  scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);

  B -= A;
  if (B < 0)
    B = -B;

  if (B > intmax_t(D)*(N-1))
    return !printf("NO\n");

  for (intmax_t i=0; i<N; ++i)
    if (C*(N-1-i)-D*i <= B && B <= -C*i+(N-1-i)*D)
      return !printf("YES\n");

  printf("NO\n");
}


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

using namespace std;

using ll = long long;

int pop[100100];

int main(){
    int K = 1;
    string S;
    cin >> S;
    int n = S.size()/2;
    if(S.size() % 2 == 0){
        if(S[n] != S[n-1]){
            K = S.size()/2;
        }
        else{
            int a;
            a = 0;
            for(int i = 0; i < S.size()/2; i++){
                if(S[n] == S[n+i] && S[n-1] == S[n-1-i]) a++;
                else break;
            }
            K = S.size() / 2 + a;
        }
    }
    else{
        int a;
         a = 0;
         for(int i = 0; i <= S.size()/2; i++){
             if(S[n] == S[n+i] && S[n] == S[n-i]) a++;
             else break;
         }
         K = S.size()/2 + a;
    }

    cout << K << endl;
    return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <array>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>

// MARK: - header
namespace {
using namespace std;
using ll = long long;
using ull = unsigned long long;
}

// MARK: - answer

ll X, Y, Z, K;
vector<ll> A, B, C;

void input() {
    cin >> X >> Y >> Z >> K;
    A.resize(X);
    for (auto& a : A)
        cin >> a;
    B.resize(Y);
    for (auto& b : B)
        cin >> b;
    C.resize(Z);
    for (auto& c : C)
        cin >> c;
}

bool cut_search(ll p, vector<ll>* sums = nullptr) {
    ll cnt = 0;
    for (auto a : A) {
        for (auto b : B) {
            for (auto c : C) {
                auto sum = a+b+c;
                if (sum < p)
                    break;
                cnt++;
                if (sums)
                    sums->push_back(sum);
                else if (cnt >= K)
                    return true;
            }
        }
    }
    return cnt >= K;
}

void solve() {
    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    sort(C.rbegin(), C.rend());
    ll l = 0, r = A[0]+B[0]+C[0];
    ll p = 0;
    while (l <= r) {
        ll c = (l+r)/2;
        if (cut_search(c)) {
            p = c;
            l = c + 1;
        } else {
            r = c - 1;
        }
    }
    vector<ll> sums;
    cut_search(p, &sums);
    sort(sums.rbegin(), sums.rend());
    for (int i = 0; i < K; i++)
        cout << sums[i] << endl;
}

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



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

typedef long long ll;

int W, H;
vector<int> P, Q;

int main() {
    scanf("%d %d", &W, &H);
    P.resize(W);
    for(int i = 0; i < W; i++) {
        scanf("%d", &P[i]);
    }
    Q.resize(H);
    for(int i = 0; i < H; i++) {
        scanf("%d", &Q[i]);
    }

    int rcnt = 0, ccnt = 0;
    int pos1 = 0, pos2 = 0;

    sort(P.begin(), P.end());
    sort(Q.begin(), Q.end());

    ll cost = 0;
    while(pos1 < W && pos2 < H) {
        if(P[pos1] <= Q[pos2]) {
            cost += 1LL * P[pos1] * (H + 1 - ccnt);
            rcnt++;
            pos1++;
        }
        else {
            cost += 1LL * Q[pos2] * (W + 1 - rcnt);
            ccnt++;
            pos2++;
        }
    }
    while(pos1 < W) cost += 1LL * P[pos1] * (H + 1 - ccnt), rcnt++, pos1++;
    while(pos2 < H) cost += 1LL * Q[pos2] * (W + 1 - rcnt), ccnt++, pos2++;

    cout << cost;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

int main() {
    int a, b, k;
    cin >> a >> b >> k;
    for (int i = 0; i < k; ++i) {
        if (a + i > b)
            break;
        cout << a + i << endl;
    }
    vector<int> v;
    for (int i = 0; i < k; ++i) {
        if (b - i <= a + k - 1)
            break;
        v.push_back(b - i);
    }
    for (auto it = v.rbegin(); it != v.rend(); ++it) {
        cout << *it << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll n;
  cin >> n;
  vll a(n+1);
  vll ball(n+1, 0);
  for(ll i = 1; i <= n; i++) cin >> a[i];
  vll ans;
  for(ll i = n; i >= 1; i--) {
  	ll x = 0;
  	for(ll j = i*2; j <= n; j+=i) {
  		x+= ball[j];
  	}
  	if(x%2 == a[i]) continue;
  	else {
  		ball[i] = 1;
  		ans.pb(i);
  	}
  }
    for(ll i = n; i >= 1; i--) {
  	ll x = 0;
  	for(ll j = i; j <= n; j+=i) {
  		x+= ball[j];
  	}
  	// cout << x << " ";
  	if(x%2 == a[i]) continue;
  	else {
  		cout << -1;
  		return 0;
  	}
  }
  cout << ans.size() << endl;
  for(auto it: ans) cout << it << " ";
  return 0;
} //good night.

Measured memory_bytes: 5108
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;

int main() {
  int n;
  ull k;
  scanf("%d %llu",&n,&k);
  int a[n];
  for(int i = 0;i < n;i++)
    scanf("%d",&a[i]);
  unordered_map<int,bool> visited;
  int buffer[n];
  visited[1] = true;
  buffer[0] = 1;
  int index = 1;
  ull j = 0;
  int i = 1;
  int start = -1;
  while(j < k) {
    i = a[i-1];
    if(visited[i]) {
      start = i;
      break;
    }
    visited[i] = true;
    buffer[index++] = i;
    j++;
  }
  if(start!=-1) {
    int len = index;
    int loop_len = 0;
    int si = 0;
    for(int i = 0;i < len;i++) {
      if(buffer[i]==start) {
        loop_len = len-i;
        k=k-i;
        si = i;
        break;
      }
    }
    int dist = k%loop_len;
    printf("%d",buffer[si+dist]);
  }
  else
    printf("%d",buffer[k]);
  return 0;
}

Measured memory_bytes: 11588
N, M = map(int, input().split())
a = [0]*N
for _ in range(M):
    idx = int(input()) - 1
    a[idx] = 1
    
dp = [0]*(N+1)
dp[0] = 1
dp[1] = 1
for i in range(N-1):
    if a[i] == 0:
        dp[i+1] += dp[i]
        dp[i+2] += dp[i]
print(dp[N-1] % 1000000007)

Measured memory_bytes: 463476
import math

N=int(input())
e=[]
for i in range(N):
    x,y=map(int,input().split())
    t=math.atan2(y,x)
    e.append((x,y,t));e.append((x,y,t+2*math.pi))

e.sort(key=lambda z:z[2])
# print(e) #DB

sqans=0
for i in range(N):
    dx=e[i][0];dy=e[i][1]
    sqans=max(sqans,dx**2+dy**2)
    for j in range(i+1,i+N):
        dx+=e[j][0];dy+=e[j][1]
        sqans=max(sqans,dx**2+dy**2)
ans=math.sqrt(sqans)
print(ans)

Measured memory_bytes: 39536
N,M = map(int, input().split())
H = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for _ in range(M)]

S = set([i for i in range(1, N+1)])

for a, b in AB:
    ha = H[a-1]
    hb = H[b-1]

    if ha <= hb and a in S:
        S.remove(a)

    if hb <= ha and b in S:
        S.remove(b)

print(len(S))


Measured memory_bytes: 37320
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a,b,c,d = MI()
    print(max(a*b,c*d))
if __name__ == '__main__':
    main()

Measured memory_bytes: 3700
#include<bits/stdc++.h>
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using ii = pair<int, int>;

int main(){
	ios::sync_with_stdio(0);
	int h1, s1, h2, s2;
	cin >> h1 >> s1 >> h2 >> s2;
	bool flag = true;
	while(h1>0 and h2>0){
		if(!flag) h1-=s2;
		else h2-=s1;
		flag = !flag;
	}
	if(h1>0)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}


Measured memory_bytes: 3648
#include<iostream>
#include<algorithm>
#include<set>

using namespace std;

int main(void){
    int N;
    set<int> s;
    cin >> N;
    for(int i = 0; i < N; i++){
        int A;
        cin >> A;
        auto itr = s.find(A);
        if(itr == s.end()) s.insert(A);
        else s.erase(itr);
    }
    cout << s.size() << endl;
    return 0;
}


Measured memory_bytes: 4864
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;

ll n, t, q, a[100000], di[100000], x[1000];
ll d[100001], dcounter = 0, time[100000];

int main() {
  scanf("%lld%lld%lld", &n, &t, &q);
  for (ll i = 0; i < n; i++) scanf("%lld%lld", &a[i], &di[i]);
  for (ll i = 0; i < q; i++) scanf("%lld", &x[i]);
  for (ll i = 0; i < n - 1; i++) if (di[i] == 1 && di[i+1] == 2) d[dcounter++] = (a[i] + a[i + 1]) / 2;
  ll temp = 0;
  for (ll i = 0; i < n; i++) {
    if (di[i] == 1) {
      if (temp != dcounter && a[i] > d[temp]) temp++;
      if (temp == dcounter) time[i] = -1;
      else time[i] = d[temp] - a[i];
    } else {
      if (dcounter > 0 && a[i] < d[0]) time[i] = -1;
      else time[i] = a[i] - d[temp];
    }
  }
  for (ll i = 0; i < q; i++) {
    int num = x[i] - 1;
    if (time[num] == -1) {
      if (di[num] == 1) printf("%lld\n", a[num] + t);
      else printf("%lld\n", a[num] - t);
      continue;
    }
    if (di[num] == 1) printf("%lld\n", a[num] + min(t, time[num]));
    else printf("%lld\n", a[num] - min(t, time[num]));
  }
}



Measured memory_bytes: 5288
#include<iostream>
#include<algorithm>
#include<vector>
using lint=int64_t;
using namespace std;

int main()
{
	int N;

	cin >> N;

	vector<pair<int,int>> ans;
	int K;
	if(N%2==0)K=N;
	else      K=N-1;
	for(int i=1;i<=N;i++,K--)
	{
		for(int j=i+1;j<=N;j++)
		{
			if(j!=K)
				ans.push_back(make_pair(i,j));
		}
	}

	cout << ans.size() << endl;
	for(auto&& i:ans)
		cout << i.first << " " << i.second << endl;
	
	return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(void){
    // Your code here!
int n,d;
cin>>n>>d;

vector<vector<int>> vec(n+1, vector<int>(d+1));

for(int i=1;i<=n;i++){
    for(int j=1;j<=d;j++){
        cin>>vec[i][j];
    }
}

int answer=0;
for(int i=1;i<=n-1;i++){
    for(int j=i+1;j<=n;j++){
            long double ans=0;
            for(int k=1;k<=d;k++){
                    ans+=pow((vec[i][k]-vec[j][k]),2);
            }
            ans= sqrt(ans);
            if(ans==(int)ans)
             answer++;   
        }
    }

cout<<answer;
}


Measured memory_bytes: 3196
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>

using namespace std;
typedef long long ll;
const int MAX_N = 100000;
ll N, M, A[MAX_N];
ll dp[MAX_N + 1];

void solve() {
    long long res = 0;
    unordered_map<long long, long long> mp;

    for (int i = 0; i < N; i++) {
        dp[i + 1] = (dp[i] + A[i]) % M;
        mp[dp[i + 1]]++;
    }

    for (auto const &val: mp) {
        res += val.second * (val.second - 1) / 2;
        if (val.first == 0) {
            res += val.second;
        }
    }

    printf("%lld\n", res);
}

int main() {
    cin >> N >> M;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        A[i] = A[i] % M;
    }
    solve();
    return 0;
}

Measured memory_bytes: 4876
#include<iostream>

using namespace std;

int main(){

  int sum[10], in, num;

  while(1){

    cin >> in;

    if(in == 0) break;

    for(int i = 0; i < 10; i++){
      sum[i] = 0;
    }


    for(int i = 0; i < in; i++){
      cin >> num;
      sum[num]++;
    }


    for(int i = 0; i < 10; i++){
      if(sum[i] == 0) cout << "-";
      else{
	for(int j = 0; j < sum[i]; j++){
	  cout << "*";
	}
      }
      cout << endl;
    }


  }

  return 0;
}

Measured memory_bytes: 0
#pragma GCC optimize ("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
const int mod = 1e9+7;
static constexpr Int Inf = numeric_limits<Int>::max();
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int(i)=0; i<n; i++)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(pri2i,n-1)cout<<a[pri2i]<<' '; cout<<a[n-1]<<'\n';}
#define prip(p) cout<<p.fi<<' '<<p.se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char ch;

template< typename T >
struct edge {
  int src, to;
  T w;

  edge(int to, T w) : src(-1), to(to), w(w) {}

  edge(int src, int to, T w) : src(src), to(to), w(w) {}

  edge &operator=(const int &x) {
    to = x;
    return *this;
  }

  operator int() const { return to; }
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< Edges< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;

template< typename T >
vector< T > dijkstra(WeightedGraph< T > &g, int s) {
  const auto INF = numeric_limits< T >::max();
  vector< T > dist(g.size(), INF);

  using Pi = pair< T, int >;
  priority_queue< Pi, vector< Pi >, greater< Pi > > que;
  dist[s] = 0;
  que.emplace(dist[s], s);
  while(!que.empty()) {
    T cost;
    int idx;
    tie(cost, idx) = que.top();
    que.pop();
    if(dist[idx] < cost) continue;
    for(auto &e : g[idx]) {
      auto next_cost = cost + e.w;
      if(dist[e.to] <= next_cost) continue;
      dist[e.to] = next_cost;
      que.emplace(dist[e.to], e.to);
    }
  }
  return dist;
}


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

  cin>>n>>m>>q; WeightedGraph<int>g(n);
  rep(i,m){
    cin>>x>>y>>_; g[x].eb(y,_);
  }
  auto ans=dijkstra(g,q);
  rep(i,n){
    if(ans[i]>1e9)pri1("INF"); else pri1(ans[i]);
  }
  /*rep(i,m)rep(j,m){
    cin>>x;
    if(i!=j)g[i].eb(j,x);
  }
  V(int)buf=dijkstra(g,0);
  pri1(1);*/
  /*V(int)grp[3];
  rep(i,n)rep(j,n){
    cin>>x;
    grp[(i+j)%3].eb(x);
  }
  Int ans=1e18,cost;
  rep(i,m)for(int j=0; j!=i&&j<m; j++)for(int k=0; k!=i&&k!=j&&k<m; k++){
    cost=0;
    for(int e:grp[0])cost+=d[e][i];
    for(int e:grp[1])cost+=d[e][j];
    for(int e:grp[2])cost+=d[e][k];
    cmin(ans,cost);
  }
  END*/
}


Measured memory_bytes: 15308
using System;
using System.Collections.Generic;

namespace tst
{
    class Program
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            long sum = 0;
            for(int i=1; i<=n; i++)
            {
                if (i % 3 == 0) continue;
                else
                {
                    if (i % 5 == 0) continue;
                    else sum+= i;
                }
            }
            Console.WriteLine(sum);
        }
    }
}

Measured memory_bytes: 27480
#include<stdio.h>


int main(void) {
	char s[100000];
	char ex[100000];
	int i = 1;
	int cnt = 1;
	int s_sum = 0;
	int e_sum = 0;

	scanf("%s", &s);

	while (s[i] != '\0'){
		cnt++;
		i++;
	};
	//printf("cnt = %d\n", cnt);
	//
	for (i = 0; i < cnt; i++) {
		if (i % 2) {
			ex[i] = '0';
		}
		else {
			ex[i] = '1';
		}
		//printf("%c", ex[i]);
	}

	for (i = 0; i < cnt; i++) {
		if (ex[i] != s[i]) {
			s_sum++;
		}
	}
	//printf("\n");
	//
	for (i = 0; i < cnt; i++) {
		if (i % 2) {
			ex[i] = '1';
		}
		else {
			ex[i] = '0';
		}
		//printf("%c", ex[i]);
	}

	for (i = 0; i < cnt; i++) {
		if (ex[i] != s[i]) {
			e_sum++;
		}
	}
	//printf("\n");

	//printf("s = %d\n", s_sum);
	//printf("e = %d\n", e_sum);

	if (s_sum > e_sum) {
		printf("%d\n", e_sum);
	}
	else {
		printf("%d\n", s_sum);
	}
	
	
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll min(ll a,ll b)
  {
  	if(a>b)
  	  return b;
  	  else return a;
  }
int main()
{
ll n,k;
cin>>n>>k;
ll a=n/k;
cout<<min(abs(n-(k*(a))),abs(n-(k*(a+1))))<<endl;
}


Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    map<int,int> mp;
    for(int x=1;x<=100;x++){
        for(int y=1;y<=100;y++){
            for(int z=1;z<=100;z++){
                mp[x*x+y*y+z*z+x*y+y*z+z*x]++;
            }
        }
    }
    for(int i=1;i<=n;i++)cout << mp[i] << endl;
}

Measured memory_bytes: 5380
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>

using namespace std;

#define ll long long
#define el '\n'
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repi(i, a, b) for (int i = a; i >= b; i--)
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pii pair<int, int>
#define mp make_pair
#ifdef LOCAL
#define debug(fmt, ...) printf(fmt, ##__VA_ARGS__)
#define check(...) assert(__VA_ARGS__)
#else
#define debug(fmt, ...)
#define check(...)
#endif

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

    string s;
    cin >> s;
    bool ans = true;
    if (s.size() % 2 == 1) {
        ans = false;
    } else {
        for (int i = 0; i < s.size(); i += 2) {
            if (i + 1 < s.size() && (s[i] != 'h' || s[i + 1] != 'i')) {
                ans = false;
                break;
            }
        }
    }
    cout << (ans ? "Yes" : "No");
}


Measured memory_bytes: 256