akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
const int N = 2e5 + 5;
const int inf = 105;
int n;
int dist[N];
priority_queue < pair < int , int > > pq;
int main(){
	scanf("%d" , &n);
	for(int i = 0 ; i < n ; ++i){
		dist[i] = inf;
	}
	while(!pq.empty()){
		pq.pop();
	}
	for(int i = 1 ; i < 10 ; ++i){
		dist[i] = min(i , dist[i]);
		pq.push({-i , i % n});
	}
	while(!pq.empty()){
		int node = pq.top().second;
		int cost = -pq.top().first;
		pq.pop();
		if(cost > dist[node]){
			continue;
		}
		for(int i = 0 ; i < 10 ; ++i){
			int next = (node * 10 + i) % n;
			int ncost = cost + i;
			if(ncost < dist[next]){
				dist[next] = ncost;
				pq.push({-ncost , next});
			}
		}
	}
	printf("%d\n" , dist[0]);
}

Measured memory_bytes: 2804
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
  ll a,b,c,d,res;
  cin >> a >> b >> c >> d;
  res=max({a*c,a*d,b*c,b*d});
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
#define diup(v,a,k) distance((v).begin(),(k)+upper_bound((v).begin(),(v).end(),(a)))
#define dilo(v,a,k) distance((v).begin(),(k)+lower_bound((v).begin(),(v).end(),(a)))
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pil = pair<int,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(v.size())o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const double eps = 1e-6;
const ll LINF = 100200300400500600ll;
const int INF = 1001001001;
//--------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
#define myloopset int loop = 1; if(argc>2) loop =stoi(argv[2]); rep(i,loop)
//--------------------------------------------------------------
template <class T> T chmin(T &a,T b){if(a>b){a=b; return 1;}else return 0;}
template <class T> T chmax(T &a,T b){if(a<b){a=b; return 1;}else return 0;}

class DisjointSet{
  public:
  vector<int> rank, p;
  DisjointSet(){}
  DisjointSet(int size) {
    rank.resize(size,0);
    p.resize(size,0);
    for(int i=0; i<size;i++) makeSet(i);
  }

  void makeSet(int x) {
    p[x] = x;
    rank[x] = 0;
  }

  bool same(int x,int y) {
    return findSet(x) == findSet(y);
  }

  void unite(int x,int y) {
    link(findSet(x), findSet(y));
  }

  void link(int x,int y) {
    if(rank[x] < rank[y]) {
      p[y] = x;
    } else {
      p[x] = y;
      if(rank[x] == rank[y]) {
        rank[y]++;
      }
    }
  }

  int findSet(int x) {
    if(x != p[x]) {
      p[x] = findSet(p[x]);
    }
    return p[x];
  }
};

void Main(){
  int n,m;
  cin>>n>>m;
  vi p(n);
  rep(i,n){
    cin>>p[i];
    p[i]--;
  }
  DisjointSet ds(n);
  rep(i,m){
    int x,y;
    cin>>x>>y;
    x--;y--;
    ds.unite(x,y);
  }
  int ans = 0;
  rep(i,n){
    if(ds.same(i,p[i])){
      ans++;
    }
  }
  cout<<ans<<endl;
} int main(int argc,char** argv)
{fastio; myio; myloopset Main();}


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

#define For(i,a,b) for(int (i) = (a);(i) < (b);i += 1)
#define Rep(i,n) For((i),0,(n))
#define All(a) (a).begin(),(a).end()
#define sp " "
#define INF 1e18
#define INT_INF 1e9
#define MAX_N 100000

typedef long long ll;
const ll MOD = 1000000007;
const ll MOD_9 = 998244353;

bool pjudge(ll p){
    bool judge = true;
    for(int i = 2;i <= sqrt(p);i++){
        if(p % i == 0){
            judge = false;
            break;
        }
    }
    return judge;
}


int main(){
    int X;
    cin >> X;
    For(i,X,200000){
        if(pjudge(i)){
            cout << i << endl;
            return 0;
            break;
        }
    }
    cin >> X;
}

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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
Int mod = 1e9+7;
//Int mod = 998244353;

int main() {
    Int n, k;
    cin >> n >> k;
    Int res = 0;
    while (n > 0) {
        n /= k;
        res++;
    }
    dump(res);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>//bit DP
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
  int n;
  int a=0,w=0,t=0,r=0;
  cin>>n;
  for(int i=1;i<=n;i++){
    string s;
    cin>>s;
    if(s=="AC")a++;
    else if(s=="WA")w++;
    else if(s=="TLE")t++;
    else r++;
  }
  cout<<"AC x "<<a<<endl;
  cout<<"WA x "<<w<<endl;
  cout<<"TLE x "<<t<<endl;
  cout<<"RE x "<<r<<endl;
}


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

