akhauriyash/Code-Regression huggingface dataset:
// Legends Never Die.

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define fst first
#define snd second
#define SZ(u) ((int) (u).size())
#define ALL(u) (u).begin(), (u).end()

inline void proc_status()
{
	ifstream t("/proc/self/status");
	cerr << string(istreambuf_iterator<char>(t), istreambuf_iterator<char>()) << endl;
}

template<typename T> inline int chkmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; }
template<typename T> inline int chkmax(T &a, const T &b) { return b > a ? a = b, 1 : 0; }

template<typename T> inline T read()
{
	register T sum(0), fg(1);
	register char ch(getchar());
	for(; !isdigit(ch); ch = getchar()) if(ch == '-') fg = -1;
	for(;  isdigit(ch); ch = getchar()) sum = sum * 10 - '0' + ch;
	return sum * fg;
}

const int MOD = 998244353;

inline int fpm(int x, int y)
{
	int res = 1;
	for(; y; y >>= 1, x = (LL) x * x % MOD) if(y & 1) res = (LL) res * x % MOD;
	return res;
}

inline int inv(int x) { assert(x != 0); return fpm(x, MOD - 2); }

const int MAXN = 400;

namespace MATH
{
	const int n = MAXN * 2;

	int fac[n + 5], ifac[n + 5];

	inline void init()
	{
		fac[0] = 1;
		for(int i = 1; i <= n; ++i) fac[i] = (LL) fac[i - 1] * i % MOD;
		ifac[n] = inv(fac[n]);
		for(int i = n - 1; i >= 0; --i) ifac[i] = (LL) ifac[i + 1] * (i + 1) % MOD;
	}
}
using MATH::fac;
using MATH::ifac;

int n;

int A[MAXN + 5], B[MAXN + 5];

inline void input()
{
	n = read<int>();
	for(int i = 1; i <= n; ++i) A[i] = read<int>(), B[i] = read<int>();
}

inline void solve()
{
	int SA = 0, SB = 0;
	for(int i = 1; i <= n; ++i) SA += A[i], SB += B[i];

	static int pw[MAXN + 5][MAXN + 5], ipw[MAXN + 5][MAXN + 5];

	for(int i = 1; i <= n; ++i)
	{
		pw[i][0] = ipw[i][0] = 1;
		for(int iA = inv(A[i]), j = 1; j <= SB; ++j)
		{
			pw[i][j] = (LL) pw[i][j - 1] * A[i] % MOD;
			ipw[i][j] = (LL) ipw[i][j - 1] * iA % MOD;
		}
	}

	static int f[MAXN + 5][MAXN + 5][MAXN + 5][2];

	f[0][0][0][0] = -1;
	for(int i = 1; i <= n; ++i)
		for(int j = 0; j <= SA; ++j) for(int k = 0; k <= SB; ++k) for(int t = 0; t < 2; ++t)
		{
			(f[i][j][k][t] += f[i - 1][j][k][t]) %= MOD;
			if(j >= A[i])
			{
				for(int q = 0; q < B[i] && q <= k; ++q) (f[i][j][k][t] += (LL) -pw[i][q] * ifac[q] % MOD * f[i - 1][j - A[i]][k - q][t] % MOD) %= MOD;
				if(k >= B[i] && t == 1) (f[i][j][k][t] += (LL) -pw[i][B[i]] * ifac[B[i] - 1] % MOD * f[i - 1][j - A[i]][k - B[i]][0] % MOD) %= MOD;
			}
		}

	int ans = 0;
	for(int i = 0; i <= SA; ++i) for(int j = 0; j <= SB; ++j) if(f[n][i][j][1])
		(ans += (LL) f[n][i][j][1] * j % MOD * fpm(inv(i), j + 1) % MOD * SA % MOD * fac[j - 1] % MOD) %= MOD;
	printf("%d\n", (ans + MOD) % MOD);
}

int main()
{
#ifdef K_ON // K-ON!
	freopen("E.in", "r", stdin);
	freopen("E.out", "w", stdout);
#endif

	MATH::init();
	input();
	solve();

	return 0;
}



Measured memory_bytes: 515200
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	//static long mod =1000000007;
	//static 	ArrayList<Integer> cc = new ArrayList<>(100);
	
	
	
	
	//for(int i=0;i<N;i++) {}
	public static void main(String[] args) {
		//int N=sc.nextInt();for(int i=0;i<N;i++) {}
		int X=sc.nextInt();
		int A=sc.nextInt();
		
		if(X<A)p(0);
		else p(10);
		
	}
	

	
	
	
	

	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 21844
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**6)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
#show_flg=True

n,m=LI()

## Segment Tree ##

## Initializer Template ##
# Range Sum:        sg=SegTree(n,0)
# Range Minimum:    sg=SegTree(n,inf,min,inf)

