akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main(void)
{
	char abacus[10][8] = {
		{'*', ' ', '=', ' ', '*', '*', '*', '*'},
		{'*', ' ', '=', '*', ' ', '*', '*', '*'},
		{'*', ' ', '=', '*', '*', ' ', '*', '*'},
		{'*', ' ', '=', '*', '*', '*', ' ', '*'},
		{'*', ' ', '=', '*', '*', '*', '*', ' '},
		{' ', '*', '=', ' ', '*', '*', '*', '*'},
		{' ', '*', '=', '*', ' ', '*', '*', '*'},
		{' ', '*', '=', '*', '*', ' ', '*', '*'},
		{' ', '*', '=', '*', '*', '*', ' ', '*'},
		{' ', '*', '=', '*', '*', '*', '*', ' '}
	};
	
	int n, array[5], i, j, f = 0;
	
	while (scanf("%d", &n) != EOF){
		for (i = 0; i < 5; i++){
			array[4 - i] = n % 10;
			n /= 10;
		}
		
		if (f != 0){
			puts("");
		}
		f = 1;
		
		for (j = 0; j < 8; j++){
			for (i = 0; i < 5; i++){
				printf("%c", abacus[array[i]][j]);
			}
			puts("");
		}
	}
	
	return (0);
}

Measured memory_bytes: 588
#include <bits/stdc++.h>
#define ll long long
#define mod 998244353 
using namespace std;
map<string,int> f,g;
string st;
int cf(string st);
int cg(string st)
{
	if(g.count(st)) return g[st];
	if(st.size()==1) return g[st]=st[0]-'0'+1;
	int i,j;
	for(i=1;i<st.size();i++) if(st.size()%i==0)
	{
		string nxt=st.substr(0,i);
		for(j=0;j<st.size();j++)
		{
			nxt[j%i]=min(nxt[j%i],st[j]);
		}
		g[st]=(g[st]+cf(nxt))%mod;
	}
//	cerr<<"g   "<<st<<' '<<g[st]<<endl;
	return g[st];
}
int cf(string st)
{
	if(f.count(st)) return f[st];
	int i;
	for(i=1;i<=st.size();i++)
	{
		f[st]=(f[st]+1ll*cf(st.substr(0,st.size()-i))*cg(st.substr(st.size()-i,i)))%mod;
	}
//	cerr<<"f   "<<st<<' '<<f[st]<<endl;
	return f[st];
}
int main()
{
	f[""]=1;
	cin>>st;
	cout<<cf(st)<<endl;
	return 0;
}

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

int main() {
    int a;
    cin >> a;
    int h = a / 3600;
    int sec = a % 3600;
    int m = sec / 60;
    int s = sec % 60;
    cout << h << ":" << m << ":" << s << endl;
    return 0;
}


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

#define ll long long
#define fi first
#define se second
#define mp make_pair

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"

using namespace std;

ll a,b,n;

ll f(ll A,ll B, ll x){
	return floor(A*x/B)-A*floor(x/B);
}

void solve(){
	
//	for(int x=1;x<=n;x++){
//		cout<<x<<" "<<f(a,b,x)<<endl;
//	}
	cout<<f(a,b,min(b-1,n))<<endl;
}

int main(){
	
	fastio();
	
	cin>>a>>b>>n;
	
	solve();
	
	return 0;
}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main() {
	int n, T, min = -1;
	cin >> n >> T;
	int *c = new int[n], *t = new int[T];
	for (int i = 0; i < n; i++) {
		cin >> c[i] >> t[i];
		if (t[i] <= T) {
			if (min > c[i] || min == -1)
				min = c[i];
		}
	}
	if (min == -1)
		cout << "TLE\n";
	else
		cout << min << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        var nums = ConsoleUtil.IntArrayReadLine();

        Console.WriteLine(Math.Max(nums[0] * nums[1], nums[2] * nums[3]));
    }
}



static class ConsoleUtil
{
    public static string[] StrArrayReadLine(char sepalator)
    {
        string str = Console.ReadLine();
        return str.Split(sepalator).ToArray();
    }
    public static string[] StrArrayReadLine()
    {
        string str = Console.ReadLine();
        if (str.Contains(','))
        {
            return str.Split(',').ToArray();
        }
        {
            return str.Split(' ').ToArray();
        }
    }
    
    public static int[] IntArrayReadLine()
    {
        return StrArrayReadLine().Select(s => int.Parse(s)).ToArray();
    }
    public static int[] IntArrayReadLine(char sepalator)
    {
        return StrArrayReadLine(sepalator).Select(s => int.Parse(s)).ToArray();
    }

    public static int IntReadLine() => int.Parse(Console.ReadLine());
}



Measured memory_bytes: 13280
#include <bits/stdc++.h>
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;
#define PI 3.14159265359
#define tMOD 998244353
#define mkpr(x,y) make_pair(x,y)

int main(){
  string h;
  cin>>h;

  if(h=="SUN"){
    cout<<7<<endl;
  }
  else if(h=="MON"){
    cout<<6<<endl;
  }
    else if(h=="TUE"){
    cout<<5<<endl;
  }
    else if(h=="WED"){
    cout<<4<<endl;
  }
    else if(h=="THU"){
    cout<<3<<endl;
  }
    else if(h=="FRI"){
    cout<<2<<endl;
  }
    else if(h=="SAT"){
    cout<<1<<endl;
  }

return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stack>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <functional>
#include <string>
#include <cstdlib>
#include <numeric>
#include <cstdbool>
#include <map> 
#include<set>
#include<queue>

typedef long long ll;


#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;

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

const long long INF = 1000000000000000;
const ll inf = -1e18;
typedef pair<ll, ll> P;
ll ma = 1000000000 + 7;
ll mx = 1000003;
ll h, w, n,m,k; string s,t;
int dis[101][101]; int graph[52][52]; bool vis[52];
int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };
ll gcd(ll x, ll y) {
	if (x % y == 0) return y;
	return gcd(y, x % y);

}
ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
void comb(vector<vector <ll> >& v) {
	for (ll i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (ll k = 1; k < v.size(); k++) {
		for (int j = 1; j < k; j++) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j])%ma;
		}
	}
}