int main() {
	int n;
	double x_a, y_a, r_a, x_b, y_b, r_b;
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> x_a >> y_a >> r_a >> x_b >> y_b >> r_b;
		double distance2 = (x_a - x_b)*(x_a - x_b) + (y_a - y_b)*(y_a - y_b);

		if (distance2 > (r_a + r_b)*(r_a + r_b)) {
			cout << 0 << endl;
		} else if (distance2 >= (r_a - r_b)* (r_a - r_b)){
			cout << 1 << endl;
		} else if(r_a > r_b){
			cout << 2 << endl;
		} else {
			cout << -2 << endl;
		}
	}


	return 0;
}

Measured memory_bytes: 1232
//ABC179_B
#include <stdio.h>

int main(){
	int n;
	int d1[105],d2[105];
	int flag=0;
	
	scanf("%d",&n);

	for(int i=0;i<n;i++){
		scanf("%d %d",&d1[i],&d2[i]);
	}
	
	for(int i=0;i<n-2;i++){
		if(d1[i]==d2[i] && d1[i+1]==d2[i+1] && d1[i+2]==d2[i+2]){
			flag = 1;
		}
	}
	
	if(flag == 1)	printf("Yes");
	else printf("No");
	
	return 0;
}


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

//{ SFT
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, a) for (auto &&i : (a))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define size(x) ((int)(x).size())
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
//gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bit(n) (1LL << (n))
#define bits(n) bitset(n)
#define pcnt(x) __builitin_popcountll(x)
//配列内等要素削除
#define unique(x) (x).erase(unique(x).begin(),(x).end()),(x).end());
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) ((n) * ((n) + 1)) / 2
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).flont_back(a)
#define eb(x, a) (x).emplaes_back(a)
#define F first
#define S second
#define cauto (const auto &)
template <class A, class B>
using pii = vector<pair<A, B>>;
template <class T> //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T> //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <class T>
bool chmax(T &a, const T &b) //最大値更新 返り値はbool
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) //最小値更新 返り値はbool
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr long long mod1 = 1e9 + 7;
constexpr long long mod2 = 998244353;
//} END

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

    int n;
    cin>>n;

    rep(i,1,10){
        rep(j,1,10){
            if(i*j == n){
                cout<<"Yes\n";
                return 0;
            }
        }
    }

    cout<<"No\n";
    return 0;
}

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

using namespace std;

const int N = 3e5 + 50;

int h, n, a[N], b[N], f[N];

int main()
{
    ios::sync_with_stdio(false);

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

    memset(f, 0x7f, sizeof(f));

    f[0] = 0;
    for (int i = 1; i <= h; i++)
        for (int j = 1; j <= n; j++)
            if (f[max(0, i - a[j])] + b[j] < f[i])
            {
                f[i] = f[max(0, i - a[j])] + b[j];
            }
    cout << f[h];
}

Measured memory_bytes: 1408
import java.util.*;

class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		
		int ind = Math.max(a, b);
		
		boolean flag = false;
		int ans = 0;
		
		for(int i = 1; i < ind; ++i) {
		    if(Math.abs(a - i) == Math.abs(b - i)){
		        flag = true;
		        ans = i;
		        break;
		    }
		    else flag = false;
		}
		if(flag) System.out.println(ans);
		else System.out.println("IMPOSSIBLE");
		
	}
}

Measured memory_bytes: 22100
//#include<bits/stdc++.h>	// 全てのヘッダーファイルをinclude
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<set>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR (i,n) for(int i=n;i>0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
const int MOD{ int(1e9 + 7) };	// int 1000000007
const int inf{ int(1e9) };	// inf = 1000000000 // 1e9 はdouble型
using namespace std;
typedef long long ll;


int main(void) {
	int n;
	cin >> n;
	ll ans = 1;
	REP(i, n) ans = (ans * (i + 1)) % MOD;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

		String s = sc.next();
		if (s.contains("Sunny")) {
			System.out.println("Cloudy");
		} else if (s.contains("Cloudy")) {
			System.out.println("Rainy");
		} else {
			System.out.println("Sunny");
		}
		sc.close();
	}
}

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

#define reb(i,b,n) for(int i=(int)(b); i<(int)(n); i++)
#define rep(i,n) reb(i,0,n)
#define rreb(i,b,n) for(int i = b-1; i >= n; i--)
#define rrep(i,n) reb(i,n,0)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define reach(it,v) for(__typeof((v).rbegin()) it=(v).rbegin();it!=(v).rend();it++)
#define vall(x) (x).begin(), (x).end()
#define rvall(x) (x).rbegin(), (x).rend()
#define vsort(v) sort(vall(v))
#define rvsort(v) sort(rvall(v))
#define len(array) (sizeof (array) / sizeof *(array))
#define aall(x) x, x+len(x)
#define asort(x) sort(aall(x))
#define rasort(a, type) sort(aall(a), greater<type>())
#define afill(a, v) fill(aall(a), v)
#define afill2(a, v, type) fill((type *)a, (type *)(a + len(a)), v)
#define sz(x) (int)(x).size()
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pb push_back
#define _USE_MATH_DEFINES
#define priArr(table, n) rep(i,n){cout<<table[i]<<' ';}cout<<'\n';
#define priAr2(table,W,H) rep(y,H){rep(x,W)cout<<table[y][x]<<' ';cout<<'\n';}
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = ["<<(x)<<"]"<<endl;

