akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
import java.util.*;
class Main{
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int c = saori.saori_hayami();

		int count = 0;

		if(a==b){
			count++;
		}
		if(a==c){
			count++;
		}
		if(c==b){
			count++;
		}

		if(count == 1){
			System.out.println("Yes");
		} else{
			System.out.println("No");
		}
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 21204
#include <iostream>
#include <string>
#include <list>
#include <algorithm>

using namespace std;

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

    list<string> s;
    for(int i=0;i<n;i++){
        string x;
        cin >> x;
        s.push_back(x);
    }

    s.sort();
    s.unique();
    cout << s.size() << endl;

    return 0;
}


Measured memory_bytes: 12564
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <utility>

using namespace std;

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

int main()
{
	vector<int> v;
	int a,d,k;

	REP(i,5){
		cin >> a;
		v.push_back(a);
	}

	cin >> k;

	sort(v.begin(),v.end());
	d = abs(v[0]-v[4]);

	if(d>k)cout << ":(" << endl;
	else cout << "Yay!" << endl;

	return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

fn read_n<T: FromStr>(n: usize) -> Vec<T> {
  read_n_logic::<T>(n, vec![])
}

fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
  match n {
    0 => a,
    _ => {
      a.push(read::<T>());
      read_n_logic(n - 1, a)
    }
  }
}