class SegTree:

    def __init__(self,n,init_val=0,function=lambda a,b:a+b,ide=0):
        self.n=n
        self.ide_ele=ide_ele=ide
        self.num=num=2**(n-1).bit_length()
        self.seg=seg=[self.ide_ele]*2*self.num
        self.segfun=segfun=function
        #set_val
        for i in range(n):
            self.seg[i+self.num-1]=init_val
        #built
        for i in range(self.num-2,-1,-1) :
            self.seg[i]=self.segfun(self.seg[2*i+1],self.seg[2*i+2]) 
    
    def update(self,k,x):
        k += self.num-1
        self.seg[k] = x
        while k:
            k = (k-1)//2
            self.seg[k] = self.segfun(self.seg[k*2+1],self.seg[k*2+2])
        
    def query(self,p,q):
        if q<=p:
            return self.ide_ele
        p += self.num-1
        q += self.num-2
        res=self.ide_ele
        while q-p>1:
            if p&1 == 0:
                res = self.segfun(res,self.seg[p])
            if q&1 == 1:
                res = self.segfun(res,self.seg[q])
                q -= 1
            p = p//2
            q = (q-1)//2
        if p == q:
            res = self.segfun(res,self.seg[p])
        else:
            res = self.segfun(self.segfun(res,self.seg[p]),self.seg[q])
        return res

    def __str__(self):
        # 生配列を表示
        rt=self.seg[self.num-1:self.num-1+self.n]
        return str(rt)

s=[int(i) for i in input()]

def dp(b,m): # N log (N)
    N=len(b)-1
    n=N+1
    sg=SegTree(n,inf,min,inf)

    sg.update(0,0)

    dp=[0]+[inf]*(N)
    for i in range(N):
        if b[i+1]==1:
            continue
        dp[i+1]=sg.query(max(i-m+1,0),i+1)+1
        sg.update(i+1,dp[i+1])
        #show(seg)
    
    show(sg)

    return dp

dp1=dp(s,m)
step=dp1[n]
if step==inf:
    print(-1)
    exit()

dp2=dp(s[::-1],m)[::-1]

show(dp1,'dp1')
move=[0]
ans=[]
j=1
for i in range(step,0,-1): # N
    while j<=n and dp2[j]!=i-1:
        j+=1
    move.append(j)

for i in range(len(move)-1):
    ans.append(move[i+1]-move[i])
print(*ans)


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

#define int long long
#define ll long long
#define pb push_back

main(){
    string h;
    cin >> h;
    int n = h.size();
    for(int i = 0; i < n; i++){
        if (h[i] == '?'){
            h[i] = 'D';
        }
    }
    cout << h;
}


Measured memory_bytes: 3720
N = int(input())
A = list(map(int,input().split()))

A.insert(0,0)
A.append(0)
_A = []

for i in range(1,N+1):
  _A.append(abs(A[i] - A[i-1]))
_A.append(abs(0-A[N]))
S = sum(_A)


for i in range(0,N):
  allS = S
  allS -= (_A[i]+_A[i+1]-abs(A[i+2]-A[i]))
  print(allS)

Measured memory_bytes: 20608
#include<stdio.h>
int h,w,n;
bool d[1000][1000];
int t[1000][1000];
int i,j;

int main(){
	while(1){
		scanf("%d %d %d",&h,&w,&n);
		if(h==0)return 0;
		for(i=0;i<h;i++)for(j=0;j<w;j++){
			int x;
			scanf("%d",&x);
			if(x==1)d[i][j]=true;
			if(x==0)d[i][j]=false;
			t[i][j]=0;
		}
		t[0][0]=n-1;
		for(i=0;i<h;i++)for(j=0;j<w;j++){
			if(t[i][j]%2==0){
				if(i+1<h)t[i+1][j]+=t[i][j]/2;
				if(j+1<w)t[i][j+1]+=t[i][j]/2;
			}
			else{
				if(d[i][j]){
					if(i+1<h)t[i+1][j]+=t[i][j]/2;
					if(j+1<w)t[i][j+1]+=t[i][j]/2+1;
				}
				else{
					if(i+1<h)t[i+1][j]+=t[i][j]/2+1;
					if(j+1<w)t[i][j+1]+=t[i][j]/2;
				}
				d[i][j]=!d[i][j];
			}
		}
		int x,y;
		x=0;
		y=0;
		while(x!=w&&y!=h){
			if(d[y][x])x++;
			else y++;
		}
		printf("%d %d\n",y+1,x+1);
	}
}	

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

signed main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int h, w, n;
    cin >> h >> w >> n;
    cout << ceil((n*1.0) / max(h, w));
    return 0;
}