using namespace std;
using std::stringstream;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline std::string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class F, class T> inline void convert(const F &f, T &t){stringstream ss;ss<<f;ss>>t;}
template<class T> inline T sqr(T x) {return x*x;}

typedef long long ll; typedef unsigned long long ull;
typedef pair <int, int> P; typedef pair <int, P> PP;
typedef vector<int> vi;typedef vector<vi> vvi;typedef vector<string> vs;
typedef vector<ll> vl; typedef vector<P > vP; typedef vector<char> vc;
typedef long double ld;

const static int INF = 0x3f3f3f3f;
const static ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const static double EPS = 1e-9;
const static ll MOD = 1000000007LL;

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

int main(int argc, char *argv[])
{
    int N, X, Y;
    cin >> N >> X >> Y;
    X--;Y--;

    vi ans(N-1, 0);

    rep(i, N-1) {
        reb(j, i+1, N) {
            int min_dist = min(j-i, (abs(X-i) + 1 + abs(Y - j)));
            ans[min_dist-1]++;
        }
    }

    rep(i, N-1) { cout << ans[i] << endl; }

    return 0;
}


Measured memory_bytes: 256
n = int(input())
v = [int(i) for i in input().split()]

even = dict()
odd = dict()

for i in range(n//2):
    e = v[2*i]
    o = v[2*i + 1]
    if e in even:
        even[e] += 1
    else:
        even[e] = 1
    if o in odd:
        odd[o] += 1
    else:
        odd[o] = 1

even = sorted(even.items(), key=lambda x:x[1], reverse=1)
odd = sorted(odd.items(), key=lambda x:x[1], reverse=1)


if even[0][0] != odd[0][0]:
    print(n-even[0][1]-odd[0][1])
else:
    if len(even) > 1 and len(odd) > 1:
        print(n - even[0][1]-max(even[1][1], odd[1][1]))
    elif len(even) > 1:
        print(n - even[0][1] - even[1][1])
    elif len(odd) > 1:
        print(n - even[0][1] - odd[1][1])
    else:
        print(n - even[0][1])

Measured memory_bytes: 19292
from functools import reduce
MOD = 10**9+7
n = int(input())
A = list(map(int, input().split()))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return (a*b)//gcd(a, b)


x = reduce(lcm, A) % MOD
print(sum(x*pow(a, MOD-2, MOD) for a in A) % MOD)


Measured memory_bytes: 4704
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds; 
  
#define ll long long
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
	enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int mod = (int)1e9 + 7;
const int MX = (int)1e5 + 10;

void add_self(int &x, int y){x += y; if(x >= mod) x -= mod;}
void sub_self(int &x, int y){x -= y; if(x < 0) x += mod;}
void mul(int &x, int y){x = x * 1LL * y % mod;}

int n, m, q, res;
vector<int> arr;
vector<array<int, 4>> vec;

void solve(int idx, int val){
	if(idx == n){
		int cur = 0;
		for(auto &r : vec){
			if(arr[r[1]] - arr[r[0]] == r[2]) cur += r[3];
		}
		res = max(res, cur);
		return;
	}
	for(int i = val; i <= m; ++i){
		arr[idx] = i;
		solve(idx + 1, i);
		arr[idx] = 0;
	}
}

int main(){

	cin.tie(0); cout.tie(0);
	ios_base::sync_with_stdio(0);

	
	cin >> n >> m >> q;
	vec.resize(q);
	arr.resize(n);
	for(int i = 0; i < q; ++i){
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		--a, --b;
		vec[i] = {a, b, c, d};
	}

	solve(0, 1);

	cout << res << endl;

	return 0;
}

Measured memory_bytes: 3644
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll K; cin >> K;
    if (K == 0) {
        cout << 2 << endl;
        cout << 0 << " " << 0 << endl;
        return 0;
    }
    if (K == 1) {
        cout << 2 << endl;
        cout << 2 << " " << 0 << endl;
        return 0;
    }
    if (K <= 50) {
        cout << K << endl;
        rep(i,K) cout << K << " ";
        cout << endl;
        return 0;
    }
    ll p = 49 + K / 50;
    ll q = K % 50;
    vector<ll> A(50,p-q);
    rep(i,q) A[i] += 51;
    cout << 50 << endl;
    rep(i,50) cout << A[i] << " ";
    cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    cout << fixed << setprecision(10);
    string s;
    cin >> s;
    map<char,int> mci;
    for(auto u : s){
        mci[u]++;
    }
    if(mci.size()==2){
        if(mci[s[0]]==2) cout << "Yes" << endl;
        else cout << "No" << endl;
    }else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N;
  cin >> N;
  vector<int> A;
  rep(i,N){
    int a;
    cin >> a;
    A.push_back(a);
  }

  int ret = 0;
  rep(i,N){
    int tmp = 0;
    int a = A[i];
    while(a%2==0){
      a /= 2;
      tmp++;
    }
    ret += tmp;
  }

  cout << ret << endl;
  
  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define sz(x) x.size()
#define printarray(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout<<*it<<" "; cout<<endl;
#define rep(n) for (ll i = 0; i < n; i++)
#define repc(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define DEC(i, x, y) for (int i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a + n
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b)/gcd(a, b)
#define int long long int
#define ull unsigned long long