fn main() {
  let n = read::<usize>();
  let mut v = read_n::<f64>(n);

  v.sort_by(|a, b| b.partial_cmp(a).unwrap());

  while v.len() > 1 {
    let x = v.pop().unwrap();
    let y = v.pop().unwrap();
    let item = (x + y) / 2.0;
    v.push(item);
    v.sort_by(|a, b| b.partial_cmp(a).unwrap());
  }

  println!("{}", v[0]);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

int main() {
	string s; cin >> s;
	LL n = s.length();
	string ans = "Yes";
	rep(i, 1, n+1) {
		if(i%2 == 1 && s[i-1] == 'L')	ans = "No";
		if(i%2 == 0 && s[i-1] == 'R')	ans = "No";
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
// 1202
// --------------------------------------------------------------------------------
#define fastio	ios_base::sync_with_stio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long 
#define mset(arr,val) memset(arr,val,sizeof(arr))
#define deb(name,value) cout <<"->>  "<<name<< "= " <<value<<" "
#define frepi(a,b,k) for(int i=a;i<=b;i+=k)
#define frepj(a,b,k) for(int j=a;j<=b;j+=k)
// --------------------------------------------------------------------------------
 
int gcd(int a,int b)
{
	if(a==0)
		return b;
	return gcd(b%a,a);
}
 
void solve_main()
{
    int k;cin>>k;
    ll ans = 0;
    for(int i=1;i<=k;++i)
    {
    	for(int j=1;j<=k;++j)
    	{
    		int x = gcd(i,j);
    		for(int z=1;z<=k;++z)
    		{
    			ans+=(gcd(x,z));
    		}
    	}
    }
    cout<<ans;
 
}
 
int main()
{
	// #ifndef ONLINE_JUDGE
 //    	freopen("/home/suryakant/input.txt","r",stdin);
 //        freopen("/home/suryakant/output.txt","w",stdout);
 //    #endif
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve_main();
    }
    
}

Measured memory_bytes: 3564
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

const ll MOD = ll(1e9) + 7;
const ll INF = LLONG_MAX;
const ll MAX_N = 1 << 12;
const double EPS = 10e-8;
const double PI = 3.14159265359;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)

int main() {
    ll n,k,ans = 1;
    cin >> n >> k;
    REP(i,n-1){
        ans += (ans-1)/(k-1)+1;
    }
    cout << ans-1 << endl;
    return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
using P = pair<ll, ll>;
int main(){
    ll n, d;
    cin >> n >> d;
    ll ans = 0;
    for(int i = 0; i < n; i++){
       ll x, y;
       cin >> x >> y;
       if(x * x + y * y <= d * d) ans++;
    }
    cout << ans;
}

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

#define NL '\n'
#define C char
#define D double
#define F float
#define S string
#define sz(x) x.size()
#define INF LONG_LONG_MAX
#define PI (2.0*acos(0.0))
#define sfi(x) scanf("%d",&x)
#define sfi2(x,y) scanf("%d %d",&x,&y)
#define sfi3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sfl(x) scanf("%lld",&x)
#define sfl2(x,y) scanf("%lld %lld",&x,&y)
#define sfl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sfd(x) scanf("%lf",&x);
#define max3(a,b,c) max(a,max(b,c))
#define max4(a,b,c,d) max(max3(a,b,c),d)
#define min3(a,b,c) min(a,min(b,c))
#define min4(a,b,c,d) min(a,min3(b,c,d))
#define mem(ara,val) memset(ara,val,sizeof(ara))
#define READ freopen("input.txt","r",stdin)
#define WRITE freopen("output.txt","w",stdout)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

/*LL gcd(LL a,LL b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}*/
/*LL lcm(LL a,LL b)
{
    return a/gcd(a,b)*b;
}*/

int main()
{
    int a,b;
    cin>>a>>b;
    if(a==b)
        cout<<"Yes";
    else
        cout<<"No";
}


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

signed main(){
	int n; cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	vector<int> b = a;
	sort(b.begin(), b.end());
	int ans = 0;
	rep(i, n) if(a[i] != b[i]) ans++;
	if(ans <= 2) cout << "YES" << endl;
	else cout << "NO" << endl;
}

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

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int eval(int x, int n) {
	if(n%2) return min(abs(x-n/2),abs(n-x-n/2));
	else return abs(x-n/2);
}

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int n; cin>>n;
	vector<int> a(n);
	for (int i=0; i<n; i++)
		cin>>a[i];
	sort(a.rbegin(),a.rend());
	int x=a[0], ret=INT_MAX, y=-1;
	for (int i=1; i<n; i++) {
		int cur=eval(a[i],x);
		if(ret>cur) ret=cur, y=a[i];
	}
	cout<<x<<" "<<y<<"\n";
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>          // printf(), scanf()

int
main(int argc, char** argv)
{
	int min, max;
	long sum;

	int n;
	scanf("%d", &n);

	sum = 0;
	int i;
	for (i = 0; i < n; ++i)
	{
		int x;
		scanf("%d", &x);
		sum += x;
		if (i == 0 || x < min)
			min = x;

		if (i == 0 || x > max)
			max = x;
	}

	printf("%d %d %ld\n", min, max, sum);
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
using namespace std;
int main() {
    string s; cin >> s;
    if (s.size() % 2) cout << "No\n";
    else {
        for (int i = 0; i < s.size(); i++)
            if (s[i] != "hi"[i%2]) { cout << "No\n"; return 0; }
        cout << "Yes\n";
    }
}


Measured memory_bytes: 256
#include <stdio.h>

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  unsigned long long int res = 0
                       , n
                       , i;

  scanf ( "%llu", &n );
  for ( i = 0; i < n; ++i )
  {
    unsigned long long int d;

    scanf ( "%llu", &d );
    res += d;
  }

  printf ( "%llu\n", res / n );

  return ( 0 );
}

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

int main(){
  int N;
  cin>>N;
  vector<int> H(N);
  for(int i=0;i<N;i++){
    cin>>H.at(i);
  }
  int ans=0;
  int num=0;
  for(int i=0;i<N-1;i++){
    if(H.at(i)>=H.at(i+1)){
      num++;
    }
    if(H.at(i)<H.at(i+1)||i==N-2){
      ans=max(ans,num);
      num=0;
    }
  }
  cout<<ans<<endl;
}


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

using namespace std;
using ll = long long;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()

#define READ(x) (cin >> (x))

#define WRITE_N(x) (cout << (x) << endl)
#define WRITE(x) (cout << (x))

int main() {
    // get values from input
    ll N, K;
    cin >> N >> K;
    
    // main procedure
    ll ans, r, x;
    
    r = N % K;
    x = K - r;
    ans = min(r, x);
    // output
    WRITE_N(ans);

    return 0;
}

Measured memory_bytes: 256
#include <string.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <istream>
#define INF 2147483647
#define LLINF 9223372036854775807
typedef long long ll;
using namespace std;
int a[1050][1050];
int lastday[1050];
int stake[1050];
int main(){
	memset(lastday,0,sizeof(lastday));
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		stake[i]=1;
		for(int j=1;j<n;j++){
			cin>>a[i][j];
		}
	}
	int days=0;
	int over=0;
	while(1){
		days++;
		bool flag=0;
		for(int i=1;i<=n;i++){
			if(lastday[i]==days)continue;
			int j=a[i][stake[i]];
			if(lastday[j]==days||!j)continue;
			int r=stake[i],l=stake[j];
			if(stake[i]<n&&stake[j]<n&&a[j][l]==i){
				stake[i]=r+1,stake[j]=l+1;
				lastday[i]=days,lastday[j]=days;
				flag=1;
				over++;
			}
		}
		if(!flag){
			days--;
			break;
		}
	}
	if(over!=n*(n-1)/2)cout<<-1<<endl;
	else cout<<days<<endl;
	return 0;
}

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

#define F                   first
#define S                   second
#define int                 long long int
#define pb                  push_back
#define mp                  make_pair
#define pii                 pair<int,int>
#define vi                  vector<int>
#define mii                 map<int,int>
#define pqb                 priority_queue<int>
#define pqs                 priority_queue<int,vi,greater<int> >
#define mod                 1000000007
#define endl                '\n'
#define rep(i,a,b)            for(int i=a;i<b;i++)
void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int32_t main()
{
    c_p_c();
    int n;
    cin >> n;
    int a[n];
    rep(i, 0, n) {
        cin >> a[i];
    }
    vi dp(n + 1, 0);
    dp[0] = 0;
    dp[1] = abs(a[1] - a[0]);
    for (int i = 2; i < n; i++) {
        dp[i] = min(abs(a[i - 1] - a[i]) + dp[i - 1], abs(a[i - 2] - a[i]) + dp[i - 2]);
    }

    cout << dp[n - 1] << endl;

    return 0;
}

Measured memory_bytes: 4780
#include <stdio.h>
#include <string.h>
int A[10],B[10];
int Search(int num,int ans,int n);
int main(void){
	int i,j,n,m,d;
	char str[100],*line;

	fgets(str,sizeof(str),stdin);
	line = strtok(str," ");
	sscanf(line,"%d",&n); A[1]=n;
	for(i=2;i<=6;i++){
		line = strtok(NULL," ");
		sscanf(line,"%d",&n); A[i]=n;
	}
	fgets(str,sizeof(str),stdin);
	sscanf(str,"%d",&d);
	for(i=0;i<d;i++){
		fgets(str,sizeof(str),stdin);
		sscanf(str,"%d %d",&n,&m);
		for(j=1;j<=6;j++)
			B[j] = A[j];
		Search(1,2,n);
		Search(1,3,n);
		Search(2,3,m);
		printf("%d\n",B[3]);
	}
	return 0;
}			
			
int Search(int num,int ans,int n){
	int tmp,i;
	for(i=0;i<10;i++){
		if(B[num]==n)
			return 0;
		tmp = B[num];
		B[num] = B[ans];
		B[ans] = B[7-num];
		B[7-num] = B[7-ans];
		B[7-ans] = tmp;
	}
	return 0;
}

Measured memory_bytes: 604
#include "bits/stdc++.h"
using namespace std;

#define fi first
#define se second
#define pb push_back
#define int long long
#define all(x) (x).begin(), (x).end()

using LL = long long;
using LD = long double;
using pii = pair<int, int>;
using vii = vector<pii>;

const int INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;

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

	int n;
	cin >> n;

	cout << n * (n - 1) / 2 << "\n";

    return 0;
}


