akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python3
import sys
from pprint import pprint
 
def solve(H: int, W: int, A: "List[str]"):
    count = [[H + W] * (W + 2) for _ in range(H + 2)]
    for i in range(H):
        for j in range(W):
            if A[i][j] == '#':
                count[i + 1][j + 1] = 0
            else:
                count[i + 1][j + 1] = min(count[i][j + 1], count[i + 1][j]) + 1
 
    #pprint(count)
    ret = 0
    for i in range(H, 0, -1):
        for j in range(W, 0, -1):
            count[i][j] = min(count[i][j], min(count[i][j + 1], count[i + 1][j]) + 1)
            ret = max(ret, count[i][j])
    #pprint(count)
    print(ret)
    return
 
 
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [next(tokens) for _ in range(H) ]  # type: "List[str]"
    solve(H, W, A)
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 54512
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
#define INF 0x7FFFFFFF
#define ll long long
const double EPS = 1e-10;


int main(){
  ll n;
  ll ans=0;
  cin>>n;
  vector<ll> a(n,0);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  ll x,y;
  x=a[n-1];
  y=a[n-1];
  a.pop_back();
  ll p,q;
  p=0;
  q=a.size()-1;
  while(p!=q){
    if(max(abs(x-a[p]),abs(y-a[p]))>=max(abs(x-a[q]),abs(y-a[q]))){
      if(abs(x-a[p])>=abs(y-a[p])){
        ans+=abs(x-a[p]);
        x=a[p];
      }
      else{
        ans+=abs(y-a[p]);
        y=a[p];
      }
      p++;
    }
    else{
      if(abs(x-a[q])>=abs(y-a[q])){
        ans+=abs(x-a[q]);
        x=a[q];
      }
      else{
        ans+=abs(y-a[q]);
        y=a[q];
      }
      q--;
    }
  }
  ans+=max(abs(x-a[q]),abs(y-a[q]));
  cout<<ans<<endl;
}


Measured memory_bytes: 1024
package main

import (
	"fmt"
	"sort"
)

func main() {
	var a, b int

	fmt.Scanf("%d %d", &a, &b)

	fmt.Println(logic(a, b))
}

func logic(a int, b int) int {
	result := []int{a + b, a - b, a * b}
	sort.Ints(result)
	return result[len(result)-1]
}

Measured memory_bytes: 512
/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

//#define int long long

using namespace std;
using ll = long long;
using ld = long double;
using vecll = vector<ll>;