using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;

int fastexpo(int b, int exp){
    if(exp == 0) return 1;
    if(exp == 1) return b;
    int ans = (fastexpo(b,exp/2) % MOD);
    ans *= ans;
    ans %= MOD;
    if(exp % 2 == 1){
        ans *= b;
    }
    ans %= MOD;
    return ans;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int ans = 0;
    for(int i= 1;i<=n;i++){
    	int occ = (n/i);
    	int val = (occ * (occ+1))/2;
    	ans += val*i;
    }
    cout<<ans<<endl;
    return 0;
}





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

int main() {
	int q;
	cin >> q;
	map<string, int> M;
	for (int i = 0; i < q; ++i) {
		int query;
		cin >> query;
		if (query == 0) {
			string key;
			int x;
			cin >> key >> x;
			M[key] = x;
		}
		else if (query == 1) {
			string key;
			cin >> key;
			if (M.end() == M.find(key)) cout << 0;
			else cout << M.find(key)->second;
			cout << endl;
		}
		else if (query == 2) {
			string key;
			cin >> key;
			M.erase(key);
		}
		else {
			string L, R;
			cin >> L >> R;
			for (auto i = M.lower_bound(L); i != M.upper_bound(R); ++i) cout << i->first << ' ' << i->second << endl;
		}
	}
}


Measured memory_bytes: 27824
#include<bits/stdc++.h>
 
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define float       double
#define	endl		'\n'
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;
 
#define N  100005
signed main()
{
	fast;
	int a,b,c;
	cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b<<endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int k=sc.nextInt();
		int n=sc.nextInt();
		int a[]=new int[10];
		for(int i=0;i<n;i++){
			int m=sc.nextInt();
			a[m]+=1;
		}
		int i=0;
	
		for(;;){
			
			if(f(k++,a)){
				break;
			}
			
		}
	}
	public static boolean f(int n,int a[]){
		char c[]=Integer.toString(n).toCharArray();
		//System.out.println(Arrays.toString(c));
		boolean t=true;
		for(int i=0;i<c.length;i++){
			for(int j=0;j<n;j++){
				//System.out.println(i);
				if(a[(c[i]-'0')]!=0){
					t=false;
					break;
				}
			}
		}
		
		
		if(t){
			String ans="";
			for(int u=0;u<c.length;u++){
				ans+=c[u];
			}
			System.out.println(ans);
		}
		return t;
	}

}

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

//atcoder need change class name to Main
//D - Knapsack 1
//stand dp <= Weight
//loop from right to left

//https://atcoder.jp/contests/dp/tasks/dp_c

public class Main {
    static StringTokenizer st;
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

 
    public static void main(String[] args) throws IOException {
  
        int N = nextInt(); 
        int W = nextInt(); 
        long[] dp = new long[W+1];
        dp[0] = 0;

        for (int i=1; i<=N;  i++) {
            int w = nextInt();
            int v = nextInt();
            
            for (int j=W; j>=w; j--) {
                dp[j] = Math.max(dp[j], dp[j-w] + v); 
            }
        }
 
        System.out.println(dp[W]);
    }
    

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
}

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

namespace dpsheet
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] st = Console.ReadLine().Split(' ');
            long n = int.Parse(st[0]);
            long w = int.Parse(st[1]);
            long[] arrw = new long[n+1];
            long[] arrp = new long[w+1];
            long[,] temp = new long[n + 1, w+1];
            for (int i =1; i <= n; i++) {
              string[] st1 = Console.ReadLine().Split(' ');
                arrw[i] = long.Parse(st1[0]);
                arrp[i] = long.Parse(st1[1]);
            }
            for (int i = 1; i <= n; i++)
                for (int j = 1; j <= w; j++)
                    temp[i, j] = -1;
            Console.WriteLine(Knapsack1(n, w, arrw,arrp,temp));


        }
        static long Knapsack1(long N, long w, long[] arrw ,long[] arrp,long[,] temp)
        {
            if (N == 0 || w == 0)
                return temp[N, w] = 0;
            if (temp[N, w] != -1)
                return temp[N, w];
            else if (arrw[N] > w)
                return Knapsack1(N - 1, w, arrw, arrp,temp);
            else
            {
                temp[N, w] = Math.Max(Knapsack1(N - 1, w - arrw[N], arrw, arrp,temp) + arrp[N], Knapsack1(N - 1, w, arrw, arrp,temp));
            }
            return temp[N, w];
        }
    }
}


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