ll GetDigit(ll num) {
	return log10(num) + 1;
}
int sy, sx;
char maze[1010][1010];
P nums[10];
ll bfs(ll goal) {
	queue<P> que;
	rep(i,h){
		rep(j, w) {
			dis[i][j] = -1;
		}
	}
	que.push(P(sy, sx));
	dis[sy][sx] = 0;

	while (que.size() > 0) {
		P p = que.front();
		que.pop();
		if (p.first == nums[goal].first && p.second == nums[goal].second) break;
		for (int i = 0; i < 4; i++) {
			int ny = p.first + dy[i];
			int nx = p.second + dx[i];
			if (0 <= ny && ny < h && 0 <= nx && nx < w && maze[ny][nx] != 'X' && dis[ny][nx] == -1) {
				que.push(P(ny, nx));
				dis[ny][nx] = dis[p.first][p.second] + 1;
			}
		}
	}
	sy = nums[goal].first;
	sx = nums[goal].second;
	return dis[nums[goal].first][nums[goal].second];
}

int main() {
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	cin >> n;
	chmin(b, a * 2);
	chmin(c, b * 2);
	if (2 * c <= d) {
		cout << n * c << endl;
		return 0;
	}
	else if (2 * c > d) {
		cout << (n / 2) * d + (n % 2) * c << endl;
		return 0;
	}
}



Measured memory_bytes: 256
# 169A

# 1.入力をちゃんと受け取る
# ex:「2 5」＞＝ a=2, b=5みたいにしないといけない
a, b = map(int, input().split())
# print(a)
# print(b)

# 2.目的通りの計算をする
# ex: ２つの整数AとBの掛け算をやる
answer = a * b
# 3.計算の結果を出力する
print(answer)

Measured memory_bytes: 9148
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  
  cin >> a >> b;
  
  if ((a * b) % 2 == 0) {
  cout << "Even" << endl;
 } else {
    cout << "Odd" << endl;
 }
}  

Measured memory_bytes: 3592
using System;
using System.Collections.Generic;
using static Assistant.Input;
using System.Linq;
using Assistant;
using System.Text;

namespace Temp20200521
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = ReadInt;
            int q = ReadInt;

            BIT bit = new BIT(n);
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < q; i++)
            {
                if (ReadInt == 0)
                {
                    bit.Add(ReadInt, ReadInt, ReadInt);
                }
                else
                {
                    int k = ReadInt;
                    sb.AppendLine(bit.Sum(k, k).ToString());
                }
            }

            Console.Write(sb);
        }


    }

    class BIT
    {
        long[] bit0, bit1;  //1-indexed
        int n;
        public BIT(int n)
        {
            bit0 = new long[n + 1];
            bit1 = new long[n + 1];
            this.n = n;
        }

        public long Sum(int l, int r)
        {
            long ret = 0;
            ret += Sum(bit0, r) + Sum(bit1, r) * r;
            ret -= Sum(bit0, l - 1) + Sum(bit1, l - 1) * (l - 1);
            return ret;
        }

        long Sum(long[] bit, int i)
        {
            long s = 0;
            while (i > 0)
            {
                s += bit[i];
                i -= i & -i;
            }
            return s;
        }

        public void Add(int l, int r, int a)
        {
            Add(bit0, l, -a * (l - 1));
            Add(bit1, l, a);
            Add(bit0, r + 1, a * r);
            Add(bit1, r + 1, -a);
        }

        void Add(long[] bit, int i, int a)
        {
            while (i <= n)
            {
                bit[i] += a;
                i += i & -i;
            }
        }
    }

}

namespace Assistant
{
    static class Input
    {
        static List<string> line = new List<string>();
        static int index = 0;
        static String ReadNext()
        {
            if (line.Count <= index) line.AddRange(Console.ReadLine().Split());
            return line[index++];
        }
        public static int ReadInt => int.Parse(ReadNext());
        public static long ReadLong => long.Parse(ReadNext());
        public static int[] ReadInts => Console.ReadLine().Split().Select(int.Parse).ToArray();
        public static long[] NextLongs => Console.ReadLine().Split().Select(long.Parse).ToArray();
    }
}



Measured memory_bytes: 36784
s=input()

cnt=0
if s[0]=="R":
    cnt+=1
    if s[1]=="R":
        cnt+=1
        if s[2]=="R":
            cnt+=1


else:
    if s[1]=="R":
        cnt+=1
        if s[2]=="R":
            cnt+=1
    else:
        if s[2]=="R":
            cnt+=1
 

print(cnt)

Measured memory_bytes: 9116
'use strict';
        (function(stdin) {
          var inputs  = stdin.toString();
          var S = parseInt(inputs.split('\n')[0],10);
          var h = Math.floor(S / 3600);
          var m = Math.floor(S % 3600 / 60);
          var s = S % 60;
          console.log([h,m,s].join(':'));
      }(require('fs').readFileSync('/dev/stdin', 'utf8')));

Measured memory_bytes: 7644
#include <cstdio> 
#include <cstdlib> 
#include <numeric>
#include <cmath> 
#include <climits> 
#include <cfloat> 
#include <map> 
#include <cassert>
#include <utility> 
#include <set> 
#include <iostream> 
#include <memory> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <functional> 
#include <sstream> 
#include <complex> 
#include <stack> 
#include <queue> 
using namespace std; 
#define REP(i,b,n) for(int i=b;i<n;i++) 
#define rep(i,n)      REP(i,0,n) 
#define pb push_back  
#define mp make_pair 
#define ALL(C)   (C).begin(),(C).end() 
template<class T> void vp(T &a,int p){rep(i,p)cout << a[i]<<" ";cout << endl;}  