Measured memory_bytes: 256
N = gets.to_i
t, x, y = 0, 0, 0
N.times{
    T, X, Y = gets.split.map(&:to_i)
    a = (x - X).abs + (y - Y).abs
    b = T - t
    if b < a || (a - b) % 2 != 0 then
        puts 'No'; exit
    end
    t, x, y = T, X, Y
}
puts 'Yes'

Measured memory_bytes: 2044
#include <stdio.h>

int main(void){
	int all;
	int hour;
	int min;
	int sec;
	
	scanf("%d", &all);
	hour = all/3600;
	min = (all%3600)/60;
	sec = (all%3600)%60;
	printf("%d:%d:%d\n", hour, min, sec);
    return 0;
}

Measured memory_bytes: 2744
#include <bits/stdc++.h>
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--)

#define SIZE(x) ((ll)(x).size()) 
#define MAX(x) *max_element(ALL(x)) 
#define MIN(x) *min_element(ALL(x)) 
#define ALL(x) (x).begin(),(x).end() 

#define inf 1000000000000 
#define mod 1000000007 
#define MAXR 100000 

#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 

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;}
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
    // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
bool is_prime(ll n){
    int a = sqrt(n);
    if(n == 1 || n == 2 || n == 3) return true;
    else{
        bool frag = true;
        FOR(i, 2, a+1){
            if(n % i == 0) frag = false;
        }
        return frag;
    }
}

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int l, ans, n;
    cin >> n;
    ans = 0;
    FOR(i, 1, n){
        ans += (n-1) / i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3656
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

//連続した白黒のグループの個数-1
//O(N)

int main(void){
    string s;
    cin>>s;
    char now = s[0];
    int ans = 1;
    FOR(i, 1, s.length()){
        if(s[i]==now) continue;
        now = s[i];
        ans++;
    }
    cout << ans - 1 << endl;
}

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

int main()
{

	int D;

	cin >> D ;

	if (D == 25) {
		cout << "Christmas" << endl;
	}

	else if (D == 24) {
		cout << "Christmas Eve" << endl;
	}

	else if (D == 23) {
		cout << "Christmas Eve Eve" << endl;
	}

	else if (D == 22) {
		cout << "Christmas Eve Eve Eve" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main(){
	int kami[14][14],x,y,size,i,j,max,siro;
	memset(kami,0,sizeof(kami));
	
	while(0<=scanf("%d,%d,%d",&x,&y,&size)){
		if(size==1){
			kami[x+1][y+2]+=1;
			kami[x+2][y+1]+=1;
			kami[x+2][y+2]+=1;
			kami[x+2][y+3]+=1;
			kami[x+3][y+2]+=1;
		}else if(size==2){
			kami[x+1][y+1]+=1;
			kami[x+1][y+2]+=1;
			kami[x+1][y+3]+=1;
			kami[x+2][y+1]+=1;
			kami[x+2][y+2]+=1;
			kami[x+2][y+3]+=1;
			kami[x+3][y+1]+=1;
			kami[x+3][y+2]+=1;
			kami[x+3][y+3]+=1;
		}else if(size==3){
			kami[x][y+2]+=1;
			kami[x+1][y+1]+=1;
			kami[x+1][y+2]+=1;
			kami[x+1][y+3]+=1;
			kami[x+2][y]+=1;
			kami[x+2][y+1]+=1;
			kami[x+2][y+2]+=1;
			kami[x+2][y+3]+=1;
			kami[x+2][y+4]+=1;
			kami[x+3][y+1]+=1;
			kami[x+3][y+2]+=1;
			kami[x+3][y+3]+=1;
			kami[x+4][y+2]+=1;
		}
		
	}
	max=0;
	siro=0;
	
	for(i=2;i<12;i++){
		for(j=2;j<12;j++){
			if(kami[i][j]==0)++siro;
			if(max<kami[i][j])max=kami[i][j];
		}
	}
	printf("%d\n%d\n",siro,max);
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>

#define ll long long
#define ull unsigned long long

using namespace std;

typedef pair<string, int> P;

int main() {
	int N;
	cin >> N;
	vector <string> S(N, "");
	vector <string> dummyS(N, "");
	vector <int> Q(N, 0);
	// vector <P> baka;
	for (int ii = 0; ii < N; ++ii){
		cin >> S[ii] >> Q[ii];
		dummyS[ii] = S[ii];
		// baka.push_back(P(S[ii], Q[ii]));
	}
	// sort(baka.begin(), baka.end());

	sort(dummyS.begin(), dummyS.end());

	vector <string> sortedS;
	string store = dummyS[0];
	sortedS.push_back(store);
	for (int ii = 1; ii < N; ++ii){
		string hoge = dummyS[ii];
		if (store != hoge){
			sortedS.push_back(hoge);
			store = hoge;
		}
	}

	for (int ii = 0; ii < sortedS.size(); ++ii){
		string key = sortedS[ii];
		vector <int> value;
		for (int jj = 0; jj < N; ++jj){
			if (S[jj] == key){
				value.push_back(Q[jj]);
			}
		}
		sort(value.rbegin(), value.rend());

		for (int jj = 0; jj < value.size(); ++jj){
			for (int kk = 0; kk < N; ++kk){
				if (S[kk] == key){
					if (Q[kk] == value[jj]){
						cout << kk + 1 << endl;
					}
				}
			}
		}
	}

	return 0;
}



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

int main() {
    int a = 0, b = 0, c = 0, k = 0;
    cin >> a >> b >> c >> k;

    int ans = 0;
    if (k <= a) {
        ans += k;
        cout << ans << endl;
        return 0;
    }

    ans += a;
    k -= a;

    if (k <= b) {
        cout << ans << endl;
        return 0;
    }

    k -= b;

    if (k <= c) {
        ans -= k;
        cout << ans << endl;
        return 0;
    }

    ans -= c;
    k -= c;
    cout << ans << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define N 200005
using namespace std;
vector<int> v[N];
int n,m;

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1,l,r;i<=n;i++) scanf("%d%d",&l,&r),v[l].push_back(r);
	priority_queue<int,vector<int>,greater<int> > pq,pq2;
	
	int num=0;
	for(int i=0,cnt=0;i<=m;i++){
		if(i!=0) cnt++;
		for(auto x:v[i]){
			pq.push(x);
			if(cnt!=0) num++,cnt--;
			else pq2.push(m+1-pq.top()),pq.pop();
		}
	}
	int ans=0;
	for(int i=0,cnt=0;i<=m-num;i++){
		while(!pq2.empty()&&pq2.top()<i) ans++,pq2.pop();
		if(i!=0&&!pq2.empty()) pq2.pop();
	}
	cout<<ans+pq2.size()<<endl;
	return 0;
}

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

int main(){
    int m;
    cin >> m;
    int n = 100000;
    for(int i=0;i<m;i++){
        n = n * 1.05;
        if(n%1000>0) n=n/1000*1000+1000;
    }
    cout << n << endl;
    return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long int h,s=0,k=1;
    scanf("%lld",&h);
    while(h != 0)
    {
        h = h/2;
        s = s+k;
        k = k*2;
    }
    printf("%lld",s);
    return 0;
}

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

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORTASC(c) sort((c).begin(),(c).end())
#define SORTDESC(c,t) sort((c).begin(),(c).end(), std::greater<t>());
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define VMAX(a) *max_element(ALL(a))
#define VMIN(a) *min_element(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double PI  = acos(-1.0);

template <class T, class S>
using umap = std::unordered_map<T, S>;
using ll = long long;
using namespace std;

int main() {
    ll n, m;
    string s = "";
    
    cin >> n >> m;

    REP(i, n){
        s += 'x';
    }

    ll a;
    char c;
    REP(i, m){
        cin >> a >> c;
        if (s[a-1]=='x' || s[a-1]==c){
            s[a-1] = c;
        } else {
            cout << -1 << endl;
            return 0;
        }
    }

    if(n==1 && (s[0]=='x' || s[0]=='0')){
        cout << 0 << endl;
        return 0;
    }

    if (s[0]=='0'){
        cout << -1 << endl;
        return 0;
    }

    if(s[0]=='x'){
        s[0]='1';
    }

    REP(i, n-1){
        if (s[i+1] == 'x'){
            s[i+1] = '0';
        }
    }
  
  	cout << s << endl;

    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef vector<pi> vpi;
typedef vector<vpi> vpii;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<pd> vpd;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef std::string str;
typedef std::vector<str> vs;

#define x first
#define y second
#define debug(...) cout<<"["<<#__VA_ARGS__<<": "<<__VA_ARGS__<<"]\n"

const int MOD = 1000000007;
const ll INF = std::numeric_limits<ll>::max();
const int MX = 100101;
const ld PI = 3.14159265358979323846264338327950288419716939937510582097494L;

template<typename T>
pair<T, T> operator+(const pair<T, T> &a, const pair<T, T> &b) { return pair<T, T>(a.x + b.x, a.y + b.y); }
template<typename T>
pair<T, T> operator-(const pair<T, T> &a, const pair<T, T> &b) { return pair<T, T>(a.x - b.x, a.y - b.y); }
template<typename T>
T operator*(const pair<T, T> &a, const pair<T, T> &b) { return (a.x * b.x + a.y * b.y); }
template<typename T>
T operator^(const pair<T, T> &a, const pair<T, T> &b) { return (a.x * b.y - a.y * b.x); }

template<typename T>
void print(vector<T> vec, string name = "") {
	cout << name;
	for (auto u : vec)
		cout << u << ' ';
	cout << '\n';
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	double N;
	cin >> N;

	int X = N / 1.08;
	double n = (double)X * 1.08;

	if ((int)n == (int)N) {
		printf("%d\n", X);
		return 0;
	}

	X++;
	n = (double)X * 1.08;
	if ((int)n == (int)N) {
		printf("%d\n", X);
		return 0;
	}

	printf(":(\n");
}

/* Look for:
* special cases (n=1?)
* overflow (ll vs int?)
* the exact constraints (multiple sets are too slow for n=10^6 :( )
* array bounds
*/


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

int m[3];

int main()
{
  int n, a, b;
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; ++i)
  {
    int p;
    scanf("%d", &p);
    if (p <= a) m[0]++;
    else if (p <= b) m[1]++;
    else m[2]++;
  }
  printf("%d\n", std::min(m[0], std::min(m[1], m[2])));
  return 0;
}

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

int main() {
  long D;
  cin >> D;
  
  //減点量の入力
  long c[27];
  for(int i=1; i<26+1; i++){
    cin >> c[i];
  }
  
  //加点量の入力
  long s[D+1][26+1];
  for(int i=1; i<D+1; i++){
  for(int j=1; j<26+1; j++){
    cin >> s[i][j];
  }}

  //過去の最終開催日を保持する配列
  long past[26+1] = {0};
  
  //日々の処理
  
  for(int day=1; day<D+1; day++){
    
    //仮の満足度を保持する配列
    long tempPoint[26+1] = {0};
    for(int tt=1; tt<26+1; tt++){

      //満足度の加点計算
      tempPoint[tt] = s[day][tt];

      //満足度の減点計算
      for(int num=1; num<26+1; num++){
        if(num==tt) continue;
        tempPoint[tt] -= ( c[num] * (day - past[num]) );
      }
      
    }
    
    //それぞれの選択に対する仮の満足度を表示
    //for(int i=1; i<26+1; i++){
    //  cout << i << " : " << tempPoint[i] << endl;
    //}
    
    //仮の満足度から一番高い満足度の選択を出力
    int choice=1;
    for(int i=1; i<26+1; i++){
      if(tempPoint[choice] < tempPoint[i]) choice = i;
    }
    //cout << "choice " << choice << endl;
    if(day!=D){
      cout << choice << endl;
    }else{
      cout << choice;
    }
    
    //実行したテストを記録
    past[choice] = day;
  }

  return 0;
}


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

int getFactorial(int n) {
    int factorial = n;
    for(int i=1; i < n; i++) {
        factorial *= n-i;
    }
    return factorial;
}

int getOrder(const int n, vector<int>& X) {
    int total_order = 0;
    vector<int> stock(n);
    for(int i=0; i < n; i++) stock[i] = i+1;

    for(int i=0; i < n; i++) {
        int partial_order = 0;
        for(int j=0; j < (int)stock.size(); j++) {
            if( X[i] == stock[j]) {
                partial_order = j;
                stock.erase(stock.begin() + j);
                break;
            }
        }
        total_order += partial_order * getFactorial(n-i-1);
    }
    return total_order;
}

int main() {
    // INPUT
    int N = 0;
    cin >> N;
    vector<int> P(N);
    for(int i=0; i < N; i++) cin >> P[i];
    vector<int> Q(N);
    for(int i=0; i < N; i++) cin >> Q[i];    

    // SOURCE
    int a = getOrder(N, P);
    int b = getOrder(N, Q);

    // OUTPUT
    int ans = abs(a-b);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 9; i >= 1; --i) {
    if (n % i == 0 and n / i <= 9) {
      puts("Yes");
      return 0;
    }
  }
  puts("No");
  return 0;
}

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

int main() {
  long Mod = 1000000007;
  int N;
  cin >> N;
  vector<long> A(N);

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

  long sumA = 0;
  for(int i = 0; i < N; ++i){
    sumA += A.at(i);
  }

  long sum = 0;
  for(int i = 0; i < N-1; ++i){
    sumA -= A.at(i);
    long t = sumA % Mod;
    sum += A.at(i) * t;
    sum %= Mod;        
  }

  cout << sum << endl;
}


Measured memory_bytes: 4828
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define ARR(array) for(int i=0;i<array.size();i++)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 1000000007
#define SIZE 10005
#define PI 	3.14159265358979323846

ll euclidean_gcd(ll a, ll b) {
  if(a < b) euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

double input(){
  ll a;
  cin >> a;
  return a;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,d;
    cin >> n >> d;
    int ans=0;
    double a[100][100];
    REP(i,n)REP(j,d)cin >> a[i][j];
    REP(i,n)FOR(j,i+1,n){
      double sum=0;
      REP(k,d)sum += pow(a[i][k]-a[j][k],2);
      sum = pow(sum,0.5);
      //cout << i <<" "<< j <<" "<<sum << endl;
      if(sum==(int)sum)ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>


/* ---------- Namespace ---------- */

using namespace std;


/* ---------- Type Abbreviation ---------- */

template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;

using ll = long long;
using PL = P<ll, ll>;
using PS = P<string, ll>;

using VI = V<int>;
using VVI = V<VI>;
using VL = V<ll>;
using VVL = V<VL>;
using VS = V<string>;
using VB = V<bool>;
using VVB = V<VB>;
using VPL = V<PL>;
using VPS = V<PS>;

#define fst first
#define snd second


/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)


/* ---------- container ---------- */

#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define GSORT(c) sort(ALL(c), greater<decltype((c).front())>())
#define SZ(x) (LL((x).size()))


/* ---------- repetition ---------- */

#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)

#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// Usual REP runs from 0 to n-1 (R: n to 0)
// Natural REP runs from 1 to n (R: n to 1)


/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = 3.14159265358979;
// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};


/* ---------- Short Functions ---------- */

template <typename T>
T square(T a) {
    return a * a;
}


/* ---------- Debug ---------- */
#define GET_VAR_NAME(variable) #variable

#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;
#define testP(p) cout << GET_VAR_NAME(p) << " = (" << (p).fst << ", " << (p).snd << ")" << endl;


/* ^^^^^^^^^^^^^^^ Settting Part ^^^^^^^^^^^^^^^ */

/* ---------- Variances ---------- */


/* ---------- Functions ---------- */


/* ---------- Main Function ---------- */

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

    ll N;
    cin >> N;

    VS S(N);
    REP(i, N) {
        cin >> S[i];
    }

    ll ans = 0;
    REP(A, N) {
        bool match = true;
        REP(i, N) {
            REP(j, N) {
                if (S[i][(j + A) % N] != S[j][(i + A) % N]) {
                    match = false;
                    break;
                }
            }
        }

        if (match) {
            ans += N;
        }
    }

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

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
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; }

const int MOD = 1000000007;
const int INF = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};


map<ll, int> prime_factor(ll n){
	map<ll, int> res;
	for(ll i = 2; i*i<=n; i++){
		while(n%i==0){
			res[i]++;
			n/=i;
		}
	}
	if(n!=1) res[n]++;
	return res;
}

set<ll> all_divisor(ll n){
	set<ll> res;
	for(ll i = 1; i*i<= n; i++){
		if(n%i==0){res.insert(i);res.insert(n/i);}
	}
	return res;
}

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a[i];
	map<ll, int> lcm;
	rep(i,n){
		map<ll, int> mp = prime_factor(a[i]);
		for(auto e: mp){
			if(lcm[e.first] < e.second) lcm[e.first] = e.second;
		}
	}
	mint l = 1;
	for(auto e: lcm){
		rep(i,e.second) l *= e.first;
	}
	mint ans;
	rep(i,n){
		mint b = l/a[i];
		ans += b;
	}
	cout << ans.x << endl;

}

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

ll ans=0;
char c[] = {'3','5','7'};
int N;

bool check_357(string str){
  int flag=0;
  for(auto& a : c){
    for(int i=0;i<str.size();++i){
      if(a==str[i]){
        flag++;
        break;
      }
    }
  }
  return ((flag==3)? 1:0);
}

void dfs(string str){
  if(str.length() < to_string(N).length()){
    if(check_357(str)) ans++;
    for(auto& a : c){
      dfs(str+a);
    }
  }
  else if(stoi(str) <= N){
    if(check_357(str)) ans++;
  }
}

int main(){
  cin >> N;
  dfs("");
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    
    int max = 0;
    for (int i = 0; i < S.length(); i++) {
      for (int j = i; j < S.length(); j++) {
        int length = getACGTLen(S, i, j);
        if (max < length) {
          max = length;
        }
      }
    }
    System.out.println(max);
  }
  
  private static int getACGTLen(String s, int from, int to) {
    int length = 0;
    for (int i = from; i <= to; i++) {
      if (ACGT(s.charAt(i))) {
        length++;
      } else {
        return 0;
      }
    }
    return length;
  }
  
  private static boolean ACGT(char c) {
    return c == 'A' || c == 'C' || c == 'G' || c == 'T';
  }
}