/*
   AtCoder contest
   coder : yoichidon
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long K = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        if(B-A<=2){
            System.out.println(1+K);
            return;
        }

        long exchange = Math.max((K-A+1)/2,0);
        long hit = K-exchange*2;

        System.out.println(1 + hit + exchange*(B-A));




    }
}


Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll solve(ll n,ll m,vector<vector<ll>> &v,vector<ll> &itr,vector<vector<ll>> &s){
  bool nop[m]={};
  ll ans=n;
  while(1){
    bool ok=1;
    vector<ll> te;
    rep(l,m){
      if(s[l].size()>ans){
        for(auto w:s[l])te.push_back(w);
        s[l].clear();
        nop[l]=1;
      }
    }
    for(auto w:te){
      ok=0;
      while(1){
        itr[w]++;
        if(itr[w]==m)return ans+1;
        if(nop[v[w][itr[w]]]==0)break;
      }
      s[v[w][itr[w]]].push_back(w);
    }
    if(ok)ans--;
  }
  return -1;
}

int main()
{
ll n , m ;
cin >> n >> m ;
vector<vector<ll>> v(n, vector<ll>(m,0) );
rep(i,n)rep(j,m){
  cin >> v[i][j];
  v[i][j]--;
}

vector<vector<ll>> s(m);
vector<ll> itr(n);
rep(j,n){
  s[v[j][0]].push_back(j);
}
cout << solve(n,m,v,itr,s) << endl;
return 0;
}

Measured memory_bytes: 2176
t = input()

"""
d = 0
pd = 0
p=0
for s in t:
  if s =="d" or s=="?":
    d+=1
    if p==1:
      pd+=1
  else:
    p=1

print(d+pd)
"""

ans = ""
for s in t:
  if s == "?":
    ans += "D"
  else:
    ans += s
print(ans)


Measured memory_bytes: 9324
using System;
using System.Linq;

namespace b
{
    class Program
    {
        static void Main(string[] args)
        {
            var board = new int[3,3];

            for (var r = 0; r < 3; ++r) {
                Console.ReadLine().Split(' ')
                .Select((x, c) => {
                    board[c, r] = int.Parse(x); 
                    return 0;
                })
                .All(_ => true);
            }

            var n = int.Parse(Console.ReadLine());

            var hits = new bool[3,3];

            for (var i = 0; i < n; ++i) {
                var ball = int.Parse(Console.ReadLine());

                for (var r = 0; r < 3; ++r) {
                    for (var c = 0; c< 3; ++c) {
                        if (board[c, r] == ball) {
                            hits[c, r] = true;
                            goto loopOut; 
                        }
                    }
                }
                loopOut:;
            }

            var ans = "No";

            for (var r = 0; r < 3; ++r) {
                if (Enumerable.Range(0, 3).All(c => hits[c, r])) {
                    ans = "Yes";
                    goto result;
                }
            }
            if (ans == "No") {
                for (var c = 0; c < 3; ++c) {
                    if (Enumerable.Range(0, 3).All(r => hits[c, r])) {
                        ans = "Yes";
                        goto result;
                    }
                }
            }
            if (ans == "No") {
                if (Enumerable.Range(0, 3).All(i => hits[i, i])) {
                    ans = "Yes";
                    goto result;
                }
            }
            if (ans == "No") {
                if (Enumerable.Range(0, 3).All(i => hits[3-i-1, i])) {
                    ans = "Yes";
                    goto result;
                }
            }
            result:;
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 28016
#include <iostream>

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

using namespace std;

long long MOD = 1000000007;

int main(){
  long long N;
  string S;
  cin >> N >> S;
  // 入力終了

  // アルファベットが何回出現したか
  long long cnt[26] = {0};
  rep(i, N){
    cnt[ S[i]-'a' ]++;
  }

  // 各アルファベットがcnt[i]回出現するので，
  // それを選ぶならcnt[i]通りと，選ばないという1通りがある
  long long ans = 1;
  rep(i, 26)
    ans = ( ans*(cnt[i]+1) )%MOD;

  // 何も選ばないときと，初期化の1を引く
  cout << ans-1 << endl;
    
  return 0;
}


Measured memory_bytes: 3724
h,w=map(int,input().split())
a=[]
for i in range(h):a.append(list(input()))
white=[flatten for inner in a for flatten in inner].count(".")
turn=1
a[-1][-1]=1
while turn in [flatten for inner in a for flatten in inner]:
    for i in range(h):
        for j in range(w):
            if a[i][j]==turn:
                if i>0 and a[i-1][j]==".":a[i-1][j]=turn+1
                if i<h-1 and a[i+1][j]==".":a[i+1][j]=turn+1
                if j>0 and a[i][j-1]==".":a[i][j-1]=turn+1
                if j<w-1 and a[i][j+1]==".":a[i][j+1]=turn+1
    turn+=1
    if a[0][0]!=".":break
print(-1 if a[0][0]=="." else white-a[0][0])

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

void hantei(int box[][15],int i,int j){

	if(box[i][j+1]==1 && box[i+1][j]==1 && box[i+1][j+1]==1)printf("A\n");
	else if(box[i][j+1]==1 && box[i][j+2]==1 && box[i][j+3]==1)printf("C\n");
	else if(box[i+1][j]==1 && box[i+2][j]==1 && box[i+3][j]==1)printf("B\n");
	else if(box[i+1][j]==1 && box[i+1][j-1]==1 && box[i+2][j-1]==1)printf("D\n");
	else if(box[i][j+1]==1 && box[i+1][j+1]==1 && box[i+1][j+2]==1)printf("E\n");
	else if(box[i+1][j]==1 && box[i+1][j+1]==1 && box[i+2][j+1]==1)printf("F\n");
	else if(box[i][j+1]==1 && box[i+1][j]==1 && box[i+1][j-1]==1)printf("G\n");
}

int main(){
	int num[8]={0};
	int box[15][15]={0};
	int i,j,flag=0;
	
	
	while(scanf("%d%d%d%d%d%d%d%d",&num[0],&num[1],&num[2],&num[3],&num[4],&num[5],&num[6],&num[7])!=EOF){

		for(i=7;i>=0;i--){
			for(j=7;j>=0;j--){
				box[i][j]=num[i]%10;
				num[i]/=10;
			}
		}
		
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				if(box[i][j]==1){
					hantei(box,i,j);
					flag=1;
					break;
				}
			}
			if(flag==1)break;
		}
		flag=0;
		for(i=0;i<14;i++){
			for(j=0;j<14;j++){
				box[i][j]=0;
			}
		}
	}
return 0;
}

Measured memory_bytes: 580
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N, A[200005];
unordered_map<int, ll> M;

// i<jのときj-i=A[i]+A[j]
// A[i]+i=j-A[j]
int main() {
  INCANT;
  cin >> N;
  rep(i, N) {
    cin >> A[i];
    M[A[i]+i]++; 
  }
  ll res = 0;
  rep(i, N) res+=M[i-A[i]];

  cout << res << endl;
  return 0;
}

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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] NK = Console.ReadLine().Split(' ');
            int N = int.Parse(NK[0]);
            int K = int.Parse(NK[1]);

            int[] answer = new int[N];

            for(int i = 0; i < K; i++)
            {
                int d = int.Parse(Console.ReadLine());
                string[] A = Console.ReadLine().Split(' ');

                for(int j = 0; j < d; j++)
                {
                    answer[int.Parse(A[j]) - 1]++;
                }
            }

            Console.WriteLine(answer.Count(value => value == 0));
        }
    }
}


Measured memory_bytes: 27952
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class D
{
	public static void Main()
	{
		(new Solver()).Solve();
	}
}


public class Node
{
	public int V { get; private set; }
	public int W { get; private set; }

	public Node(int v, int w)
	{
		V = v;
		W = w;
	}
}


public class Solver
{
	private int N;
	private List<Node>[] lists;
	private bool[] visited;
	private int[] color;

	public Solver()
	{
		N = GetInt();
		lists = new List<Node>[N+1];
		for(int i= 1; i <= N; i++)
			lists[i] = new List<Node>();
		for(int i = 0; i < N - 1; i++)
		{
			int u = GetInt();
			int v = GetInt();
			int w = GetInt();
			lists[u].Add(new Node(v, w));
			lists[v].Add(new Node(u, w));
		}
	}

	public void Solve()
	{		
		visited = new bool[N+1];
		color = new int[N+1];
		visited[1] = true;
		color[1] = 0;

		dfs(1);

		for(int i = 1; i <= N; i++)
			Console.WriteLine(color[i]);
	}

	private void dfs(int u)
	{
		foreach(Node node in lists[u])
		{
			if(visited[node.V])
				continue;
			visited[node.V] = true;
			color[node.V] = (node.W % 2 == 0) ? color[u] : color[u]^1;
			dfs(node.V);
		}		
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}





Measured memory_bytes: 36876
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define all(v)    ((v.begin()),(v.end()))
#define sz(v)     ((int)(v.size()))
#define forv(i, v) for(int i = 0; i < sz(v); ++i)
#define forn(i,n)   for(int i = 0; i < (int)(n); i++)
using namespace std;

typedef long long       ll;
typedef long double     ld;
typedef vector<int>     vi;
typedef vector<double>  vd;
typedef vector< vi >    vii;
typedef vector< vd >    vdd;
typedef vector<string>  vs;


int main()
{
	fast;
	ll x, y, a, b, c;
	cin >> x >> y >> a >> b >> c;
	vector<int> v, v1, v2;
	for (int i = 0; i < a ; i++) {
		ll x;
		cin >> x;
		v1.push_back(x);
	}
	for (int i = 0; i  < b; i++) {
		ll x;
		cin >> x;
		v2.push_back(x);
	}
	for (int i = 0; i < c; i++) {
		ll x;
		cin >> x;
		v.push_back(x);
	}
	ll ans = 0;
	sort(v1.rbegin(), v1.rend());
	sort(v2.rbegin(), v2.rend());
	for (int i = 0; i < x; i++) v.push_back(v1[i]);
	for (int i = 0; i  < y; i++) v.push_back(v2[i]);
	sort(v.rbegin(), v.rend());
	for (int i = 0; i < (x + y); i++) {
		ans += v[i];
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e18;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N,H,W;
    cin >> N >> H >> W;
    cout << (N-H+1)*(N-W+1) << endl;
}


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


int main()
{
    ll n , k ;
    cin >>  n >> k;
    ll arr[n][2] ;
    for( ll i =0 ; i <  n ; i++)
    {
        cin >>arr[i][1] >>arr[i][0] ;
    }
    ll grr[n][k+1]  ;
    ll visi[n][k+1] = {0}  ;
    ll pushed[n][k+1] = {0}  ;

for(ll i =0  ; i  < n ;i++)
{
    for(ll j = 0 ; j <  k+1 ; j++)
    {
        visi[i][j] = 0;
    }
}
    
    stack <pair<ll , ll > >s ;
    s.push(make_pair(0 , k)) ;

    while(!s.empty())
    {
        ll i = s.top().first ,  k2 = s.top().second ;
        
        
        if(visi[i][k2] !=1 )
        {
            if(i==n-1)
            {
                if(arr[i][1]>k2)
                {
                    grr[i][k2] = 0 ;
                    visi[i][k2] =1 ;
                    s.pop() ;
        
                }
                else
                {
                    grr[i][k2] = arr[i][0] ;
                    visi[i][k2] =1 ;
                    s.pop() ;
        
                
                    
                }
            }else
            {
                if(k2 >= arr[i][1])
                {
                    if(visi[i+1][k2-arr[i][1]] == 1 && visi[i+1][k2] ==1  )
                    {
                        grr[i][k2] = max(grr[i+1][k2] , grr[i+1][k2-arr[i][1]] +arr[i][0]) ;
                        visi[i][k2] =1 ;
                        s.pop() ;
        
                        
                     }
                     else
                     {
                         
                         if(visi[i+1 ][k2-arr[i][1]]!=1)
                         s.push(make_pair(i+1 , k2-arr[i][1])) ;
                         if(visi[i+1][k2]!=1  )
                         s.push(make_pair(i+1 , k2)) ;
                     
                         
                     }
                }else
                {
                    if(visi[i+1][k2] ==1)
                    {
                        grr[i][k2] = grr[i+1][k2] ;
                        
                        
                        
                    visi[i][k2] =1 ;
                    s.pop() ;
        
                    }else
                    {
                        
                        s.push(make_pair(i+1, k2)) ;
                    
                    
                    }
                }
                
            }
        }
        
            else
            s.pop() ;
           
    }
    
    cout<< grr[0][k] <<endl ;
    
    
    return  0 ;
    
    
}

Measured memory_bytes: 233856
#include <iostream>


int dot(int vec1[100], int vec2[100], int size){
  int ans = 0;
  for (int i = 0; i < size; i ++) {
    ans += vec1[i] * vec2[i];
  }
  return ans;
}


void product(int matrix[100][100], int vector[100], int size_x, int size_y, int result[100]){
  for (int i = 0; i < size_x; i ++) {
    result[i] = dot(matrix[i], vector, size_y);
  }

}


int main() {
  int n, m, value;
  int matrix[100][100] = {0}, vector[100] = {0}, result[100] = {0};

  std::cin >> n >> m;
  for (int i = 0; i < n; i ++) {
    for (int j = 0; j < m; j ++) {
      std::cin >> value;
      matrix[i][j] = value;
    }
  }

  for (int j = 0; j < m; j ++) {
    std::cin >> value;
    vector[j] = value;
  }


  product(matrix, vector, n, m, result);

  for (int i = 0; i < n; i ++) {
    std::cout << result[i] << std::endl;
  }

  return 0;
}



Measured memory_bytes: 3160
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
#include <stdlib.h>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;

int main(){
    ll a=700;
    string x;
    cin >> x;
    for (int i=0;i<3;++i){
        if(x[i]=='o'){
            a+=100;
        }
    }
    cout << a << endl;
    return 0;
}


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

typedef long long ll;
typedef long long llong;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;

const ll MOD = 998244353;
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
const int MX = 360000;

int n, m;
string a, b, c, d;

ll fc[MX];
ll bfc[MX];

ll cnk(int n, int k) {
	if (n < k)
		return 0;
	return fc[n] * bfc[n - k] % MOD * bfc[k] % MOD;
}

ll get(int a, int b, int c) {
	if (b == 0) {
		if (a == 0 && c == 0)
			return 1;
		return 0;
	}
	return cnk(a + b + c - 1, a + c);
}

ll solve() {
	ll sum = 0;
	int cl = 0;
	int cr = 0;
	for (int i = 0; i < n; ++i)
		if (a[i] == '1')
			++cl;
	for (int i = 0; i < n; ++i)
		if (b[i] == '1')
			++cr;
	int cd2 = 0, cu2 = 0;
	for (int i = 0; i < m; ++i)
		if (c[i] == '1')
			++cu2;
	for (int i = 0; i < m; ++i)
		if (d[i] == '1')
			++cd2;
	int cd = 0, cu = 0;
	ll ans = 0;
	for (int i = 0; i < m; ++i) {
		if (c[i] == '0' && d[i] == '0')
			continue;
		sum = (sum + get(cd, cl, cu)) % MOD;
		if (c[i] == '1' && d[i] == '1')
			sum = (sum * 2) % MOD;
		if (c[i] == '1')
			++cu, --cu2;
		if (d[i] == '1')
			++cd, --cd2;
		ans = (ans + sum * get(cu2, cr, cd2)) % MOD;
	}
	return ans;
}

int main() {
	fc[0] = bfc[0] = 1;
	for (int i = 1; i < MX; ++i) {
		fc[i] = (fc[i - 1] * i) % MOD;
		bfc[i] = pw(fc[i], MOD - 2);
	}

	cin >> n >> m;
	cin >> a >> b >> c >> d;
	int fl = 0;
	for (int i = 0; i < n; ++i)
		if (a[i] == '1')
			fl = 1;
	for (int i = 0; i < n; ++i)
		if (b[i] == '1')
			fl = 1;
	for (int i = 0; i < m; ++i)
		if (c[i] == '1')
			fl = 1;
	for (int i = 0; i < m; ++i)
		if (d[i] == '1')
			fl = 1;
	if (!fl) {
		cout << 1 << "\n";
		return 0;
	}
	ll ans = solve();
	swap(a, c);
	swap(b, d);
	swap(n, m);
	ans = (ans + solve()) % MOD;
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
//Author: Ezio Sam
/* Shorthands */
#define ll long long
#define pb push_back 
#define mp make_pair
#define sp " "
#define cs "Case "
#define fi first
#define sn second 
#define po(x) x*x
/* STL */
#define vi vector<int>v
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mem(a,n) memset(a, n, sizeof(a));
#define all(x) x.begin(),x.end()
#define alr(x) x.rbegin(),x.rend()
#define sz(x)  (int)x.size()
#define mx(v)  *max_element(v.begin(),v.end())
#define mxi(v) distance(v.begin(),max_element(v.begin(),v.end()))
#define mxa(a) *max_element(a, a.size())
#define r(a) reverse(a.begin(),a.end())
/* loops */
#define fr(i,n)   for(__typeof(n) i=0;i<(n);i++)
#define fn(i,n)   for(__typeof(n)i=1;i<=(n);i++)
#define fa(i,a,n) for(int  i=a;i<=b;i++)
/*Special*/
#define Ezio ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define db(something)  cerr<<#something<<" - "<<something<<"\n";         