typedef complex<double>P; 
typedef long long ll; 
typedef unsigned long long ull; 
typedef pair<int,int> pii; 
const int inf = (1<<21);
const int N = 50;
string in[N];
int dp[N][N];

int solve(int r,int c,int y,int x){
  if (y == r-1 && x == c-1)return 0;
  int &ret=dp[y][x];
  if (ret != -1)return ret;
  ret=inf;
  if (x+1 < c){
    ret=min(ret,solve(r,c,y,x+1)+in[y][x+1]-'0');
  }
  if (y+1 < r){
    ret=min(ret,solve(r,c,y+1,x)+in[y+1][x]-'0');
  }
  return ret;
}

main(){
  int r,c;
  while(cin>>r>>c ){
    rep(i,r)cin>>in[i];
    rep(i,r)rep(j,c)dp[i][j] = -1;
    cout << solve(r,c,0,0)+in[0][0]-'0' << endl;
  }
}

Measured memory_bytes: 0
#include <iostream>
#include <cmath>
#include <climits>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <map>
#include <numeric>
using namespace std;
// scanf
#pragma warning(disable: 4996)
// v:vector  type:型  order:greater or less
#define _sort(v,type,order) do { sort(v.begin(),v.end(),order<type>()); } while(0)
// vector 要素の総和算出
// v:vector  default_value:初期値
#define _sum(v,default_value) accumulate(v.begin(),v.end(),default_value )
// vector 最大値( return ite )
#define _max_element(v) max_element(v.begin(),v.end())
// vector 最大値が格納されている要素値
#define _max_element_number(v) distance(v.begin(),max_element(v.begin(),v.end()))
// 丸め
#define _round(v) round(v)
// 2乗 / 3乗
#define _square(v) pow(v,2)
#define _cube(v)   pow(v,3)
// 大小判定
#define _max(x,y) max(x,y)
#define _min(x,y) min(x,y)
// string ⇒ int
#define _stringtoi(s) stoi(s)
// double 平方根
#define _sqrt(x) sqrt(x)
// double 引数 x 以上で最小の整数値
#define _ceil(x) ceil(x)
// 指定された要素以上の値が現れる最初の位置のイテレータを取得する
#define _lower_bound(v,min) lower_bound(v.begin(), v.end(), min)
// 指定された要素より大きい値が現れる最初の位置のイテレータを取得する
#define _upper_bound(v,min) upper_bound(v.begin(), v.end(), min)

// 順列 n個の数が与えられる
// 0,1,2,...,n-1
// 全ての並べ方を1行ごとに出力する
// ex 0 1 2 / 0 2 1 / 1 0 2 / 1 2 0 / 2 0 1 / 2 1 0
#define _next_permutation(v) do {   \
	for (auto num : v) {            \
		printf("%d ", num);         \
	}                               \
	printf("\n");                   \
} while (next_permutation(v.begin(), v.end()))

// 絶対値
static int32_t _abs(const int32_t x) { return  (x > 0 ? x : -x); }




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

	uint32_t result = _cube(n);

	printf("%d\n", result);

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define M 1000000007
#define INF ((1LL<<62LL) - 1)

const int N = 300005;
int a[N];
int b[N];

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    srand(time(0));

    int n,m; cin >> n >> m;
    set<pair<int,int> > s;
    int q; cin >> q;
    for(int i=1;i<=q;i++){
        int x,y; cin >> x >> y;
        s.insert({x,y});
        a[x]++;
        b[y]++;
    }

    int m1 = -1;
    int m2 = -1;

    for(int i=1;i<N;i++){
        m1 = max(m1, a[i]);
        m2 = max(m2, b[i]);
    }

    vector<int> gg,hh;
    for(int i=1;i<N;i++){
        if(a[i] == m1){
            gg.push_back(i);
        }
        if(b[i] == m2){
            hh.push_back(i);
        }
    }

    int ans = m1 + m2 - 1;

    for(int i=0;i<7*N;i++){
        int x = rand()%gg.size();
        int y = rand()%hh.size();

        if(s.find({gg[x], hh[y]}) == s.end()){
            cout << m1 + m2 << "\n";
            return 0;
        }
    }

    cout << ans << "\n";




}


Measured memory_bytes: 33008
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i< (int)(n); i++)
int main(){
    int N,e,count=1,max=0;
    cin >> N;
    vector<int> dia(N);
    rep(i,N){
        cin >> dia.at(i);
    }
    rep(i,N-1){
        rep(j,N-1-i){
            if(dia.at(j)<dia.at(j+1)){
                e=dia.at(j);
                dia.at(j)=dia.at(j+1);
                dia.at(j+1)=e;
            }

        }
    }
    max=dia.at(0);
    rep(i,N){
        if(max>dia.at(i)){
            count++;
            max=dia.at(i);
        }
    }
    cout << count << endl;
}

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

int main() {
  long long n,k;

  cin >> n >> k;

  long long sum =0;

  long long flag = 0;

  vector<int> h(n);

  rep(i,n){
    cin >> h.at(i);
  }

  sort(h.begin(),h.end(),greater());\

  if(k >= h.size()){
    cout << 0;
    return 0;
  }
  

  rep(i,k){
    h.erase(h.begin());
  }
  
  rep(i,h.size()){
    sum+=h.at(i);
  }

  cout << sum << endl;


}

Measured memory_bytes: 4044
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };


int main(){cout<<fixed<<setprecision(10);
		   int n;
           cin>>n;
           vin a(n);
           rep(i,0,n)cin>>a[i];
           bool ok=true;
           if(a[0])ok=false;
           rep(i,0,n-1){
             if(a[i+1]-a[i]>1)ok=false;
           }
             if(!ok){
              cout<<-1<<endl;
               return 0;
             }
           reverse(all(a));
          
           ll ans=0;
           rep(i,0,n){
            ans+=a[i];
             while(i+1<n&&a[i]-1==a[i+1]){
              i++; 
             }
               
           }
           cout<<ans<<endl;
}

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

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
#define int ll
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif

const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename A,typename B> istream& operator>>(istream&,pair<A,B>&);
template<typename A> istream& operator>>(istream&,vector<A>&);
void add(int&,int);
int mul(int,int);
int powz(int,int);
int sub(int,int);
template<typename A> ostream& operator<<(ostream&,vector<A>&);

const int N=500001;
	
void solve(){
	int l,r;
	cin>>l>>r;
	if(r-l+1>4000){
		cout<<0;
		return;
	}
	else{
		int ans=1e9;
		for(int i=l;i<=r;i++){
			for(int j=i+1;j<=r;j++){
				ans=min(ans,(i*j)%2019);
			}
		}
		cout<<ans;
				
		
	}
	
}
	
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int tc=1;
	//~ cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}
 
int mul(int a,int b)
{
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
}

int sub(int a,int b){
	a-=b;
	if(a<0){
		a+=mod;
	}
	return a;
}
 
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)res=mul(res,a);
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
	    output<<i<<' ';
	return output;	
}


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

typedef long long LL;

const int MaxN=1e5+5;

int N;
LL C,Ans;
int V[MaxN];
LL X[MaxN],Pre[MaxN],Suf[MaxN],F[MaxN],G[MaxN];

int main(){
	int i;
	scanf("%d%lld",&N,&C);
	for(i=1;i<=N;i++){
		scanf("%lld%d",&X[i],&V[i]);
		Pre[i]=Pre[i-1]+V[i];
		F[i]=max(F[i-1],Pre[i]-X[i]);
	}
	for(i=N;i;i--){
		Suf[i]=Suf[i+1]+V[i];
		G[i]=max(G[i+1],Suf[i]-(C-X[i]));
	}
	for(i=1;i<=N;i++)
		Ans=max(Ans,max(Pre[i]-X[i],Pre[i]-2*X[i]+G[i+1]));
	for(i=N;i;i--)
		Ans=max(Ans,max(Suf[i]-(C-X[i]),Suf[i]-2*(C-X[i])+F[i-1]));
	printf("%lld\n",Ans);
	return 0;
}

Measured memory_bytes: 4480
from decimal import *
getcontext().prec=1000
a,b,c=map(int,input().split())
A=Decimal(a)**Decimal("0.5")
B=Decimal(b)**Decimal("0.5")
C=Decimal(c)**Decimal("0.5")
D= Decimal(10) ** (-100)
if A+B+D<C:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 5204
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    
    val = math.factorial(N)
    
    divisors = factorize(val)
    #print(divisors)
    
    ans = 1
    for i in divisors:
        #print(ans)
        a,b = i
        ans = ans * (b+1)
        ans = ans % 1000000007
        
    print(ans)
    
    
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
    
if __name__ == "__main__":
	main()


Measured memory_bytes: 40304
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <map>
#define ull unsigned long long
#define ll long long
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a;
    vector<int> a_1,x;
    cin >> n;
    int ans1=1,ans2=1;
    for(int i=0;i<n;i++){
        cin >> a;
        a_1.push_back(a);
        ans1*=3;
        if(a_1[i]%2==0){
            ans2*=2;
        }
    }
    cout << ans1-ans2 << endl;


    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.lang.Math;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		double x1 = sc.nextDouble();
		double y1 = sc.nextDouble();
		double x2 = sc.nextDouble();
		double y2 = sc.nextDouble();

		System.out.println(Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2 - y1, 2)));
	}
}



Measured memory_bytes: 28032
n = int(input())
a = input()
b = input()
c = input()
opcount = 0
for i in range(n):
    if a[i] == b[i] == c[i]:
        pass
    elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
        opcount += 1
    else:
        opcount += 2
print(opcount)


Measured memory_bytes: 3060
#include<iostream>   
#include<cstdio>  
#include<algorithm>
#include<stack>
using namespace std;
const int maxx = 1410;

int H, W;
int buffer[maxx][maxx];
int T[maxx][maxx];
struct Rectangle { int height; int pos; };

int getLargestRectangle(int size, int height[]) {
	stack<Rectangle> S;
	int maxv = 0;
	height[size] = 0;

	for (int i = 0; i <= size; i++) {
		Rectangle rect;
		rect.height = height[i];
		rect.pos = i;
		// 当S为空
		if (S.empty())
			S.push(rect);
		// 栈顶的高度小于当前的高度
		else if (S.top().height < rect.height)
			S.push(rect);
		// 栈顶的高度大于当前的高度
		else if (S.top().height > rect.height) {
			int target = i;
			// 栈顶的高度大于等于当前的高度
			// 出现小于栈顶高度的代表pre.pos~i之间都存在高度为pre.height的干净瓷砖
			// 此时可以计算当前的面积
			while (!S.empty() && S.top().height >= rect.height) {
				Rectangle pre = S.top(); S.pop();
				// 长 * 宽
				int area = pre.height * (i - pre.pos);
				maxv = max(maxv, area);
				target = pre.pos;
			}
			// 加上前面的宽度（下标设置为之前的），以便后面有合适的瓷砖进行计算
			rect.pos = target;
			S.push(rect);
		}
	}
	return maxv;
}

int solve() {
	// 以行为直方图,计算纵向的干净长度
	for (int j = 0; j < W; j++) {
		for (int i = 0; i < H; i++) {
			if (buffer[i][j])
				T[i][j] = 0;
			else
				T[i][j] = (i > 0) ? T[i - 1][j] + 1 : 1;
		}
	}

	// 从行计算出当前行的最大面积
	int maxv = 0;
	for (int i = 0; i < H; i++)
		maxv = max(maxv, getLargestRectangle(W, T[i]));
	return maxv;
}
int main()
{
	scanf("%d %d", &H, &W);
	for (int i = 0; i < H; i++)
		for (int j = 0; j < W; j++)
			scanf("%d", &buffer[i][j]);
	
	printf("%d\n", solve());
	return 0;
}