Measured memory_bytes: 21588
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define FIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int, int> PII;

int main(){
    FIO;
    int n;
    cin >> n;
    ll ans = 0;
    map<string, ll> m;
    for(int i = 0 ; i < n ; i++){
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        if(m.count(s)){
            ans += m[s];
            m[s]++;
        }else{
            m[s] = 1;
        }
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 11264
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <stack>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右下左上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, 1, 0, -1, -1, 1, 1, -1 };

namespace {
    template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
    template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

    void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; ++i) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

    // 標準入出力
    struct inp {
        std::size_t szi, szj;
        inp(std::size_t _szi = 1, std::size_t _szj = 1) : szi(_szi), szj(_szj) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { std::vector<T> a(szi); for (std::size_t i = 0; i < szi; ++i) std::cin >> a[i]; return a; }
        template <typename T> operator std::vector<std::vector<T>>() const {
            std::vector<std::vector<T>> a(szi, std::vector<T>(szj));
            for (std::size_t i = 0; i < szi; ++i) for (std::size_t j = 0; j < szj; ++j) cin >> a[i][j]; return a;
        }
    };
    inp inp1;
}

int main() {

    int a, b;
    cin >> a >> b;
    Cout(a * b);

    return 0;
}


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


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

d = []
for i in range(1, 40):
    for j in range(i+1):
        d.append(i)