#define nextline() (std::cerr << "\n")
#define debug(x) (#x " : " + (x))
#define debug_cout(x) (std::cerr << #x << " : " <<  (x) << "\n")
#define debug_tabcout(n, x) (std::cerr << strMulti("\t",n) << #x << " : " <<  (x) << "\n")
#define debug_headcout(h, x) (std::cerr << h << " : " <<  (x) << "\n")
#define debug_tabheadcout(n, h, x) (std::cerr << strMulti("\t",n) << h << " : " <<  (x) << "\n")

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<=i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
constexpr int INF = 2000000100;
constexpr ll DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> T divup(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
#define diup(a, b) (a % b == 0 ? a / b : a / b + 1)
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
template<class T> T math_C(T m, T n) { T ret = mathP(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
template<class T> T math_gcd(T a, T b) { a = abs(a); b = abs(b); if (a < b) { std::swap(a, b); } T tmp; while (b != 0) { tmp = b; b = a % b; a = tmp; } return a; }
template<class T> T math_lcm(T a, T b) { a = abs(a); b = abs(b); if (a > b) { std::swap(a, b); } if (a == 1) { return b; } T i = a; while (i % b != 0) { i += a; } return i; }

/*****/

void Main()
{
	int a, b;
	cin >> a >> b;
	cout << (a+b) % 24;
}

/*****/

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

	std::cout << std::fixed << std::setprecision(10);


	/*
	while (true)
	{
		Main();
		cout << endl;
	}
	//*/


	Main();

	return 0;
}


Measured memory_bytes: 256
#Warhall-Floyd Algorighm
class Edge
  attr_accessor :s, :t, :d
  def initialize(s, t, d)
    @s = s
    @t = t
    @d = d
  end
end

v, e = gets.split.map(&:to_i)

m = Array.new(v){Array.new(v){1.0/0.0}}

edges = []
e.times{|i|
  s, t, d = gets.split.map(&:to_i)
  m[s][t] = d
  edges[i] = Edge.new(s, t, d)
}
v.times{|i|
  m[i][i] = 0
}

v.times{|k|
  v.times{|i|
    v.times{|j|
      m[i][j] = m[i][k] + m[k][j] if m[i][j] > m[i][k] + m[k][j]
    }
  }
}

v.times{|i|
  edges.each{|edge|
    if m[i][edge.s] + edge.d < m[i][edge.t]
      puts "NEGATIVE CYCLE"
      exit
    end
  }
}

v.times{|i|
  v.times{|j|
    m[i][j] = "INF" if m[i][j] == 1.0 / 0.0
  }
  puts m[i].join(" ")
}

Measured memory_bytes: 11340
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>

using namespace std;
using lli = long long int;
// #define DEBUG
#ifdef DEBUG
#define debug(var) cout << (#var) << ": " << (var) << endl;
template<class T> void dump_array_impl(const T& a) {
  bool first = true;
  for (auto&& x : a) {
    if (!first) cout << ", "; else first = false; cout << x;
  }
}
#define debug_array(a) cout<<(#a)<<": ";dump_array_impl(a);cout<<endl
#else
#define debug(var) {}
#define debug_array(a) {}
#endif
template<class T> void read_n(vector<T>& v, size_t n) {
  v = vector<T>(n); for (lli i=0; i<n; ++i) cin >> v[i];
}
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

const lli mod = 1e9 + 7;
string s;
vector<lli> a, c;
int main() {
  cin >> s;
  a = c = decltype(a)(s.size(), 0);
  lli sum = 0, n = 1; 
  for (int i=0; i<s.size(); ++i) {
    if (s[i] == 'A') a[i] = (sum + n) % mod;
    else if (s[i] == '?') {
      a[i] = (3 * sum + n) % mod;
      n = 3 * n % mod;
    } else a[i] = sum;
    sum = a[i];
  }
  sum = 0, n = 1;
  for (int i=s.size()-1; i>=0; --i) {
    if (s[i] == 'C') c[i] = (sum + n) % mod;
    else if (s[i] == '?') {
      c[i] = (3 * sum + n) % mod;
      n = 3 * n % mod;
    } else c[i] = sum;
    sum = c[i];
  }
  lli ans = 0;
  for (int i=1; i<s.size()-1; ++i) {
    if (s[i] == 'B' || s[i] == '?') {
      ans = (ans + a[i-1] * c[i+1] % mod) % mod;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 2048
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 {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	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 int K,N;
	static long mod =1000000007;
	public static void main(String[] args) {
		String O=sc.next();
		String E=sc.next();
		StringBuffer ans = new StringBuffer();
		
		for(int i=0;i<E.length();i++) {
			ans.append(O.charAt(i));
			ans.append(E.charAt(i));
		}
		if(O.length()!=E.length()) {
			ans.append(O.charAt(O.length()-1));
		}
		p(ans.toString());
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	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);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	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: 23380
#include <bits/stdc++.h>
using namespace std;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;
 
const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const double PI = 3.1415926535;
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;
 
const int MAX = 1000000;
const int MOD = 1000000007;
 
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }
 
int main(){
  int s;
  cin >> s;
  vector<ll>dp(2020);
  dp[0]=0;
  dp[1]=0;
  dp[2]=0;
  dp[3]=1;
  dp[4]=1;
  rep(i, 5, 2005){
    dp[i] = (dp[i-3]+dp[i-1])%mod;
  }
  cout << dp[s] << endl;
}

Measured memory_bytes: 3648
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

// GCD : greatest common divisor (GCD) via Euclidean algorithm
func GCD(a, b int) int {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

// LCM : find Least Common Multiple (LCM) via GCD
func LCM(a, b int, integers ...int) int {
	result := a / GCD(a, b) * b

	for i := 0; i < len(integers); i++ {
		result = LCM(result, integers[i])
	}

	return result
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)

	N := getInt()
	a := make([]int, N)
	for i := 0; i < N; i++ {
		a[i] = getInt()
	}
	ans := 0
	for i := 0; i < N; i++ {
		ans += a[i] - 1
	}
	out(ans)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	vector<vector<int>> dist(n,vector<int>(n,INF));
	rep(i,m){
		int s,t,d;
		cin>>s>>t>>d;
		dist[s][t]=d;
	}
	rep(i,n) dist[i][i]=0;
	int ans=INF;
	rep(st,n){
		vector<vector<int>> dp(1<<n,vector<int>(n,INF));
		dp[1<<st][st]=0;
		rep(S,1<<n){
			rep(i,n){
				if(dp[S][i]==INF) continue;
				rep(j,n){
					if(S & 1<<j) continue;
					chmin(dp[S|1<<j][j],dp[S][i]+dist[i][j]);
				}
			}
		}
		rep(en,n){
			if(dp[(1<<n)-1][en]!=INF){
				chmin(ans,dp[(1<<n)-1][en]+dist[en][st]);
			}
		}
	}
	if(ans!=INF) cout<<ans<<endl;
	else cout<<-1<<endl;
}


Measured memory_bytes: 6192
#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<int,int>;

ll choose2(ll n){ //combination
  return n*(n-1)/2;
}

int main() {
  int N;
  cin >> N;
  vector<int> A(N),cnt(N);
  rep(i,N){
    cin >> A[i];
    A[i]--;
  }
  rep(i,N){
    cnt[A[i]]++;
  }
  ll tot = 0;
  rep(i,N){
    tot += choose2(cnt[i]);
  }
  rep(i,N){
    ll ans = tot;
    ans -= choose2(cnt[A[i]]);
    ans += choose2(cnt[A[i]]-1);
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 4836
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string.h>
#include <string>
#include <vector>
#include <stack>

using namespace std;

#define INF 2e9 + 9
#define ALL(v) v.begin(), v.end()
#define Int int64_t
#define pll pair<Int, Int>
template <class T>
using pql = priority_queue<T, vector<T>>;
template <class T>
using pq = priority_queue<T, vector<T>, greater<T>>;
#define ll(n) \
    Int n;    \
    cin >> n;
#define LL(...)       \
    Int __VA_ARGS___; \
    cin >> __VA_ARGS___;
#define OUT(...) cout << __VA_ARGS___;
#define RP(n, i, s) for (Int i = s; i < n; i++)
#define REP(n, i) for (Int i = 0; i < n; i++)
#define REPe(n, i) for (Int i = 1; i <= n; i++)
#define RPe(n, i, s) for (Int i = s; i <= n; i++)
#define upd_max(maxer, updater) \
    if (maxer < updater)        \
        maxer = updater;

vector<vector<Int>> to;
vector<Int> d;
vector<Int> f;

void dfs(Int x,Int fromx){
    f[x] += fromx;
    d[x] = 1;
    for(auto z : to[x]){
        if(d[z] == 1) continue;
        dfs(z,f[x]);
    }
}


int main() {
    Int n,q;
    cin >> n >> q;
    d.resize(n);
    to.resize(n);
    f.resize(n);

    REP(n-1,i){
        Int a, b;
        cin >> a >> b;
        a-- ; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }

    REP(q,i){
        Int p , x;
        cin >> p >> x;
        p--;
        f[p]+=x;
    }
    dfs(0,0);
    REP(n,i){
        cout << f[i] <<" ";
    }
    cout << endl;
    

}

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

typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<long> vll;
typedef pair<int, int> pi;
typedef pair<long long, long long> pll;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpll;

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

int main() {
    double r;
    cin >> r;
    cout << r * 6.283185;
}


Measured memory_bytes: 3788
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <bitset>
using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;

const double PI=3.14159265358979323846;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REP1(i, n) for(int i = 1; i <= (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())
#define ZERO(a) memset(a, 0, sizeof(a))

#define RAD(d) (PI * (d) / 180)
#define DEG(r) (180.0 * (r) / PI)

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

template<class T> void dump(const vector<T> &v)
{
	REP(i, SZ(v)-1){ cout << v[i] << " "; }
	cout << v[SZ(v)-1] << endl;
}

template<class T> void dump(int w, int h, const vector<T> &v)
{
	REP(j, h){
		REP(i, w-1){ cout << v[j * w + i] << " "; }
		cout << v[j * w + w-1] << endl;
	}
}

template<class T> T accumulate(const vector<T> &v)
{
	T sum = 0;
	REP(i, SZ(v)){ sum += v[i]; }
	return sum;
}

template<class T> struct Matrix
{
	T w, h;
	vector<T> A;
	Matrix(T w_, T h_) : w(w_), h(h_), A(w * h) {}
	T get(T x, T y) const { return A[y * w + x]; }
};

template<class T> void input(Matrix<T> &m)
{
	REP(j, m.h){
		REP(i, m.w){
			cin >> m.A[j * m.w + i];
		}
	}
}

template<class T> Matrix<T> prod(const Matrix<T> &a, const Matrix<T> &b)
{
	Matrix<T> m(b.w, a.h);

	REP(j, m.h){
		REP(i, m.w){
			ll c = 0;
			REP(k, a.w){
				c += a.A[j * a.w + k] * b.A[k * b.w + i];
			}
			m.A[j * m.w + i] = c;
		}
	}

	return m;
}

void dump(const Matrix<ll> &m)
{
	REP(j, m.h){
		REP(i, m.w-1){ printf("%lld ", m.A[j * m.w + i]); }
		printf("%lld\n", m.A[j * m.w + m.w-1]);
	}
}

void dump(const Matrix<double> &m)
{
	REP(j, m.h){
		REP(i, m.w-1){ printf("%f ", m.A[j * m.w + i]); }
		printf("%f\n", m.A[j * m.w + m.w-1]);
	}
}

string &to_upper(string &s)
{
	REP(i, s.length()){
		if('a' <= s[i] && s[i] <= 'z'){
			s[i] -= 32;
		}
	}

	return s;
}

string &to_lower(string &s)
{
	REP(i, s.length()){
		if('A' <= s[i] && s[i] <= 'Z'){
			s[i] += 32;
		}
	}

	return s;
}

// 約数を列挙する
template <class T> vector<T> get_divisors(T n)
{
	vector<T> ret;
	for(T i = 1; i * i <= n; i++){
		if(n % i == 0){
			ret.push_back(i);
			if(i * i != n)
				ret.push_back(n / i);
		}
	}
	sort(ALL(ret));
	return ret;
}

// 約数を列挙する(1～sqrt(N)に限る)
template <class T> vector<T> get_divisors2(T n)
{
	vector<T> ret;
	for(T i = 1; i * i <= n; i++){
		if(n % i == 0){
			ret.push_back(i);
		}
	}
	return ret;
}

int F(ll A, ll B)
{
	return LEN(to_string(max(A, B)));
}

int main()
{
	ll N;
	cin >> N;

	auto div = get_divisors2(N);

	ll min_value = 100;

	REP(i, SZ(div)){
		ll A = div[i];
		ll B = N / A;
		ll f = F(A, B);
		chmin(min_value, f);
	}

	printf("%lld\n", min_value);

	return 0;
}


Measured memory_bytes: 256
def f(n, str):
    if n % 2 == 1:
        return "No"
    
    t = ""
    m = int(n / 2)
    for i in range(m):
        t = t + str[i]
    
    if t + t == str:
        return "Yes";

    return "No" 

if __name__ == '__main__':
    n = int(input())
    str = input()
    print(f(n, str))

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//typedef vector<vector<ll>> Graph;

const ll mod = 1e9 + 7;
//const ll mod = 998244353;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second

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 (a>b) { a=b; return 1; } return 0; }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cerr<<v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

string num2bit(ll num, ll len){
    string bit = "";
    REP(i, len){
    bit += char('0'+(num>>i & 1));
    }
    return bit;
}

// par[i]  は，iがrootなら-(連結成分のサイズ)を，iがrootではないならばrootを返す
// root(x) は必ずroot を返す
struct UnionFindSize {
    vector<int> par;
    
    UnionFindSize(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }
    
    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};

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

    ll n, q;
    cin >> n >> q;

    UnionFindSize uf(n);

    while(q--){
        ll t, x, y;
        cin >> t >> x >> y;
        if(t){
            cout << uf.issame(x, y) << endl;
        }else{
            uf.merge(x, y);
        }
    }

    return 0;
}


Measured memory_bytes: 3220
#ABC058 A - ι⊥l
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a,b,c = map(int, input().split())
if b-a == c-b:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 3060
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep = ' ', end = '\n'):
    print(*var, file=sys.stderr, end = end, sep = sep)

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
# from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

a, b, k = I()
m = min(a, k)
a -= m
k -= m
m = min(b, k)
b -= m
print(a, b)

Measured memory_bytes: 3444
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
struct {
	int a,b,c;
} st[400000];
long long i,k,j,t,n,h,m[700000][3];
int main(){
	cin>>n;
	for (i=0; i<n; i++){
		cin>>st[i].a>>st[i].b>>st[i].c;
	}
	for (i=0; i<n; i++){
		if (i==0) {m[i][0]=st[i].a;m[i][1]=st[i].b;m[i][2]=st[i].c; continue;}
		m[i][0]=max(m[i-1][1],m[i-1][2]) + st[i].a;
		m[i][1]=max(m[i-1][0],m[i-1][2]) + st[i].b;
		m[i][2]=max(m[i-1][1],m[i-1][0]) + st[i].c;
	}
	cout<<max(m[n-1][0], max(m[n-1][1],m[n-1][2]));
}


Measured memory_bytes: 6616
/*
AuThOr GaRyMr
*/
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
#define ff fflush(stdout)
#define fastio ios::sync_with_stdio(false)
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int n,m;
int fa[100000+20];
LL dp[100000+20][2];
vector<int> each[100000+20];

void dfs(int now,int prev){
	fa[now]=prev;
	int ok=0;
	dp[now][0]=1;
	for(auto it:each[now]){
		if(it!=prev){
			ok=1;
			dfs(it,now);
			dp[now][0]*=(dp[it][0]+1);
			dp[now][0]%=m;
		}
	}
	if(!ok){
		dp[now][0]=1;
		return;
	}
}
void dfs2(int now,int prev){
	dp[now][1]++;
	vector<int> cc;
	for(auto it:each[now]){
		if(it!=prev){
			cc.PB(dp[it][0]+1);
		}
	}
	LL las=1;
	vector<LL> c2;
	reverse(ALL(cc));
	for(auto it:cc){
		las*=it;
		las%=m;
		c2.PB(las);
	}
	reverse(ALL(c2));
	c2.PB(1);
	las=1;
	int cnt=0;
	for(auto it:each[now]){
		if(it!=prev){
			cnt++;
			dp[it][1]=dp[now][1]*c2[cnt]%m*las%m;
			las*=dp[it][0]+1;
			las%=m;
			dfs2(it,now);
		}
	}
}
int main(){
	fastio;
	cin>>n>>m;
	rb(i,2,n){
		int u,v;
		cin>>u>>v;
		each[u].PB(v);
		each[v].PB(u);
	}
	dfs(1,0);
	dfs2(1,0);
//	cout<<dp[1][1]<<endl;
	rb(i,1,n){
		cout<<dp[i][0]*dp[i][1]%m<<endl;
	}
	return 0;
}


Measured memory_bytes: 24576
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const double PI=3.14159265358979323846;
ll dp;

int main(){
   ll n,m,d,ans=0,h[101010];
   bool f[101010]={};
   
   string s;
   cin>>s;
   if(s=="ABC")cout<<"ARC"<<endl;
   else cout<<"ABC"<<endl;
   // rep(i,m){
   //    cin>>d;
   //    rep(j,d){
   //       ll a;
   //       cin>>a;
   //       f[a]=1;
   //    }

   // }
   
   // rep(i,n){
   //    if(f[i+1]==0)ans++;
   // }
   // cout<<ans<<endl;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 9999999999;
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
  T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }


int main() {
  int n; cin >>n;
  string ans = "APPROVED";
  rep(i, n){
    int buf; cin >>buf;
    if (buf % 2 == 0){
      if (buf % 3 != 0 && buf % 5 != 0){
        ans = "DENIED";
      }
    }
  }
  cout <<ans <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s,t;
  cin >> s >> t;
  int trial=s.size()-t.size()+1;
  if(trial<=0){
    cout << "UNRESTORABLE" << endl;
    return 0;
  }
  string ans="";
  int ans_yn=0;
  rep(i,trial){
    string tmp;
    int k=0;
    int flag=0;
    rep(j,s.size()){
      //      cout << j << endl;
      if(i<=j && i+t.size()>j ){
	if(s[j]=='?'||s[j]==t[k]){
	  tmp.pb(t[k]);
	  k++;
	}
	else{
	  break;
	}
      }
      else{		      	
	if(s[j]=='?'){
	  tmp.pb('a');
	}
	else{
	  tmp.pb(s[j]);
	}
      }
      if(j==s.size()-1){
	flag=1;
      }
    }
    if(flag==1){
      if(ans_yn==1){
	ans = min(tmp,ans);
      }
      else ans = tmp;
      ans_yn=1;
    }
  }
  if(ans.size()!=0){
    cout << ans << endl;
  }
  else cout << "UNRESTORABLE" << endl;
  return 0;
    

}


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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> as(n), bs(n), cs(n-1);
    for(int i=0; i<n; i++) cin >> as.at(i);
    for(int i=0; i<n; i++) cin >> bs.at(i);
    for(int i=0; i<n-1; i++) cin >> cs.at(i);

    int ans = 0;
    for(int i=0; i<n-1; i++)
    {
        if(as.at(i) + 1 == as.at(i+1)) ans += cs.at(as.at(i)-1);
    }
    for(int i=0; i<n; i++)
    {
        ans += bs.at(i);
    }
    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 256
package main
 
import (
    "bufio"
    "fmt"
    "os"
    "strconv"
)

func main(){
    a := nextInt()
    b := nextInt()
    fmt.Printf("%v %v %f\n", a/b, a%b, float64(a)/float64(b));
}
 
/* templates */
 
func Max(a ...int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r < a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Min(a ...int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r > a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Sum(a []int) (r int) {
    for i := range a {
        r += a[i]
    }
    return r
}
 
func Abs(a float64) float64 {
    if a < 0 {
        return -a
    }
    return a
}
 
type Pair struct {
    a, b int
}
 
type Pairs []Pair
 
func (p Pairs) Len() int {
    return len(p)
}
 
func (p Pairs) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}
 
func (p Pairs) Less(i, j int) bool {
    return p[i].b < p[j].b
}
 
var nextReader func() string
 
func init() {
    nextReader = NewScanner()
}
 
func NewScanner() func() string {
    r := bufio.NewScanner(os.Stdin)
    r.Buffer(make([]byte, 1024), int(1e+11))
    r.Split(bufio.ScanWords)
    return func() string {
        r.Scan()
        return r.Text()
    }
}
 
func nextString() string {
    return nextReader()
}
 
func nextInt64() int64 {
    v, _ := strconv.ParseInt(nextReader(), 10, 64)
    return v
}
 
func nextInt() int {
    v, _ := strconv.Atoi(nextReader())
    return v
}
 
func nextInts(n int) []int {
    r := make([]int, n)
    for i := 0; i < n; i++ {
        r[i] = nextInt()
    }
    return r
}
 
func nextFloat64() float64 {
    f, _ := strconv.ParseFloat(nextReader(), 64)
    return f
}


Measured memory_bytes: 1116
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
int main(){
  double x1,y1,x2,y2;
  cin >> x1 >> y1 >> x2 >> y2;
  //cout << sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) << endl;
  printf("%.5f\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));
  return 0;
}


Measured memory_bytes: 3192
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<cstdint>
#include<bits/stdc++.h>
#include<queue>
#include<set>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).size())
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define INF bit(60)
#define pb push_back
#define mod 1000000007

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; }

using namespace std;
using uif=uint_fast64_t;
using ll=long long int;

int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mod;a=1ll*a*a%mod;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


#define FACSIZE 2002

ll invfac[FACSIZE];
ll fac[FACSIZE];

ll mod_pow(ll ,ll );
ll mod_add(ll ,ll );
ll mod_mul(ll ,ll );
ll mod_div(ll ,ll );
void make_fact(ll );
void make_invfact(ll );



int main(void){

  ll n;
  cin>>n;

  rep(i,n){
    string s;
    cin>>s;
    //stack< > sta;
    unordered_map<ll,priority_queue< ll,vector<ll>,greater<ll> > > um;
    um.clear();
    ll num=0;
    ll depth=0;
    for(auto c:s){
      //cout << c << endl;
      if(c=='['){
        depth++;
      }
      else if( c>='0' && c<='9' ){
        num*=10;
        num+=(ll)( c - '0' );
      }
      else if(c==']'){
        depth--;
        if(num>0){
          um[depth].push(num/2+1);
          num=0;
        }
        else{
          //for(auto q:um[depth+1]) cerr << q << " ";
          //cerr << endl;
          ll half=um[depth+1].size()/2+1;
          ll vote=0;
          rep(j,half){
            auto q=um[depth+1].top();
            //cerr << q << " ";
            um[depth+1].pop();
            vote+=q;
          }
          //cerr << endl;
          //cerr << "vote:"<< vote << endl;
          um.erase(depth+1);
          um[depth].push(vote);
        }
      }
    }

    cout << um[0].top() << endl;
    um.clear();
    
  }

  return 0;

}

ll mod_pow(ll x,ll r){
  if(r==0) return 1;
  else if(r==1) return x%mod;
  else if(r%2==0){
    ll t=mod_pow(x,r/2)%mod;
    return t*t %mod;
  } 
  else{
    ll t=mod_pow(x,r/2)%mod;
    ll k= t*t %mod;
    return k*x%mod;
  } 
}
ll mod_add(ll a,ll b){
  return (a+b)%mod;
}

ll mod_mul(ll a,ll b){
  return (a*b)%mod;
}

ll mod_div(ll a,ll b){
  return mod_mul(a,mod_pow(b,mod-2));
}

void make_fact(ll n){
  fac[0]=1;
  rep(i,n){
    fac[i+1]=mod_mul(fac[i],i+1);
  }  
}

void make_invfact(ll n){
  invfac[n]= mod_pow( fac[n] ,mod-2);
  for(int i=n-1;i>=0;i--){
    invfac[i]=mod_mul(invfac[i+1],i+1);
  }

}


Measured memory_bytes: 3236
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n,m;
	cin>>n>>m;
	int a[n];
	int sum=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	int req=(sum+4*m-1)/(4*m);
	int  cnt=0;
	rep(i,n)if(a[i]>=req)cnt++;
	if(cnt<m)cout<<"No\n";
	else cout<<"Yes\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int x;
    int flag=0;
    while(n--)
    {
        cin>>x;
        if(x%2==0)
        {
            if(x%3==0 || x%5==0)
            {
                continue;
            }
            flag++;
            break;
        }
    }
    if(flag==0)
    {
        cout<<"APPROVED";
    }
    else
        cout<<"DENIED";


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b) {
  return b == 0 ? a : gcd(b, a % b);
}

bool solve(ll A, ll B, ll C, ll D) {
  if (B > D) return false;

  ll x = max(A - C - 1, 0LL);
  ll t = x / B;
  ll a = A - t * B;
  if (a - B < 0) return false;

  if (B <= C) return true;

  ll g = gcd(B, D);
  return B - g + A % g <= C;
}

int main(void) {
  ll T;
  cin >> T;

  while (T-- > 0) {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    cout << (solve(A, B, C, D) ? "Yes" : "No") << endl;
  }
}

Measured memory_bytes: 256
N = int(input())
plus_max = -10**10
plus_min = 10**10
minus_max = -10**10
minus_min = 10**10
for i in range(N):
    x,y = map(int,input().split())
    plus_max = max(plus_max,x+y)
    plus_min = min(plus_min,x+y)
    minus_max = max(minus_max,x-y)
    minus_min = min(minus_min,x-y)
print(max(plus_max-plus_min,minus_max-minus_min))

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

ll gcd(ll a, ll b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

int main() {
  ll a, b;
  scanf("%lld%lld", &a, &b);
  printf("%lld\n", a * b / gcd(a, b));
}

Measured memory_bytes: 128
#include <iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#define N 1000
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if((10*b+c)%4==0)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}
/*
 5
 1 1 1
 111
 3 1 8
 1
 2
 4
 1 2
 2 3
 3 2 10
 4 7
 8 9
 2 3
 1 2
 2 3
 4 2 99
 0 1
 0 1
 0 1
 0 0
 4 1
 2 4
 4 3
 4 3 99
 0 1 0
 0 1 0
 0 1 0
 0 0 0
 4 1
 2 4
 4 3
 */


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      int count=0;
      for(int i=a; i<=b; i++){
        if(c%i==0){
          count++;
        }
      }
      System.out.println(count);
  }
}



Measured memory_bytes: 26364
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

const int dx[4] = {-1, 0, 0, 1};
const int dy[4] = {0, -1, 1, 0};

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
// clang-format on

int N;

int main(void)
{
  cin >> N;

  int cnt = 0;
  for (int i = 1; i <= N; i++) {
    int d = 0;
    int n = i;
    while (n > 0) n /= 10, d++;
    if (d % 2 == 1) cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 888
from math import tan, pi
a,b,x = map(int, input().split())
eps = 1e-6

def f(a,b,t):
  if pi/2-t<eps: return 0
  if b*tan(pi/2.-t) < a: return b*b*tan(pi/2.-t)/2.*a
  else: return a*a*b - a*a*tan(t)/2.*a
  
th_p, th_n = pi/2, 0.
for i in range(100000):
  th_m = (th_p + th_n)/2.
  err = f(a,b,th_m) - x
  if err**2 < eps**2: break
  elif err < 0: th_p = th_m
  else: th_n = th_m
print(180/pi*th_m)

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

string solve(vector<int>& v, int k)
{
	bool dp[k + 1];
	memset(dp, 0, sizeof(dp));

	for (int i = 1; i <= k; i++)
	{
		for (int move : v)
		{
			if (move > i)
			{
				continue;
			}

			if (dp[i - move] == 0)//means for winning state
			{
				//cout << i - move << " " << dp[i - move] << " " << i << " " << dp[i] << " ";
				dp[i] = 1;
				//cout << dp[i] << endl;
			}
		}
		//cout << dp[i] << "\n";
	}
	return dp[k] ? "First" : "Second";
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n, k;
	cin >> n >> k;
	std::vector<int> v(n );
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
	}
	cout << solve(v, k);
}

Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll a, b;
  cin >> a >> b;
  ll x = 1, ans = 0;
  while (x < b) {
    x += a - 1;
    ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
X, Y, A, B, C = list(map(int, input().split()))
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

arr = []
for p in P:
  arr.append((p, 0))
for q in Q:
  arr.append((q, 1))
for r in R:
  arr.append((r, 2))
arr.sort()

remain = X + Y
ret = 0
while remain > 0:
  a, t = arr.pop()
  if t == 0 and X > 0:
    X -= 1
    remain -= 1
    ret += a
  elif t == 1 and Y > 0:
    Y -= 1
    remain -= 1
    ret += a
  elif t == 2:
    remain -= 1
    ret += a
print(ret)

Measured memory_bytes: 110180
#define TEST_MODE true

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i)
#define range(i, a, b, c) for (int i = a;             \
                               c > 0 ? i < b : i > b; \
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long

#ifdef LOCAL_ENV

#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << endl
#else
const bool test = false;
#define dump(x) 
#endif

#else
const bool test = false;
#define dump(x) 
#endif

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }

//.....................
const int MAX = (int)2e5 + 5;

vector<string> split(const string &str, char sep)
{
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while (getline(ss, buffer, sep))
    {
        v.push_back(buffer);
    }
    return v;
}

template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
    return accumulate(begin, end, 0ll);
}

void solve();

class Solver {
public:
    int N;
    string S;

    void solve() {
        cin >> N >> S;
        int cnt = 0;
        rrep(i, S.size()) {
            if (S[i] == ')') cnt++;
            else if (S[i] == '(') {
                if (cnt > 0) cnt--;
                else S += ')';
            }
        }
        string tmp;
        rep(i, cnt) tmp += "(";
        S = tmp + S;
        cout << S << endl;
    }
};

signed main()
{
    cout << fixed << setprecision(20);
    auto ptr = new Solver();
    ptr->solve();
    delete ptr;
    // while (true) {    
    //     auto ptr = new Solver();
    //     ptr->solve();
    //     delete ptr;
    // }
    return 0;
}

// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;
 
// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;
 
// #define cin mycin
// #define cout mycout
// #define endl '\n'




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

using namespace std;

int main(){
    long long int N,K,ans=0;
    cin >> N >> K;

    if(K==0){
        ans -= N;
    }
    for(int b=1;b<=N;b++){
        long long int p = N/b,r = N%b;
        ans += p*max((long long int)0,b-K);
        ans += max((long long int)0,r-K+1);
    }

    cout << ans << endl;
}

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

int main()
{
    int n;
    cin >> n;
    int arr[n];
    for(int i=0;i<n;i++)
    cin >> arr[i];
    long long int ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            ans+=arr[i]*arr[j];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>

using namespace std;

int main()
{
    int a,b,c,check[100]={0},t=0;
    cin>>a>>b>>c;
    t=a%b;
    for(int i=1;;i++)
    {
        if(t==c){printf("YES");break;}
        else if(check[t]){printf("NO");break;}
        check[t]=1;
        t=t+a;
        t=t%b;
    }
}


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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int day, sumptn = 0;
		int N = sc.nextInt();
		int K = sc.nextInt();
		int[] plan = new int[N];
		int[][] pattern = new int[N][6];
		for(int i = 0; i < K; i++) {
			day = sc.nextInt();
			plan[day-1] = sc.nextInt();
			}
		if(plan[0] == 0) {pattern[0][0]=1; pattern[0][1]=1; pattern[0][2]=1;}
		else if(plan[0] == 1) pattern[0][0] = 1;
		else if(plan[0] == 2) pattern[0][1] = 1;
		else if(plan[0] == 3) pattern[0][2] = 1;
		
		for(int i= 1; i < N; i++) {
			for(int k = 0; k < 6; k++) sumptn += pattern[i-1][k]%10000;
				if(plan[i] == 0) {
					for(int j = 0; j < 6; j++) {
					if(j<3) pattern[i][j] = (sumptn-pattern[i-1][j]-pattern[i-1][j+3])%10000;
					else pattern[i][j] = pattern[i-1][j-3];
					}
				} else if(plan[i] == 1){
					pattern[i][0] = (sumptn-pattern[i-1][0]-pattern[i-1][3])%10000;
					pattern[i][3] = pattern[i-1][0];
				} else if(plan[i] == 2) {
					pattern[i][1] = (sumptn-pattern[i-1][1]-pattern[i-1][4])%10000;
					pattern[i][4] = pattern[i-1][1];
				} else if(plan[i] == 3) {						
					pattern[i][2] = (sumptn-pattern[i-1][2]-pattern[i-1][5])%10000;
					pattern[i][5] = pattern[i-1][2];
				}
				sumptn = 0;
				if(i == N-1) for(int k = 0; k < 6; k++) sumptn += pattern[N-1][k]%10000;
		}
		System.out.println(sumptn%10000);
	}
}

Measured memory_bytes: 19692
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>

using namespace std;

int main(){
    int N;
    vector<int> L;
    
    cin >> N;
    for(int i = 0; i < N; i++){
        int sub;
        cin >> sub;
        L.push_back(sub);
    }
    
    sort(L.begin(), L.end());
    
    int sum = 0;
    for(int i = 0; i < N-1; i++){
        sum += L[i];
    }
    
    if(sum > L[N-1]){
        cout << "Yes\n";
    }
    else{
        cout << "No\n";
    }
}

Measured memory_bytes: 256
# C - Back and Forth
def main():
    sx, sy, tx, ty = map(int, input().split())

    rx = tx - sx
    ry = ty - sy

    ans = []

    # path1
    for _ in range(ry):
        ans.append('U')
    for _ in range(rx):
        ans.append('R')

    # path2
    for _ in range(ry):
        ans.append('D')
    for _ in range(rx):
        ans.append('L')

    # path3
    ans.append('L')
    for _ in range(ry+1):
        ans.append('U')
    for _ in range(rx+1):
        ans.append('R')
    ans.append('D')
    
    # path4
    ans.append('R')
    for _ in range(ry+1):
        ans.append('D')
    for _ in range(rx+1):
        ans.append('L')
    ans.append('U')
    
    print(''.join(ans))


if __name__ ==  "__main__":
    main()

Measured memory_bytes: 9228
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0 
for i in range(a+1) :
    for j in range(b+1) :
        for k in range(c+1) :
            if 500 * i + 100 * j + 50 * k == x :
                cnt += 1
print(cnt)

Measured memory_bytes: 3316