Measured memory_bytes: 18624
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>

using namespace std;

int main()
{
	int n, m, q;
	scanf("%d %d %d", &n, &m, &q);
	char s[2000][2000];
	for(int i=0; i<n; i++){
		scanf("%s", s[i]);
	}
	int v[2000][2000];
	for(int i=0; i<n; i++){
		if(i==0){
			for(int j=0; j<m; j++){
				if(j==0){
					if(s[0][0]=='1'){
						v[0][0]=1;
					}else{
						v[0][0]=0;
					}
				}else{
					if(s[0][j]=='1'){
						v[0][j]=v[0][j-1]+1;
					}else{
						v[0][j]=v[0][j-1];
					}
				}
			}
		}else{
			for(int j=0; j<m; j++){
				if(j==0){
					if(s[i][0]=='1'){
						v[i][0]=v[i-1][0]+1;
					}else{
						v[i][0]=v[i-1][0];
					}
				}else{
					if(s[i][j]=='1'){
						v[i][j]=v[i-1][j]+v[i][j-1]-v[i-1][j-1]+1;
					}else{
						v[i][j]=v[i-1][j]+v[i][j-1]-v[i-1][j-1];
					}
				}
			}
		}
	}
	int e1[2000][2000], e2[2000][2000];
	for(int i=0; i<n; i++){
		if(i==0){
			for(int j=0; j<m; j++){
				if(j==0){
					e1[0][0]=0;
				}else{
					if(s[0][j]=='1' && s[0][j-1]=='1'){
						e1[0][j]=e1[0][j-1]+1;
					}else{
						e1[0][j]=e1[0][j-1];
					}
				}
			}
		}else{
			for(int j=0; j<m; j++){
				if(j==0){
					e1[i][0]=0;
				}else{
					int e0=0;
					if(s[i][j]=='1' && s[i][j-1]=='1') e0++;
					e1[i][j]=e1[i-1][j]+e1[i][j-1]-e1[i-1][j-1]+e0;
				}
			}
		}
	}
	for(int i=0; i<n; i++){
		if(i==0){
			for(int j=0; j<m; j++){
				e2[0][j]=0;
			}
		}else{
			for(int j=0; j<m; j++){
				if(j==0){
					if(s[i][0]=='1' && s[i-1][0]=='1'){
						e2[i][0]=e2[i-1][0]+1;
					}else{
						e2[i][0]=e2[i-1][0];
					}
				}else{
					int e0=0;
					if(s[i][j]=='1' && s[i-1][j]=='1') e0++;
					e2[i][j]=e2[i-1][j]+e2[i][j-1]-e2[i-1][j-1]+e0;
				}
			}
		}
	}
	for(int i=0; i<q; i++){
		int x1, y1, x2, y2;
		scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
		x1--;
		y1--;
		x2--;
		y2--;
		int ans;
		if(x1==0 && y1==0){
			ans=v[x2][y2]-(e1[x2][y2]+e2[x2][y2]);
		}else if(x1==0){
			ans=(v[x2][y2]-v[x2][y1-1])-(e1[x2][y2]-e1[x2][y1]+e2[x2][y2]-e2[x2][y1-1]);
		}else if(y1==0){
			ans=(v[x2][y2]-v[x1-1][y2])-(e1[x2][y2]-e1[x1-1][y2]+e2[x2][y2]-e2[x1][y2]);
		}else{
			ans=(v[x2][y2]-v[x2][y1-1]-v[x1-1][y2]+v[x1-1][y1-1])-(e1[x2][y2]-e1[x2][y1]-e1[x1-1][y2]+e1[x1-1][y1]+e2[x2][y2]-e2[x2][y1-1]-e2[x1][y2]+e2[x1][y1-1]);
		}
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 52480
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int w, a, b;
    cin >> w >> a >> b;
    int ans = min(abs(b - a - w), abs(a - b - w));
    if(a <= b && b <= a + w){
        ans = 0;
    }
    else if(a <= b + w && b + w <= a + w){
        ans = 0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n, t = map(int, input().split())
l = list(map(int, input().split()))
total=0
for i in range(n):
    if i==n-1:# last element
        total+=t
        break
    if l[i+1]-l[i]>=t:
        total+=t
    else:
        total+=l[i+1]-l[i]
print(total)

Measured memory_bytes: 30656
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <numeric>

using namespace std;
using ll = long long;

int main(){
  int x,y, a,b,c;
  cin >> x >> y >> a >> b >> c;
  
  vector<int> p(a),q(b),r(c);
  for(auto &i: p) {
    cin >> i;
  }
  for(auto &i: q) {
    cin >> i;
  }
  for(auto &i: r) {
    cin >> i;
  }

  sort(p.begin(),p.end(),greater<>());
  sort(q.begin(),q.end(),greater<>());
  sort(r.begin(),r.end(),greater<>());

  vector<int> m;
  copy(p.begin(),p.begin()+x,back_inserter(m));
  copy(q.begin(),q.begin()+y,back_inserter(m));
  sort(m.begin(),m.end());

  auto n = min(c, (int)m.size());
  for(auto i = 0; i != n; ++i) {
    m[i] = max(r[i],m[i]);
  }
  
  cout << accumulate(m.begin(),m.end(),0ll) << endl;

  return 0;
}


Measured memory_bytes: 2552
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <string>

using namespace std;

#define N 3
#define N2 9

struct Puzzle {
	int f[N2];
	int space;
	string path;

	bool operator <(const Puzzle &p) const {
		for (int i = 0; i < N2; ++i) {
			if (f[i] == p.f[i])
				continue;
			return f[i] > p.f[i];
		}
		return false;
	}
};

bool isTarget(Puzzle p) {
	for (int i = 0; i < N2; ++i) {
		if (p.f[i] != i + 1)
			return false;
	}
	return true;
}

const int dx[4] { -1, 0, 1, 0 };
const int dy[4] { 0, -1, 0, 1 };
const char dir[4] { 'u', 'l', 'd', 'r' };

string bfs(Puzzle p) {
	queue<Puzzle> Q;
	p.path = "";
	Q.push(p);
	map<Puzzle, bool> M;
	M[p] = true;
	Puzzle u, v;
	while (!Q.empty()) {
		u = Q.front();
		Q.pop();
		if (isTarget(u))
			return u.path;
		int sx = u.space / N;
		int sy = u.space % N;
		for (int r = 0; r < 4; ++r) {
			int tx = sx + dx[r];
			int ty = sy + dy[r];
			if (tx < 0 || ty < 0 || tx >= N || ty >= N)
				continue;
			v = u;
			swap(v.f[u.space], v.f[tx * N + ty]);
			v.space = tx * N + ty;
			if (!M[v]) {
				M[v] = true;
				v.path += dir[r];
				Q.push(v);
			}
		}
	}
	return "unresolved";
}

int main() {
	Puzzle p;
	for (int i = 0; i < N2; ++i) {
		cin >> p.f[i];
		if (p.f[i] == 0) {
			p.f[i] = N2;
			p.space = i;
		}
	}
	string ans = bfs(p);
	cout << ans.size() << endl;

	return 0;
}

Measured memory_bytes: 30604
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	/*/TODO:!!!!!!!テスト用!!!!!!!!!
		sc = bufio.NewScanner(strings.NewReader(`
		5 2 2
		ccccc
	`))
		//TODO:!!!!!!!テスト用!!!!!!!!!*/

	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */

	n, a, b := nextInt(), nextInt(), nextInt()
	s := next()

	passCount := 0
	fcount := 0

	for i := 0; i < n; i++ {
		var ans string
		if s[i:i+1] == "a" {
			if passCount < a+b {
				ans = "Yes"
				passCount++
			} else {
				ans = "No"
			}
		} else if s[i:i+1] == "b" {
			if passCount < a+b && fcount < b {
				ans = "Yes"
				passCount++
				fcount++
			} else {
				ans = "No"
			}
		} else {
			ans = "No"
		}
		fmt.Fprintln(out, ans)
	}
}

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}


Measured memory_bytes: 2816
use std::cmp;
use std::io;

fn read() -> Vec<i32> {
    let mut string = String::new();
    io::stdin().read_line(&mut string).unwrap();
    string
        .trim()
        .split_whitespace()
        .map(|word| word.parse().unwrap())
        .collect()
}

fn change_matatabi(matatabi: Vec<Vec<i32>>) -> Vec<(i32, i32, i32)> {
    let mut vec = Vec::new();
    for m in matatabi {
        if m[0] == m[2] {
            vec.push((m[0], cmp::max(m[1], m[3]), 1));
        } else if m[1] == m[3] {
            vec.push((cmp::max(m[0], m[2]), m[1], -1));
        }
    }
    vec
}

fn calc_map(matatabi: Vec<(i32, i32, i32)>, map: &mut Vec<Vec<i32>>) {
    for y in 0..map.len() as usize {
        for x in 0..map[y].len() as usize {
            //println!("xy: {}, {}", x, y);
            let mut iter = matatabi
                .iter()
                .filter(|m| m.0 == x as i32 && m.1 == y as i32);

            let mut direction = -2;

            if x == 0 {
                direction = -1;
            } else if y == 0 {
                direction = 1;
            }

            loop {
                match iter.next() {
                    Some(m) => {
                        if direction == -2 {
                            direction = m.2;
                        } else {
                            direction = 0;
                        }
                    }
                    None => {
                        break;
                    }
                }
            }
            //println!("direction, {}", direction);

            if x == y && x == 0 {
                map[0][0] = 1;
            } else if direction == -2 {
                map[y][x] = map[y - 1][x] + map[y][x - 1];
            } else if direction == -1 {
                map[y][x] = map[y - 1][x];
            } else if direction == 1 {
                map[y][x] = map[y][x - 1];
            }
        }
    }
}

fn main() {
    let N = read();
    let n = N[0];

    for i in 0..n {
        let XY = read();
        let M = read();
        let gx = XY[0] as usize;
        let gy = XY[1] as usize;
        let m = M[0];
        let mut matatabi = Vec::new();
        for i in 0..m as usize {
            matatabi.push(read());
        }
        let matatabi = change_matatabi(matatabi);
        //println!("matatabi");
        //println!("{:?}", matatabi);
        let mut map = vec![vec![0 as i32; gx + 1]; gy + 1];
        calc_map(matatabi, &mut map);
        if map[gy][gx] == 0 {
            println!("Miserable Hokusai!");
        } else {
            println!("{:?}", map[gy][gx]);
        }
    }
}



Measured memory_bytes: 5032
Option Strict On
Imports System.Console
Imports System.Collections.Generic

Module Program

    Sub Main()
        Dim w As Integer = NextInt()
        Dim h As Integer = NextInt()
        Dim n As Integer = NextInt()
        Dim arr As Integer(,) = New Integer(h - 1, w - 1) {}

        For i As Integer = 0 To h - 1
            For j As Integer = 0 To w - 1
                arr(i, j) = 1
            Next
        Next

        Dim ans As Integer = 0

        For i As Integer = n - 1 To 0 Step -1
            Dim xi As Integer = NextInt()
            Dim yi As Integer = NextInt()
            Dim a As Integer = NextInt()

            For y As Integer = 0 To h - 1
                For x As Integer = 0 To w - 1
                    Select Case True
                        Case a = 1 AndAlso x < xi
                            arr(y, x) = 0
                        Case a = 2 AndAlso x >= xi
                            arr(y, x) = 0
                        Case a = 3 AndAlso y < yi
                            arr(y, x) = 0
                        Case a = 4 AndAlso y >= yi
                            arr(y, x) = 0
                    End Select

                    If i = 0 Then ans += arr(y, x)
                Next
            Next
        Next

        WriteLine(ans)
    End Sub

    Function B2i(ok As Boolean) As Integer
        If ok Then Return 1
        Return 0
    End Function

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of String)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return String.Join("", result)
    End Function