Measured memory_bytes: 384
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define mem(a,b) memset(a,b,sizeof(a))
#define  For(i,a,b) for(int i=a,i##E=b;i<=i##E;++i)
#define rFor(i,a,b) for(int i=a,i##E=b;i>=i##E;--i)
using namespace std;
typedef long long LL;
const int N=310;
template<typename T>inline T chkmax(T A,T B){return A>B?A:B;}
template<typename T>inline T chkmin(T A,T B){return A<B?A:B;}
template<typename T>inline void read(T &x)
{
	x=0;int _f(0);char ch=getchar();
	while(!isdigit(ch))_f|=(ch=='-'),ch=getchar();
	while( isdigit(ch))x=x*10+ch-'0',ch=getchar();
	x=_f?-x:x;
}
inline void file()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif
}
int n,m,a[N][N],cnt[N],now,c[N],ans,p[N];
int main()
{
	read(n),read(m);
	For(i,1,n)
		For(j,1,m)
			read(a[i][j]);
	For(i,1,n)cnt[a[i][1]]++,c[i]=1;
	ans=n;
	while(1)
	{
		int now=0,pos=0;
		For(i,1,m)
		if(cnt[i]>now)
		{
			now=cnt[i];
			pos=i;
		}
		if(!pos)break;
		ans=chkmin(ans,now);
		p[pos]=1;
		For(i,1,n)
			while(p[a[i][c[i]]])
			{
				cnt[a[i][c[i]]]--;
				c[i]++;
				if(c[i]<=m)cnt[a[i][c[i]]]++;
			}
	}
	printf("%d\n",ans);
	return 0;
}


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




int main(){
  while(1){


  
  int h;
  cin>>h;
  if(h==0){break;}
  int a[20][10]={};
  for(int i=5;i<h+5;i++){
    for(int t=0;t<5;t++){
      cin>>a[i][t];
    }
  }
  int count=0;
  bool j=true;

  while(j){

    j=false;
 for(int i=5;i<h+5;i++){
    for(int t=0;t<3;t++){
      for(int x=t+1;t<5;x++){
	if(a[i][t]!=a[i][x] || a[i][x]==0){break;}
	if(x-t>=2 && a[i][x+1]!=a[i][x]){
	  j=true;
	  for(int y=t;y<=x;y++){count+=a[i][y]; a[i][y]=0;}
	}
      }
    }
  }

 bool k=true;
 while(k){
   k=false;
 for(int i=h+4;i>=5;i--){
   for(int t=0;t<5;t++){
     if(a[i][t]==0 && a[i-1][t]!=0){k=true; a[i][t]=a[i-1][t]; a[i-1][t]=0;}
   }
 }
 }
 
 
  }

  cout<<count<<endl;




  }
  
  return 0;
}



Measured memory_bytes: 3060
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll n, k,c;
string s;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>k>>c>>s;
    vector<bool>used(n,false);
    rep(i,n){
        if(s[i]=='x'){
            used[i]=true;
        }
    }
    //debug(used);
    vector<ll> haiti,haiti1;
    int now=n-1;
    for(int i=0;i<k;i++){
       while(used[now]){
           now--;
       }
       haiti.push_back(now);
       now-=c+1;
    }
    now=0;
    rep(i,k){
        while(used[now]){
            now++;
        }
        haiti1.push_back(now);
        now+=c+1;
    }
    sort(ALL(haiti));
    rep(i,k){
        if(haiti[i]==haiti1[i]){
            cout<<haiti[i]+1<<"\n";
        }
    }
}


Measured memory_bytes: 5128
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
int main(){
    Hello
    int n;
    cin >> n;
    int arr[n + 5];
    ll x, ans, start = 0;
    for(int i = 0; i < n; i++){
        cin >> arr[i];
        if(i % 2 == 0) start += arr[i];
        else start -= arr[i];
    }
    x = start, ans = 0;
    cout << start << " ";
    for(int i = 1; i < n; i++){
        ans = 2 * arr[i - 1] - x;
        x = ans;
        cout << ans << " ";
    }
    return 0;
}


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

#define pb push_back
#define fr first
#define sc second
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> pip; 
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main() {

  int n;
  int data[6]={0};
  cin>> n;
  while(n--) {
    double height;
    cin>> height;

    if(height < 165) data[0]++;
    else if(height < 170) data[1]++;
    else if(height < 175) data[2]++;
    else if(height < 180) data[3]++;
    else if(height < 185) data[4]++;
    else data[5]++;

  }

  for(int i=0; i<6; i++) {
    cout<< i+1<< ':';
    for(int j=0; j<data[i]; j++) {
      cout<< '*';
    }
    cout<< endl;
  }

}

Measured memory_bytes: 1232
//#pragma GCC optimize("O3")

#include <bits/stdc++.h>
//#include <ctime>

using namespace std;

#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define pb push_back
#define f first
#define s second
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<piii> viii;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MAXN = 500100, MAXK = 20;
const ll MOD = 1e9+7;
const ll INF = 1e16;
const ld PI = asin(1) * 2;

void setIO () {
    FAST_IO;
}

void setIO (string s) {
    setIO();
 	freopen((s+".in").c_str(),"r",stdin);
 	freopen((s+".out").c_str(),"w",stdout);
}



int main() {
    setIO();
	//setIO("lmio_1991_3e1_seka_01");

    int x; cin >> x;
    if (x >= 30) cout << "Yes\n";
    else cout << "No\n";

	return 0;
}