lis = prime_factorize(n)
lis_s = set(lis)
ans = 0
for el in lis_s:
    ans += d[lis.count(el) - 1]
print(ans)

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

int N,A[3][3],b[10];
bool appear[3][3];

int main()
{
   for (int i=0; i<3; i++)
   {
      for (int j=0; j<3; j++) 
	     cin>>A[i][j];
   }
   cin>>N;
   for (int i=0; i<N; i++) 
      cin>>b[i];
   for (int i=0; i<N; i++)
   { 
      for (int j=0; j<N; j++)
	  {
	     appear[i][j]=false;
		 for (int k=0; k<N; k++)
		 {
		    if (A[i][j]==b[k])
			  appear[i][j]=true;
		 }
	  }
   }
   string ANS="No";
   for(int i=0; i<3; i++)
   {
      if(appear[i][0] && appear[i][1] && appear[i][2])
	     ANS="Yes";
   }
   for(int i=0; i<3; i++)
   {
      if(appear[0][i] && appear[1][i] && appear[2][i]) 
	     ANS="Yes";
   }
   if(appear[0][0] && appear[1][1] && appear[2][2]) 
      ANS="Yes";
   if(appear[0][2] && appear[1][1] && appear[2][0]) 
      ANS="Yes";
   cout<<ANS<<endl;
   return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
using namespace std;
#define LATTE 10000

int main(){
	int A[3];
	for(int i=0;i<3;i++) cin>>A[i];
	sort(A,A+3);
	printf("%d %d %d\n",A[0],A[1],A[2]);
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define LL              long long
#define SL(n)           scanf("%lld",&n)
#define LF              double
#define SF(n)           scanf("%lf",&n)

#define pb              push_back
#define ff              first
#define ss              second
#define mp              make_pair

#define ON(n,i)         (n|(1<<i))
#define OFF(n,i)        (n&(~(1<<i)))
#define CHK(n,i)        (n&(1<<i))

#define SET(arr)        memset( arr , -1 , sizeof arr)
#define RESET(arr)      memset( arr,0,sizeof arr)

#define srt(v)          sort(v.begin(),v.end())
#define found( s,d )    (s.find(d) != s.end())

#define FOR(i,s,e)      for( LL i = s ; i<=e ; i++ )

#define FILEIN          freopen("in.txt","r",stdin)
#define FILEOUT         freopen("out.txt","w",stdout)

using namespace std;

int main(){
  LL A,B;
  SL(A); SL(B);
  bool y = 0;
  if( A%3 == 0 && A ) y = 1;
  else if(B%3 == 0 && B)  y = 1;
  else if( (A+B)%3 == 0 && (A+B) ) y = 1;
  if( y ) printf("Possible\n");
  else printf("Impossible\n");
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;

int main(int argc, char const *argv[]) {
    ll sx, sy, tx, ty;
    std::cin >> sx >> sy >> tx >> ty;
    ll dx = tx - sx;
    ll dy = ty - sy;
    for (size_t i = 0; i < dx; i++) {
        std::cout << "R";
    }
    for (size_t i = 0; i < dy; i++) {
        std::cout << "U";
    }
    for (size_t i = 0; i < dx; i++) {
        std::cout << "L";
    }
    for (size_t i = 0; i < dy; i++) {
        std::cout << "D";
    }
    std::cout << "D";
    for (size_t i = 0; i < dx + 1; i++) {
        std::cout << "R";
    }
    for (size_t i = 0; i < dy + 1; i++) {
        std::cout << "U";
    }
    std::cout << "LU";
    for (size_t i = 0; i < dx + 1; i++) {
        std::cout << "L";
    }
    for (size_t i = 0; i < dy + 1; i++) {
        std::cout << "D";
    }
    std::cout << "R"
              << "\n";
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		
		int a=s.nextInt();
		int b=s.nextInt();
		
		int c=s.nextInt();
		int d=s.nextInt();
		
		int one=a/d;
		int two=c/b;
		
		if(a%d!=0)
		{
			one++;
		}
		
		if(c%b!=0)
		{
			two++;
		}
		
		if(two<=one)
		{
			System.out.println("Yes");
		}
		else
		{
			System.out.println("No");
		}
		
	}
	
}

Measured memory_bytes: 35828
#include<stdio.h>

int main()
{
    int n,i,m,sum=0,d=0;
    scanf("%d %d",&n,&m);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
       sum=sum+a[i];


    }
    double c;
    c=(sum/(4*m));
    if(sum%(4*m)!=0)
        c=c+1;

    for(i=0;i<n;i++)
    {
        if(a[i]>=c)
            d=d+1;
    }

    if(d>=m)
        printf("Yes");
    else
        printf("No");
        return 0;

}


Measured memory_bytes: 128