End Module


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

int main() {
  // ここにプログラム
  int n,a;
  int sum = 0;
  int m = 0;
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> a;
    sum+=a;
    m = max(m,a);
  }
  if(m < sum - m) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  
}


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


#define M_MAX 20
#define N_MAX 50000
#define INFTY 1 << 29

int main(){
int a[5];
int res=0;
int maxi=0;
for(int i=0;i<5;i++){
cin >> a[i];
int temp=a[i];
if(a[i]%10!=0){
temp=a[i]/10;
temp++;
temp*=10;
maxi=max(maxi,temp-a[i]);
}
res+=temp;
temp=0;
}


cout << res-maxi;



}


Measured memory_bytes: 256
let counting_sort a b k =
  let c = Array.make (k + 1) 0 in
  Array.iter (fun e -> c.(e) <- c.(e) + 1) a;
  Array.iteri (fun i _ -> if i <> 0 then c.(i) <- c.(i) + c.(i-1)) c;
  for i = Array.length a - 1 downto 0 do
    b.(c.( a.(i) ) - 1) <- a.(i);
    c.( a.(i) ) <- c.( a.(i) ) - 1;
  done

let () =
  let n = read_int () in
  let a = Array.init n (fun _ -> Scanf.scanf "%d " (fun e -> e)) in
  let b = Array.make n 0 in
  counting_sort a b 10000;
  print_int b.(0);
  for i = 1 to n - 1 do
    print_string " ";
    print_int b.(i);
  done;
  print_newline ()

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