Measured memory_bytes: 3652
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)
		{
			var N = int.Parse(Console.ReadLine());
			var baseString = Console.ReadLine();

			var temp = baseString;
			var addL = new List<char>(N);
			var addR = new List<char>(N);
			for (int i = 0; i < N; i++)
			{
				temp = temp.Replace("()", "");
			}
			while (!(temp == "" || temp == "0"))
			{
				while (temp != "" && temp[0] == ')')
				{
					addL.Add('(');
					temp = temp.Remove(0, 1);
				}
				while (temp != "" && temp[temp.Length - 1] == '(')
				{
					addR.Add(')');
					temp = temp.Remove(temp.Length - 1, 1);
				}
			}
			for (int i = 0; i < addL.Count; i++)
			{
				Console.Write(addL[i]);
			}
			Console.Write(baseString);
			for (int i = 0; i < addR.Count; i++)
			{
				Console.Write(addR[i]);
			}
			Console.WriteLine();
		}
	}
}

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

int main() {
  int x, y, s;
  while (1) {
    scanf("%d%d%d", &x, &y, &s);
    if (x == 0) break;
    int m = 0;
    int before[1000], after[1000];
    for (int i = 1; i < s; i++) {
      before[i] = i * (100 + x) / 100;
      after[i] = i * (100 + y) / 100;
    }
    /*
    for (int i = s - 2; i > 0; i--) {
      if (before[i] == before[i+1]) after[i] = after[i+1];
    }
    for (int i = 1, j = s - 1; i <= j; i++) {
      while (before[i] + before[j] > s) j--;
      if (before[i] + before[j] == s) m = max(m, after[i] + after[j]);
    }
    */
    for (int i = 1; i < s; i++) {
      for (int j = 1; j < s; j++) {
        if (before[i] + before[j] == s) m = max(m, after[i] + after[j]);
      }
    }
    printf("%d\n", m);
  }
}



Measured memory_bytes: 2748
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7
const double PI = 3.14159265358979323846;


int main() {

	double N, a,b,x, D, X, H, W;
	char S[1000], T[1000];
	scanf("%lf%lf%lf", &a,&b,&x);


	

	
	double ans = 0;
	if (x <= a * a*b / 2) {
		printf("%f", 180*  atan(  (a*b*b) / (2 * x) ) / PI);
	}
	else {
		printf("%f", 180 * atan(2 * (b - x / (a*a)) / a) /PI);
	}


	





}



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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        "\n"
#define repp(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a,b) 	for(int i=a;i<=b;i++)
#define IOS         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int N=1e5 + 5;
const int M=1e9 + 7;

int32_t main()
{
	IOS;
	//memset(dp,-1,sizeof(dp));	
	int T;
	T = 1;
	while(T--)
	{
		int a,b;
		cin >> a >> b;
		cout << a*b;
	}
}


Measured memory_bytes: 3636
#define _USE_MATH_DEFINES

#include <iostream>	//cin, cout
#include <vector>	//vector
#include <algorithm> //sort,min,max,count
#include <string>	//string,getline
#include <ios>		//fixed
#include <iomanip>	//setprecision
#include <utility> //swap
#include <cstdlib>	//abs(int)
#include <cmath>	//sqrt
#include <sstream>	//stringstream,getline
#include <cmath>	//ceil,M_PI
#include <numeric>	//gcd

using namespace std;

int main() {

	int a, b, c;
	cin >> a >> b >> c;

	if (a + b + c >= 22) {
		cout << "bust" << endl;
	}
	else {
		cout << "win" << endl;
	}

	return 0;

}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int l, r, d;
    cin >> l >> r >> d;
    int res = 0;
    for (int i = l; i <= r; i++) if (i % d == 0) res++;
    cout << res << endl;
    return 0;
}

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

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

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