int main()
{
  
   Ezio
   ll t,m,n,x,a,b;
   string s;
   
   cin>>n;
   a=0;
   fn(i,n)a+=((n/i)*((n/i)+1)*i/2);
   cout<<a<<endl;
   return 0;
}
    

Measured memory_bytes: 3624
n = int(input())
v = list(map(int, input().split()))
from collections import Counter
cnt = Counter(v)
ocnt = sorted(Counter(v[::2]).items(), key=lambda x: x[1], reverse=True)
ecnt = sorted(Counter(v[1::2]).items(), key=lambda x: x[1], reverse=True)
if len(cnt) == 1:
    print(n//2)
elif len(ocnt) == 1 and len(ecnt) == 1:
    print(0)
else:
    onum = ocnt[0][1]
    enum = ecnt[0][1]
    if ocnt[0][0] != ecnt[0][0]:
        print(n - onum - enum)
    else:
        if len(ocnt) > 1 and len(ecnt) > 1 and ocnt[1][0] != ecnt[1][0]:
            print(min(n - onum - ecnt[1][1], n - enum - ocnt[1][1], n - ecnt[1][1] - ocnt[1][1]))
        else:
            print(min(n - onum - ecnt[1][1], n - enum - ocnt[1][1]))


Measured memory_bytes: 30072
#include <queue>
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
#include <cstdio>
#define rep(i, n) for(long long i = 0;(i) < (n);(i)++)
using namespace std;
using ll = long long;
const ll mod = 1000000007;


int main()
{
	ll N;
	cin >> N;
	if (N == 2)
	{
		cout << 2 << endl;
		return 0;
	}
	vector<ll> prime;
	prime.push_back(2);
	for (int i = 3; i <= 100003; i++)
	{
		bool flag = true;
		for (auto k : prime)
		{
			if (k * k > i) break;
			if (i % k == 0) flag = false;
		}
		if (flag)
		{
			if (i >= N)
			{
				cout << i << endl;
				return 0;
			}
			prime.push_back(i);
		}
	}
	return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
  char s[10], a[2] = "a\n";
  int l, sum = 0;
  scanf("%s", s);
  l = strlen(s);
  for(int i = 0; i < l; ++i){
    a[0] = s[i];
    sum += atoi(a);
  }
  if(atoi(s) % sum == 0) puts("Yes");
  else puts("No");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
    freopen("a.in","r",stdin);
    #endif
    ll n,m;
    cin>>n>>m;
    if (m>=n)
        cout<<"Yes";
    else
        cout<<"No";




}

Measured memory_bytes: 256
n, m = map(int, input().split(" "))
m = int(m)
A = list(map(int, input().split(" ")))

sum = 0
for i in A:
    sum += int(i)

s = sum / 4 / m
ans = 0
for i in A:
    if int(i) >= s:
        ans += 1

if ans >= m:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 9188