int main(void){
    // Your code here!
    int  a,b,c,d,e;
    int k;
    cin >> a >> b >> c ;
    cout << (max(max(a,b),c) * 10 + (a+b+c - min(min(a,b),c) - max(max(a,b),c) ) ) + min(min(a,b),c) << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int A,B,C;
    if (-100<=A&&A<=100&&-100<=B&&B<=100&&-100<=C&&C<=100);
    {
        scanf("%d %d %d",&A,&B,&C);
        if (C>=A&&C<=B) printf("Yes\n");
        else printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int P[100001];
long long A[100001],B[100001],C[100001];
int D[100001];
int main() {
	int N,M;
	long long R=0;
	cin>>N>>M;
	for(int i=1;i<M+1;i++)cin>>P[i];

	for(int i=1;i<N;i++)cin>>A[i]>>B[i]>>C[i];

	for(int i=1;i<M;i++){
		if(P[i]<P[i+1]){
			for(int j=P[i];j<P[i+1];j++)D[j]+=1;
		}else{
			for(int j=P[i+1];j<P[i];j++)D[j]+=1;
		}
	}
	for(int j=1;j<N;j++)R+=min(D[j]*B[j]+C[j],D[j]*A[j]);
	cout<<R<<endl;
	return 0;
}

Measured memory_bytes: 6208
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define PI 3.141592653589793

int kock(int n,double p1_x,double p1_y,double p2_x,double p2_y){
	if(n==0){return 1;}
	double s_x,s_y;
	double t_x,t_y;
	double u_x,u_y;
	double rad_60=((60.0*PI)/180);

	s_x = (((2*p1_x)+(p2_x))/3);
	s_y = (((2*p1_y)+(p2_y))/3);
	t_x = (((p1_x)+(2*p2_x))/3);
	t_y = (((p1_y)+(2*p2_y))/3);
	u_x = (((t_x-s_x)*cos(rad_60))-((t_y-s_y)*sin(rad_60))+s_x);
	u_y = (((t_x-s_x)*sin(rad_60))+((t_y-s_y)*cos(rad_60))+s_y);

	kock(n-1,p1_x,p1_y,s_x,s_y);
	printf("%f %f\n",s_x,s_y);
	kock(n-1,s_x,s_y,u_x,u_y);
	printf("%f %f\n",u_x,u_y);
	kock(n-1,u_x,u_y,t_x,t_y);
	printf("%f %f\n",t_x,t_y);
	kock(n-1,t_x,t_y,p2_x,p2_y);
}

int calc(int N){
	double p1_x=0.0;
	double p1_y=0.0;
	double p2_x=100.0;
	double p2_y=0.0;

	printf("%f %f\n",p1_x,p1_y);	
	kock(N,p1_x,p1_y,p2_x,p2_y);
	printf("%f %f\n",p2_x,p2_y);

	return 1;
}

int main(){
	int N;

	scanf("%d",&N);
	
	calc(N);

	return 0;
}


Measured memory_bytes: 2096
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <numeric>
#include <limits>
#include <cmath>
#include <iomanip>
#include <sstream>
 
#define ALL(a)  (a).begin(),(a).end()
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

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

    ll ans = 0;
    string s;
    cin >> s;
    if (s.length() % 2 == 0) {
        ans = 1;
        for (int i = 0; i < s.length(); i+=2) {
            if (s[i] != 'h' || s[i+1] != 'i') ans = 0;
        }
    }
    (ans) ? (cout << "Yes" << endl) : (cout << "No" << endl);
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int a[40] = {0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main() {
	int k;
	cin >> k;
	cout << a[k] << '\n';
	return 0;
}

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

//#define getchar getchar_unlocked
//#define putchar putchar_unlocked
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define ff first
#define ss second
#define err stderr
#define out stdout

typedef long long int ll;
typedef long double ld;
typedef short int sh;

inline void readI(int *i)
{
	register int t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=(t*znak);
}
inline void readUI(int *i)
{
	register int t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*i=t;
}
inline void readL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	int znak=1;
	if (z=='-')
	{
		znak*=-1;
	}
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
		if (z=='-')
		{
			znak=-1;
		}
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=(t*znak);
}
inline void readUL(ll *l)
{
	register ll t=0;
	register char z=getchar();
	while ((z<'0') || ('9'<z))
	{
		z=getchar();
	}
	while (('0'<=z) && (z<='9'))
	{
		t=(t<<3)+(t<<1)+z-'0';
		z=getchar();
	}
	*l=t;
}
inline void writeL(ll l)
{
	if (l==0)
	{
		putchar(48);
	}
	else
	{
		if (l<0)
		{
		   l*=-1;
		   putchar(45);
		}
		int _tab[21];
		int wsk=0;
		while (l>0)
		{
			++wsk;
			_tab[wsk]=(l%10)+48;
			l/=10;
		}
		for (int j=wsk; j>=1; --j)
		{
			putchar(_tab[j]);
		}
	}
}
inline void writeS(string s)
{
	int l=s.length();
	for (int i=0; i<l; ++i)
	{
		putchar(s[i]);
	}
}
inline void space()
{
	putchar(32);
}
inline void endl()
{
	putchar(10);
}

#define debug if(1)
#define debug2 if(1)
#define debug3 if(1)
#define debug4 if(1)
#define MAXN (int)(2e5)+5
#define ZAK (1<<19)+5

int n, a, R;
int h[MAXN];
ll tree[ZAK];

ll query(int x, int pp, int pk, int zp, int zk)
{
	if (pk<zp || zk<pp)
	{
		return 0;
	}
	if (zp<=pp && pk<=zk)
	{
		return tree[x];
	}
	int sr=((pp+pk)>>1);
	return max(query(x<<1, pp, sr, zp, zk), query((x<<1)+1, sr+1, pk, zp, zk));
}
void insert(int x, ll war)
{
	x+=R-1;
	while (x)
	{
		tree[x]=max(tree[x], war);
		x>>=1;
	}
}
int main()
{
	readUI(&n);
	R=1;
	while (R<n)
	{
		R<<=1;
	}
	for (int i=1; i<=n; ++i)
	{
		readUI(&h[i]);
	}
	for (int i=1; i<=n; ++i)
	{
		readUI(&a);
		insert(h[i], (ll)a+(h[i]==1 ? 0 : query(1, 1, R, 1, h[i]-1)));
	}
	fprintf (out, "%lld\n", tree[1]);
	return 0;
}
/*
*/




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

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<vector<int>> dp(n+1, vector<int>(3, 0));
  vector<vector<int>> abc(n+1, vector<int>(3, 0));

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

  // dp[i][j] := i日目に活動 j を選んだときの幸福度の総和の最大値
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 3; k++) {
        if (j == k) { continue; } // 前と同じ活動はできない
        // i+1日目に活動jをしたときの最大値 = max(i日目に活動k をしたときの最大値 + abc[i][j])
        dp[i+1][j] = max(dp[i+1][j], dp[i][k] + abc[i][j]);
      }
    }
  }
  int ans = 0;

  for (int i = 0; i < 3; i++) {
    ans = max(ans, dp[n][i]);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 11136
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class Solve
{
    static void Main(string[] args)
    {
        new ABC_D();
    }
}
public class ABC_A
{
    public ABC_A()
    {
        var inn = Ex.ReadIntArray();
        int n = inn[0];
        int m = inn[1];
        Console.WriteLine(n * (n - 1) / 2 + m * (m - 1) / 2);
    }
}
public class ABC_B
{
    public ABC_B()
    {
        string s = Ex.Read;
        int n = s.Length;
        Console.WriteLine((c1(s, 1, n) && c1(s, 1, (n - 1) / 2) && c1(s, (n + 3) / 2, n)) ? "Yes" : "No");
    }

    bool c1(string s, int ss, int ee)
    {
        int i = 0;
        while ((ss + i - 1) <= (ee / 2))
        {
            if (s[ss + i - 1] != s[ee - i - 1]) return false;
            i++;
        }

        return true;
    }
}
public class ABC_C
{
    public ABC_C()
    {
        string s = Ex.Read;
        ulong l = ulong.Parse(s);
        var d = (l / 3.0);
        Console.WriteLine(d*d*d);
    }
}
public class ABC_D
{
    public ABC_D()
    {
        var n = Ex.ReadInt;
        var inn = Ex.ReadIntArray();
        long[] arr = new long[n + 1];
        foreach (int i in inn)
        {
            arr[i]++;
        }
        ulong all = 0;
        foreach (long i in arr)
        {
            long j = i;
            if (j >= 2)
                all += (ulong)(j * (j - 1) / 2);
        }
        foreach (int i in inn)
        {
            long j = arr[i] - 1;
            if (j >= 2)
                Console.WriteLine(all - (ulong)((j * (j + 1) / 2)-(j * (j - 1) / 2)));
            else if (j == 1)
                Console.WriteLine(all - 1);
            else
                Console.WriteLine(all);
        }
    }
}
public class ABC_E
{
    public ABC_E()
    {

    }
}
public class ABC_F
{
    public ABC_F()
    {

    }
}
public static class Ex
{
    public static string Read { get { return Console.ReadLine().Trim(); } }
    public static int ReadInt { get { return int.Parse(Read); } }
    public static long ReadLong { get { return long.Parse(Read); } }
    public static double ReadDouble { get { return double.Parse(Read); } }
    public static string[] ReadArray() { return Read.Split(' '); }
    public static int[] ReadIntArray() { return Read.Split(' ').Select(s => int.Parse(s)).ToArray(); }
    public static long[] ReadLongArray() { return Read.Split(' ').Select(s => long.Parse(s)).ToArray(); }
    public static string[] ReadArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
    public static int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
    public static long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
}

Measured memory_bytes: 36792