void solve(){
	int s, w;
	cin>>s>>w;
	if(w>=s)
		cout<<"unsafe"<<endl;
	else
		cout<<"safe"<<endl;
}

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

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

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

    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A.at(i);
    }

    vector<int> V;
    int right = 0;
    for (int left = 0; left < N;) {
        while (right < N && A.at(right) == (A.at(left) + right - left) % 2) {
            right++;
        }
        V.push_back(right - left);
        left = right;
    }

    int ans = 0;
    for (int i = 0; i < V.size(); ++i) {
        int res = V.at(i);
        if (i >= 1) res += V.at(i - 1);
        if (i >= 2) res += V.at(i - 2);
        ans = max(ans, res);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3436
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

void solve() {
  string s;
  cin >> s;
  int n = s.size();
  bool b1 = true;
  if (s[0] != 'A') b1 = false;

  int cnt1 = 0;
  for (int i = 2; i <= n - 2; i++) {
    if (s[i] == 'C') cnt1++;
  }
  bool b2 = false;
  if (cnt1 == 1) b2 = true;

  int cnt2 = 0;
  rep(i,n) {
    if (s[i] - 'A' >= 0 && s[i] - 'A' < 26) cnt2++;
  }
  bool b3 = false;
  if (cnt2 == 2) b3 = true;

  cout << ((b1 && b2 && b3)? "AC": "WA") << endl;
}

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

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define loop(i, a, b) for(lli i=a; i<b; i++)
#define loopb(i, a, b) for(lli i=a; i>=b; i--)
#define pb push_back
#define umap unordered_map
typedef long long int lli;
typedef pair<lli, lli> pii;
typedef vector<lli> vll;
// use to avoid collision
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
// for pair in unordered_map
struct hash_pair {
    static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
	}
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const{
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        uint64_t x = hash1 ^ hash2;
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
lli M = 1e9 + 7;
lli power(lli x, lli y){
    lli res = 1;
    x = x;
    while (y > 0) {
        if (y & 1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}
lli solve(){
	lli h;
	cin>>h;
	if(h == 1){
		cout<<1<<"\n";
		return 0;
	}
	lli ans = 0;
	lli step = 0;
	while(h > 1){
		h = h/2;
		ans = ans + power(2, step);
		step++;
	}
	ans = ans*2 + 1;
	cout<<ans<<"\n";
	return 0;
}
int main(){
	fastio;
	lli t;
	// cin>>t;
	t = 1;
	while(t>0){
		t--;
		solve();
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int M = sc.nextInt();
	System.out.println();
	int[] A = new int[N];
	int total = 0;
	for(int i = 0; i < N; i++){
	    A[i] = sc.nextInt();
	    total += A[i];
	}

	int L = 0;
	for(int i = 0; i < N; i++){
	    int comp = A[i]*4*M;
	    if(total <= comp){
		L++;
	    }
	}

	String ans = "No";
	if(M <= L){
	    ans = "Yes";
	}

	System.out.println(ans);

    }
}


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

namespace ABC131
{
    class A
    {
        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            string r = "Good";
            for(int i = 1; i < 4; i++)
            {
                if (S[i] == S[i - 1])
                {
                    r = "Bad";
                }
            }
            Console.WriteLine(r);
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
   int n;
   long long int a[10001]={0};
   cin>>n;
   for(int i=0;i<n;i++){
       cin>>a[i];
   }
   long long min=1000000,max=-1000000,sum=0;
   for(int i=0;i<n;i++){
       if(a[i]<min){
           min=a[i];
        }
        if(a[i]>max){
           max=a[i];
       }
       sum=sum+a[i];
   }

    
    

    cout <<min<<" "<<max<<" "<<sum<<endl;
 

}


Measured memory_bytes: 3156
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;

int main(){
    int n;
    ll a,b,c;
    cin >> n >> a >> b >> c;
    vector<string> s(n);
    rep(i,n) cin >> s[i];
    bool ok = true;
    vector<char> ans;
    rep(i,n){
        if(s[i] == "AB"){
            if(a==b){
                if(i<n-1){
                    if(s[i+1] == "AC"){
                        ++a;--b;ans.push_back('A');
                    }else{
                        --a;++b;ans.push_back('B');
                    }
                }else{
                    ++a;--b;ans.push_back('A');
                }
            }else if(a>b){
                ++b;--a;ans.push_back('B');
            }else{
                ++a;--b;ans.push_back('A');
            }
        }else if(s[i] == "AC"){
            if(a==c){
                if(i<n-1){
                    if(s[i+1] == "AB"){
                        ++a;--c;ans.push_back('A');
                    }else{
                        --a;++c;ans.push_back('C');
                    }
                }else{
                    --a;++c;ans.push_back('C');
                }
            }else if(a>c){
                ++c;--a;ans.push_back('C');
            }else{
                ++a;--c;ans.push_back('A');
            }
        }else{
            if(b==c){
                if(i<n-1){
                    if(s[i+1] == "AB"){
                        ++b;--c;ans.push_back('B');
                    }else{
                        --b;++c;ans.push_back('C');
                    }
                }else{
                    --b;++c;ans.push_back('C');
                }
            }else if(b>c){
                ++c;--b;ans.push_back('C');
            }else{
                ++b;--c;ans.push_back('B');
            }
        }
        if(a < 0 || b < 0 || c < 0) ok = false;
    }
    if(ok){
        cout << "Yes" << endl;
        rep(i,ans.size()) cout << ans[i] << '\n';
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 6728
import java.util.*;
import java.lang.*;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int x = s.nextInt();

		int nfh = x/500;
		int f = (x%500)/5;

		System.out.println(1000*nfh+5*f); 
	}

 }

	

Measured memory_bytes: 22228
import java.util.Scanner;
     
class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        
        System.out.println(calc(S));
        
    }
    
    public static int calc(String S) {
    	String[] s = S.split("");
    	int count = 0;
    	for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        }
    	return count;
    }
}

Measured memory_bytes: 21844
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static HashMap<Character, Integer> map = new HashMap<Character,Integer>();

	static void solve() {

		String s = in.next();
		int ans = 0;

		for (int i=0; i<s.length(); i++) {
			if (i == s.length()-1 || map.get(s.charAt(i)) >= map.get(s.charAt(i+1))) {
				ans += map.get(s.charAt(i));
			} else {
				ans -= map.get(s.charAt(i));
			}
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		map.put('I',1);
		map.put('V',5);
		map.put('X',10);
		map.put('L',50);
		map.put('C',100);
		map.put('D',500);
		map.put('M',1000);

		while (in.hasNext()) solve();
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

template<typename T> void ckmin(T& a, const T& b) { a = min(a, b); }
template<typename T> void ckmax(T& a, const T& b) { a = max(a, b); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll get(ll A, ll B, ll V) {
    return B / V - (A - 1) / V;
}

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

    ll A, B, C, D;
    cin >> A >> B >> C >> D;

    cout << (B - A + 1)
        - get(A, B, C)
        - get(A, B, D)
        + get(A, B, C * D / __gcd(C, D)) << endl;

    return 0;
}



Measured memory_bytes: 256
<?php
define('VECTOR_B_COL_NUMBER',0);
$array_nums = preg_split("/[\s,]+/",trim(fgets(STDIN)));

for ($i = 0;$i < count($array_nums) ;$i++) {
    $array_nums[$i] = intval($array_nums[$i]);
}

$col = $array_nums[0];
$row = $array_nums[1];

for ($i = 0; $i < $col; $i++){
    $vect_a[$i] = preg_split("/[\s,]+/",trim(fgets(STDIN)));
    for ($j = 0; $j < $row; $j++) {
        $vect_a[$i][$j]=intval($vect_a[$i][$j]);
    }
}

for ($k = 0; $k < $row; $k++) {
    $vect_b[$k]=intval(trim(fgets(STDIN)));
}

for ($l = 0; $l < $col; $l++) {
	$ans = 0;
	for ($m = 0; $m < $row; $m++) {
		$ans += $vect_a[$l][$m] * $vect_b[$m];
	}
	echo $ans,PHP_EOL;
}

Measured memory_bytes: 16744
#include <bits/stdc++.h>
#include <algorithm>  
#include <unordered_set>
#define ll long long

using namespace std;

map<ll, ll> occur;

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll n;
	cin >> n;

	ll ans = 0;
	for (ll i = 2; i * i <= n; i++) {

		ll eachVal = 0;
		while (n % i == 0) {
			eachVal++;
			n /= i;
		}

		ll cnt = 1;

		while (eachVal >= cnt) {
			ans++;
			eachVal -= cnt;
			cnt++;
		}
	}

	if (n > 1) { ans++; }
	cout << ans << endl;



	
	return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)


int main(){
    ll kai = 1;
    int N,K;
    cin >> N >> K;

    for(int i = 0;i < N;i++){
        if(kai * 2 <= kai + K)
            kai *= 2;
        else
            kai += K;
    }

    cout << kai << endl;

}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second


void solve()
{
     int n;cin>>n;
     vector<int>a(n);REP(i,n)cin>>a[i];
     sort(ALL(a));
     cout<<a[n-1]-a[0]<<endl;
}

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

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MK make_pair
#define REP(i, a, b) for (int i=a; i < b; i++)


bool sort_by(pi c, pi d){
	return c.S < d.S;
}

int main() {
	int n, m;
	cin >> n >> m;
	int arr[n] = {-1};
	REP(i, 0, n) arr[i] = -1;
	int s, c;
	REP(i, 0, m){
		cin >> s >> c;
		if(arr[s-1] == -1 || arr[s-1] == c) arr[s-1] = c;
		else{
			cout << -1;
			exit(0);
		}
	}
	if(n == 1) cout << (arr[0]==-1? 0:arr[0]);
	else{
		REP(i, 0, n){
			if(i == 0 && arr[i] == -1) cout << 1;
			else if(i == 0 && arr[i] == 0){
				cout << -1;
				exit(0);
			}
			else cout << (arr[i]==-1? 0:arr[i]);
		}
	}
}


Measured memory_bytes: 256
n = int(input())
c = []
for i in range(n):
    A, B = map(int, input().split())
    c.append([A, B, A+B])

c.sort(reverse=True, key=lambda x: x[2])

takahashi = 0
aoki = 0

for i, (a, b, s) in enumerate(c):
    if i % 2 == 0:
        takahashi += a
    else:
        aoki += b

print(takahashi - aoki)

Measured memory_bytes: 24408
#include<bits/stdc++.h>
#define maxn 100005
#define inf 1e18L + 5
#define ll long long
#define MOD 1000000007
using namespace std;

ll arr[21][21];
ll dp[21][1<<21]; // for ith man considered , j gives the mask
ll n;

ll solve(ll pos, ll mask){
    if(pos == n && mask == ((1<<n) -1)) return 1;
    if(pos>=n) return 0;
    if(dp[pos][mask]!=-1) return dp[pos][mask];
    ll res = 0;
    for(ll i = 0; i < n; i++){
        ll k = arr[pos][i];
        if(k && !(mask&(1<<i))){
            res += solve(pos+1,mask|(1<<i));
            res %= MOD;
        }
    }
    //cout << pos << " " << res <<  endl ;
    return dp[pos][mask] = res;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    memset(arr, 0, sizeof(arr));
    for(ll i =0;i<n;i++){
        for(ll j =0;j<n;j++){
            cin>> arr[i][j];
        }
    }
    memset(dp,-1, sizeof(dp));
    cout << solve(0, 0) << endl;
}


Measured memory_bytes: 344320
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mod 1000000007
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(arr) arr.begin() , arr.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i , a , n) for(int i = a ; i < n ; i++)
#define rrep(i , n , a) for (int i = n - 1 ; i >= a ; i--)
#define ms(arr , val) memset(arr , val , sizeof(arr))
#define siz(temp) temp.size()
#define len(temp) temp.length()
#define timepass 1073741824
#define int ll

signed main()
{
    int n;
    int k;
    cin >> n >> k;
    vector<int> arr(n , 0);
    rep(i , 0 , n)
        cin >> arr[i];
    ll dp[n + 1];
    ms(dp , 0);
    dp[1] = abs(arr[1] - arr[0]);
    for (int i = 1 ; i < n ; i++)
    {
        dp[i] = dp[i - 1] + abs(arr[i] - arr[i - 1]);
        for (int j = i - 2 ; j >= max(i - k , (ll)0) ; j--)
            dp[i] = min(dp[i] , dp[j] + abs(arr[i] - arr[j]));
    }
    cout << dp[n - 1] << endl;
    return 0;
}

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


int main(){
    int N, A, B;
    cin >> N >> A >> B;
    int cn1 = 0, cn2 = 0, cn3 = 0;
    rep(i,N){
        int p;
        cin >> p;
        if(p<=A) cn1++;
        else if(p <= B) cn2++;
        else cn3++;
    }

    cout << min(cn1, min(cn2,cn3)) << endl;
}   

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

typedef double db;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef complex<double> com;

#define MOD 1000000007
#define PI 3.14159265359
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define unique_sort(x) (sort(x.begin(), x.end()), x.resize(distance(x.begin(), unique(x.begin(), x.end()))))
#define fast_io() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define dbg(x) cout << #x << " = " << x << '\n'
#define dbg2(x,y) cout<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;

void test()
{
	int n;
	cin>>n;

	vector<int> v(n+1,0);

	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=n;j+=i)
		{
			v[j]++;
		}
	}

	ll total = 0;

	for(ll i=1;i<=n;i++)
		total += (i*(ll)v[i]);

	cout<<total;
}

int main()
{   
fast_io();
cout << fixed << setprecision(15);
int t = 1;

//cin>>t;

for(int i = 0; i < t; i++)
{
	test();
}
return 0;
}

Measured memory_bytes: 42276
import numpy as np
import sys 
read = sys.stdin.readline
n = int(input())
a = np.fromstring(read(), dtype=np.int32, sep=' ')
b = np.fromstring(read(), dtype=np.int32, sep=' ')[::-1]

kokan = []
same = -1
for i in range(n):
    if a[i] == b[i]:
        same = a[i]
if same == -1:
    print('Yes')
    print(*b)
    exit()

for i in range(n):
    if a[i] != b[i] and a[i] != same and b[i] != same:
        kokan.append(i)
for i in range(n):
    if a[i] == b[i]:
        if len(kokan) == 0:
            print('No')
            exit()
        else:
            j = kokan[-1]
            b[i], b[j] = b[j], b[i] 
            kokan.pop()
print('Yes')
print(*b)

Measured memory_bytes: 45428
#include <sstream>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<ctime>
#include<cmath>
#include<map>
#include<unordered_map>
#include<stack>
#include<random>
#include<queue>
#include<list>
#include<math.h>
#include<bitset>
#include<fstream>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < int(n); i++)
const ll INF=9223372036854775807;
const ll mod=998244353;
int  MOD(int  a, int  b)
{
    if(a>b)
        return a-b;
    else
        return b-a;
}
ll  max3(ll  a,ll  b, ll  c)
{
    return max(c,max(a,b));
}
ll min3(ll  a,ll  b,ll  c)
{
    return min(a,min(b,c));
}
ll  power(ll  x,ll  y,ll mod1)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%mod1;
        y = y>>1;
        x = (x*x)%mod1;
    }
    return res;
}
ll logg(ll  a)
{
    ll  x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
}
ll  gcd(ll  a,ll   b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll abso(ll x)
{
    if(x<0)
    {
        return -x;
    }
    return x;
}
ll ceiling (ll  a,ll  b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
ll modinv(ll x,ll p)
{
    return power(x,p-2,p);
}
int main()
{
    fastio;
    int a,b,c;
    cin>>a>>b>>c;
    if(a+b+c>=22)
    {
        cout<<"bust"<<endl;
    }
    else
    {
        cout<<"win"<<endl;
    }
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <cmath>
#include <iomanip>
#include <set>
#include <climits>
#include <utility>
#include <deque>
using namespace std;



int main()
{
	int n, k;
	cin >> n >> k;
	deque<int> jdqOrig(n), jdq;
	for (auto& j : jdqOrig)cin >> j;
	
	auto maxNum = 0LL, num = 0LL;
	vector<deque<int>> jdqStates;

	multiset<int> havingStates;
	for (int turn = 1; turn <= k; ++turn) {
		// take until 'turn', and push

		for (int fl = 0; fl <= turn; ++fl) {
			jdq.clear();
			havingStates.clear();
			copy(jdqOrig.begin(), jdqOrig.end(), back_inserter(jdq));
			num = 0LL;

			// take 'fl' from left
			for (int i = 0; i < fl; ++i) {
				if (jdq.empty())break;
				havingStates.insert(jdq.front());
				jdq.pop_front();
			}
			for (int i = fl; i < turn; ++i) {
				if (jdq.empty())break;
				havingStates.insert(jdq.back());
				jdq.pop_back();
			}

			for (int p = turn; p < k; ++p) {
				// push
				if (havingStates.empty())break;
				if (*havingStates.begin() < 0) {
					havingStates.erase(havingStates.begin(), (++havingStates.begin()));
				}
			}

			for (auto& hs : havingStates)num += hs;
			if (num > maxNum) {maxNum = num;}
		}
	}

	cout << maxNum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const int mod = 1e9 + 7;
//const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}


int main() {
  string s,t;
  cin >> s >> t;
  int n=s.size();
  bool ok=true;
  rep(i,n) {
      if(s[i]!=t[i]) ok=false;
  }
  YesNo(ok);
  return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
#define mxn 1000010
#define LL long long
using namespace std;
const int mod=1e9+7;
int n,D,H,sl,fh,dp[mxn];
LL W,S,fac[mxn];
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
void upd(LL &x,LL y) {x+=y; if(x>=mod) x-=mod;}
int main()
{
	n=rd();H=rd();D=rd();fac[0]=1;
	for(int i=1;i<=n;++i) fac[i]=i*fac[i-1]%mod,upd(W,fac[i]);
	dp[0]=1;S=1;
	for(int i=1;i<=H;++i)
	{
		if(i-D-1>=0) upd(S,mod-dp[i-D-1]);
		if(i<H) dp[i]=S*W%mod; else dp[i]=S;
		upd(S,dp[i]);
	}
	printf("%lld\n",dp[H]*fac[n]%mod);
	return 0;
}

Measured memory_bytes: 11904
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = (1e9)+7;


int mem[51][51][51][51],used[51][51][51][51];

ll dfs(int a,int t,int g,int c,vector<string>&A,int idx=0){

  if(a<0||t<0||g<0||c<0) return 0;
  if(idx==(int)A.size()) return !a&&!t&&!g&&!c;  
  if(used[a][t][g][c]++)return mem[a][t][g][c];

  int res = 0;  
  string &s = A[idx];
   for(int i=0;i<(int)s.size();i++){
    int na=a,nt=t,ng=g,nc=c;
    if(s[i] == 'A')na--;
    if(s[i] == 'T')nt--;
    if(s[i] == 'G')ng--;
    if(s[i] == 'C')nc--;
    res=(res+dfs(na,nt,ng,nc,A,idx+1))%mod;
  }
  return mem[a][t][g][c] = res;
}
  


string getString(string &a,int &j){
  string res;
  while(isalpha(a[j])) res+=a[j++];
  return res;
}

int main(){
  int a,t,g,c;
  cin>>a>>t>>g>>c;
  int n;
  cin>>n;
  cin.ignore();  
  vector<string> A(n);  
  for(int i=0;i<n;i++)getline(cin,A[i]);


  vector<string> DNA[50];
  map<string,int> Idx;
  for(int i=n-1;i>=0;i--){
    int j = 0;
    string &a = A[i],name=getString(a,j);
    Idx[name] = i;
    assert(a[j] == ':');
    j++;
    while(j<a.size()&&DNA[i].size()<=200){
      assert(a[j++] == ' ');
      if(a[j] == '[')DNA[i].push_back(getString(a,++j)),j++;
      else {
	vector<string> &v =DNA[Idx[getString(a,j)]];
	for(int k=0;k<v.size();k++)DNA[i].push_back(v[k]);
      }
    }
  }

  ll ans = 0;
  for(int i=0;i<n;i++){
    if(DNA[i].size()>200)continue;
    memset(used,0,sizeof(used));
    ans =(ans+dfs(a,t,g,c,DNA[i]))%mod;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 55672
#include<iostream>

using namespace std;

int main(void) {
	int n;
	int a[101];
	int maxi = -1;

	cin >> n;

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

	for (int i = 1; i < n; i++) {
		for (int j = i + 1; j <= n; j++) {
			if (abs(a[i] - a[j]) > maxi) {
				maxi = abs(a[i] - a[j]);
			}
		}
	}

	cout << maxi << endl;

	return 0;
}

Measured memory_bytes: 256