akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(a==7&&b==5&&c==5)
    {
        cout<<"YES"<<endl;
    }
    else if(a==5&&b==7&&c==5)
    {
       cout<<"YES"<<endl;
    }
    else if(a==5&&b==5&&c==7)
    {
        cout<<"YES"<<endl;
    }
    else

        cout<<"NO"<<endl;

    return 0;
}


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

int main() {
  int N,N1,S=0;
  cin >> N;
  N1 = N;
  do
    S+=(N1%10);
  while(N1/=10);
  if(N%S)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  // ここにプログラムを追記
}


Measured memory_bytes: 3600
#include<stdio.h>
#include<math.h>
int main (){
  int number;
  int i;
  int list[10000];
  scanf("%d",&number);
  for(i=0;i<number;i++){
    scanf("%d",&list[i]);
  }
  printf("%d\n",prime(list,number));
  return 0;
}
int prime(int l[],int n){
  double judge[10000];
  int i;
  int j;
  int result=0;
  for(i=0;i<n;i++){
    judge[i]=sqrt(l[i]);
    if(l[i]<2);
    else if(l[i]==2){
      result++;
    }
    else if(l[i]%2==0);
    else{
      result++;
      for(j=3;j<=judge[i];j+=2){
	if(l[i]%j==0){
	  result--;
	  break;
	}
      }
    }
  }
  return result;
}
  
  



Measured memory_bytes: 2084
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;




//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)





int main() {
	int n;
	cin >> n;
	int i = 1;
	while (i*i <= n) {
		i++;
	}
	cout <<fixed<< (int)pow(i-1,2) << endl;

	return 0;
}



Measured memory_bytes: 256
N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i >= B + 1])
 
if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

Measured memory_bytes: 3064
#include<cstdio>
using namespace std;
inline int min(int a, int b) {
	return a > b ? b : a;
}
int main(int argc, char const *argv[]) {
	int h, w, n;
	scanf("%d%d%d", &h, &w, &n);
	int c1, c2;
	c1 = (n % h == 0) ? n / h : n / h + 1;
	c2 = (n % w == 0) ? n / w : n / w + 1;
	printf("%d\n", min(c1, c2) );
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  int num = 0;
  rep(i, S.size())
  {
    if (S[i] == '+')
      num++;
    else
      num--;
  }

  cout << num << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

string s;

int solve() {
    string cf = "CODEFESTIVAL2016";
    int l = cf.size();
    int res = 0;
    for (int i = 0; i < l; i++)
        res += s[i] != cf[i];
    return res;
}

void input() {
    cin >> s;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


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

unsigned long long sumformula(string str, unsigned long long total) {
  if(str.size() == 0) {
    return total;
  }
  unsigned long camt = 0;
  for(uint i = 1; i <= str.size(); i++) {
     camt += sumformula(str.substr(i, str.size() - i), total + stoul(str.substr(0, i).c_str()));
  }

  return camt;
}

int main() {
  string str;

  cin >> str;

  unsigned long long total = 0;
  cout << sumformula(str, total) << endl;
}


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

using namespace std;
using ll = long long;
typedef pair<int, int> ii;
typedef vector<ii> vii; 
typedef vector<int> vi;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0);
	
	int i = 1, temp;
	while(true) {
		cin >> temp;
		if(temp == 0) {
			cout << i << endl;
			break;
		}
		i++;
	}
	
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>

using namespace std;

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

    long long res = 1;

    int r = 0, g = 0, b = 0;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        res *= (r == a ? 1 : 0) + (g == a ? 1 : 0) + (b == a ? 1 : 0);
        res %= 1000000007;

        if (r == a) {
            r++;
        } else if (g == a) {
            g++;
        } else if (b == a) {
            b++;
        }
    }

    cout << res << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
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; }

int main() {
    int n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    sort(all(a));
    vector<ll> sum(n+1, 0);
    rep(i, n) sum[i+1] = sum[i] + a[i];

    int ans = 1;
    int i = n - 1;
    while (i >= 0) {
        if (a[i] <= 2 * sum[i]) {
            i--;
            ans++;
        } else {
            break;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1920
import java.io.*;
import java.util.*;
class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		//Buffered
		int t = 1;
		// t = Integer.parseInt(reader.readLine());
		// long[] list = Arrays.stream(reader.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
		for(int u = 0;u<t;u++){
			long[] list = Arrays.stream(reader.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
			long N = list[0];
			long X = list[1];
			long T = list[2];
			System.out.println((N+X-1)/X * T);
		}
	
	}
	
}
class pair implements Comparable<pair>{
		long a = 0;
		int b = 0;
		public pair(long a,int b){
			this.a = a;
			this.b = b;
		}
		@Override
		public int compareTo(pair p){
			if(this.a == p.a) return -(Integer.compare(this.b,p.b));
			else return -(Long.compare(this.a,p.a));
		}
		@Override
		public String toString(){
			return a+" "+b;
		}
	}

Measured memory_bytes: 34400
p=*0..gets.to_i
s=0
f=->a{a!=p[a]?p[a]=f[p[a]]:a}
$<.map(&:split).transpose.sum([]){|a|i=0
(x,i),*y=a.map{[_1.to_i,i+=1]}.sort
y.map{[-x+x=_1,i,i=_2]}}.sort.map{a=f[_2]
b=f[_3]
a!=b&&(s+=_1
p[b]=a)}
p s

Measured memory_bytes: 54464
#include"bits/stdc++.h"

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	cin >> N;

	double ans = 0.0, A;
	for (int i = 1; i <= N; i++)
	{
		cin >> A;
		ans += 1.0 / A;
	}
	ans = 1.0 / ans;
	cout << setprecision(16)<< ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<set>
#include<queue>
#include<algorithm>
#include<stack>
#include<cmath>
#include<map>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
const int N=55;
int d[8][2]={-1,0,0,-1,0,1,1,0,1,1,-1,-1,-1,1,1,-1};
char a[N][N];
struct point
{
     int x,y;
};
point t,b;
 int h,w;
 int m[55][55];
 int sum=0,num;
 void bfs(int f,int e)
 {
     queue<point>s;
     t.x=f;
     t.y=e;
     s.push(t);
    while(!s.empty())
     {
         b=s.front();
         s.pop();
         for (int i=0;i<4;i++)
         {
             t.x=b.x+d[i][0];
             t.y=b.y+d[i][1];
             if (t.x>=0&&t.x<h&&t.y>=0&&t.y<w&&a[t.x][t.y]!='#'&&!m[t.x][t.y])
            {
                 m[t.x][t.y]=m[b.x][b.y]+1;
                 s.push(t);
             }
         }
    }
 }

int main()
{
    scanf("%d%d",&h,&w);
    for(int i=0;i<h;i++)
        scanf("%s",&a[i]);
    if(a[0][0]=='#')
    {
        printf("-1\n");
        return 0;
    }
    m[0][0]=1;
    for(int i=0;i<h;i++)
        for(int j=0;j<w;j++)
            if(a[i][j]=='.')sum++;
    bfs(0,0);
    if(m[h-1][w-1]==0)
        printf("-1\n");
    else printf("%d\n",sum-m[h-1][w-1]);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>

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

const long long INF = 1LL << 60;

long long h[100010];
long long dp[100010];

int main() {
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) cin >> h[i];

	for (int i = 0; i < 100010; i++) dp[i] = INF;

	dp[0] = 0;

	for (int i = 0; i < N; i++) {
		chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
		if (i > 1) chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
	}

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

	return 0;
}


Measured memory_bytes: 5204
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

//#include <cv.h>
//#include <highgui.h>
#include <stdlib.h>
#include <time.h>

#include <string>

const int MAX_K = 100050;
int N;
long long A, B, C, D;

int condition(const int n, const int m, const long long val) {
    long long lb = - D * n + (D + C) * m;
    long long ub = - C * n + (D + C) * m;

    if (lb <= val && val <= ub) {
        return 0;
    } else if (val < lb) {
        return 1;
    } else {
        return -1;
    }
}

int main(int argc, char **argv) {
    std::cin >> N >> A >> B >> C >> D;

    long long val = abs(B - A);

    if (condition(N-1, N-1, val) == 0 || condition(N-1, 0, val) == 0) {
        std::cout << "YES" << std::endl;
        return 0;
    }

    int lb = 0;
    int ub = N-1;

    while (lb + 1 < ub) {
        int mid = (lb + ub) / 2;
        int cond = condition(N-1, mid, val);

        if (cond == 0) {
            std::cout << "YES" << std::endl;
            return 0;
        } else if (cond == 1) {
            ub = mid;
        } else {
            lb = mid;
        }
    }

    if (condition(N-1, lb, val) == 0 || condition(N-1, ub, val) == 0) {
        std::cout << "YES" << std::endl;
        return 0;
    }

    std::cout << "NO" << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ull = long long unsigned;
using P = pair<int,int>;
const int INF=1001001001;
const int NMAX=8;
const int MOD=1000000007;
const int dbase=80*160;


int main(){
	ll n;
	cin>>n;
	ll ans=0;
	//cout<<n<<endl;
	rep(i,n+1){
//		cout<<i<<endl;
		if (i%3==0 or i%5==0) continue;

		ans+=i;
	//	cout<<ans;
	}
	cout<<ans;

}


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

using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<long long , long long >, null_type, less<pair<long long , long long>>, rb_tree_tag,
tree_order_statistics_node_update> ordered_setpair;

const int N = 2e5+5;

const int mod = 1e9 +7;

int n;
int k;
int ar[N];
long long prefix[N];
 ordered_setpair SS;
int main()
{
    cin >> n >> k;
    long long ans = 0;
    for(int i = 1; i <= n; i++){
        cin >> ar[i];
        prefix[i] = (prefix[i - 1] + ar[i]);
    }
    SS.insert(make_pair(0 , 0));
    for(long long i = 1; i <= n; i++){
        //cout << SS.order_of_key(make_pair(prefix[i] - i*k , 1e18)) << "\n";
        ans +=  SS.order_of_key(make_pair(prefix[i] - i*k , 1e18)) ;
        SS.insert({make_pair(prefix[i] - i*k , i)});

    }
    printf("%lld\n" , ans);

    return 0;
}

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

namespace AtCoderBeginnerContest157
{
	class Program
	{
		static void Main(string[] args)
		{
			var first = ReadIntArray();
			var second = ReadIntArray();
			var third = ReadIntArray();
			var n = ReadInt();

			var bingo1 = first;
			var bingo2 = second;
			var bingo3 = third;
			var bingo4 = new[] { first[0], second[0], third[0] };
			var bingo5 = new[] { first[1], second[1], third[1] };
			var bingo6 = new[] { first[2], second[2], third[2] };
			var bingo7 = new[] { first[0], second[1], third[2] };
			var bingo8 = new[] { first[2], second[1], third[0] };

			var numbers = new List<int>(n);
			for(var i = 0;i < n; i++)
			{
				numbers.Add(ReadInt());
			}

			if(bingo1.All(x => numbers.Contains(x)) 
				|| bingo2.All(x => numbers.Contains(x))
				|| bingo3.All(x => numbers.Contains(x))
				|| bingo4.All(x => numbers.Contains(x))
				|| bingo5.All(x => numbers.Contains(x))
				|| bingo6.All(x => numbers.Contains(x))
				|| bingo7.All(x => numbers.Contains(x))
				|| bingo8.All(x => numbers.Contains(x)))
			{
				Console.WriteLine("Yes");
			}
			else
			{
				Console.WriteLine("No");
			}
		}

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

		public static int[] ReadIntArray()
			=> Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

		public static long ReadLong()
			=> long.Parse(Console.ReadLine());

		public static long[] ReadLongArray()
			=> Console.ReadLine().Split().Select(x => long.Parse(x)).ToArray();

		public static string ReadString()
			=> Console.ReadLine();

		public static string[] ReadStringArray()
			=> Console.ReadLine().Split();
	}
}


Measured memory_bytes: 13396
import sys
input = sys.stdin.readline
from collections import deque

def main():
    N, M = map(int, input().split())

    AB = [0] * N
    for i in range(N):
        AB[i] = list(map(int, input().split()))

    AB = sorted(AB)

    have = 0
    price = 0
    while M != have:
        AB[0][1] -= 1
        price += AB[0][0]
        have += 1

        if AB[0][1] == 0:
            del AB[0]


    print(price)

main()

Measured memory_bytes: 28940
n = gets
slime = gets.chomp

slimes = slime.split("")
merged_slime = ""

slimes.each_with_index do |s, i|
  if i == 0
    merged_slime += s
    next
  end

  merged_slime += s if slimes[i-1] != s
end

puts merged_slime.size

Measured memory_bytes: 106300
#include<cstdio>
#include<iostream>

using namespace std;

int main(){
int A,B,C,D;
scanf("%d%d%d%d",&A,&B,&C,&D);
int tmpA=A*B,tmpB=C*D;
if(tmpA>tmpB)printf("%d\n",tmpA);
else printf("%d\n",tmpB);
return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace Codeforces
{
	internal class Template
	{
		private void Solve()
		{
			var n = cin.NextInt();
			var m = cin.NextInt();
			var count = new int[n + 1];
			for (var i = 0; i < m*2; i++)
			{
				count[cin.NextInt()]++;
			}
			if (count.All(x => x%2 == 0))
			{
				Console.WriteLine("YES");
			}
			else
			{
				Console.WriteLine("NO");
			}
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}

Measured memory_bytes: 17456
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long  ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;

bool comp(P a, P b) {
	if (a.first - a.second != b.first - b.second)return a.first - a.second > b.first - b.second;
	if (a.first != b.first)return a.first > b.first;
	return a.second > b.second;
}

void solve() {
	int n; cin >> n;
	vector<P> l,r;
	int sum = 0;
	rep(i, n) {
		string s; cin >> s;
		int mi = mod; int c = 0;
		int m = s.length();
		rep(j, m) {
			if (s[j] == ')')c--;
			else c++;
			mi = min(mi, c);
		}
		sum += c;
		if (c > 0) {
			l.push_back({ c,mi });
		}
		else {
			r.push_back({ c,mi });
		}
		//cout << " " << c << " " << mi << endl;
	}
	if (sum != 0) {
		cout << "No" << endl; return;
	}
	int cur = 0;
	int len = l.size();
	vector<bool> used(len, false);
	rep(i, len) {
		rep(j, len) {
			if (used[j])continue;
			if (l[j].second + cur >= 0) {
				used[j] = true;
				cur += l[j].first;
				break;
			}
		}
	}
	rep(i, len)if (!used[i]) {
		cout << "No" << endl; return;
	}
	sort(r.begin(), r.end(), comp);
	len = r.size(); used.clear(); used.resize(len, false);
	/*rep(i, len) {
		cout << r[i].first << " " << r[i].second << endl;
	}*/
	rep(i, len) {
		rep(j, len) {
			if (used[j])continue;
			if (r[j].second + cur >= 0) {
				used[j] = true;
				cur += r[j].first;
				break;
			}
		}
	}
	rep(i, len)if (!used[i]) {
		cout << "No" << endl; return;
	}

	cout << "Yes" << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(5);
	//while (cin >> w>>h>>n,n)solve();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 3224
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <numeric>
#include <climits>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
using ll = long long;
int main(){
    ll A, B;
    cin >> A >> B;
    int ans = 1;
    ll x = A;
    while(x * 2 <= B){
        x *= 2;
        ans++;
        //cout << x << endl;
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int k;
  cin >> k;
  rep(i, k) cout << "ACL";
  cout << endl;
  return 0;
}


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

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

    vector<pair<int, int>> v1(1e5+1);
    vector<pair<int, int>> v2(1e5+1);
    for(int i=0; i<n; i++){
        int in;
        cin>> in;
        if(i % 2 == 0){
            v1[in].first++;
            v1[in].second = in;
        }else{
            v2[in].first++;
            v2[in].second = in;            
        }
    }
    sort(v1.begin(), v1.end(), greater<pair<int, int>>());
    sort(v2.begin(), v2.end(), greater<pair<int, int>>());

    int cnt;
    if(v1[0].second != v2[0].second){
        cnt = v1[0].first + v2[0].first;
    }else{
        cnt = max(v1[0].first + v2[1].first, v1[1].first + v2[0].first);
    }

    cout<< n - cnt <<endl;
    return 0;
}

Measured memory_bytes: 4820
package main

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

const (
	defaultBufferSize = 1024
	maxBufferSize     = 1e6
	Mod               = 1e9 + 7
)

var sc = bufio.NewScanner(os.Stdin)

// sc.Buffer(make([]byte, defaultBufferSize), maxBufferSize)

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

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

func readInt64() int64 {
	sc.Scan()
	i, err := strconv.ParseInt(sc.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return int64(i)
}

func readfloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}

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

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

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func ModComb(n, k int) int {
	if k == 0 {
		return 1
	}
	x, y := n, k
	for i := 1; i < k; i++ {
		x = x * (n - i) % Mod
		y = y * (k - i) % Mod
	}
	inv := ModInv(y)
	return x * inv % Mod
}

func ModFact(x int) int {
	fact := 1
	for i := 1; i <= x; i++ {
		fact = fact * i % Mod
	}
	return fact
}

func ModInv(x int) int {
	return ModPow(x, Mod-2)
}

func ModPow(a, n int) int {
	res := 1
	for n > 0 {
		if n%2 != 0 {
			res = res * a % Mod
		}
		a = a * a % Mod
		n /= 2
	}
	return res
}

func pow(a, n int) int {
	if n == 0 {
		return 1
	}

	ans := 0
	if n%2 == 0 {
		ans = pow(a*a, n/2)
	} else {
		ans = a * pow(a*a, (n-1)/2)
	}
	return ans
}

func intSliceReverse(slice []int) []int {
	for i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {
		slice[i], slice[j] = slice[j], slice[i]
	}
	return slice
}

func stringReverse(str string) string {
	runes := []rune(str)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func primeFactorization(x int) map[int]int {
	result := make(map[int]int, 0)
	for i := 2; i*i <= x; i++ {
		for x%i == 0 {
			result[i]++
			x /= i
		}
	}
	if x != 1 {
		result[x]++
	}
	return result
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	for i := 2; i*i <= x; i++ {
		if i == x {
			continue
		}
		if x%i == 0 {
			return false
		}
	}
	return true
}

func main() {
	sc.Split(bufio.ScanWords)
	s := readString()

	check := true
	for i, v := range s {
		if i%2 == 0 {
			if v == 'R' || v == 'U' || v == 'D' {
				continue
			}
		} else {
			if v == 'L' || v == 'U' || v == 'D' {
				continue
			}
		}
		check = false
	}
	if check {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 640
char*p,r['~~'];w;i;main(h){for(;scanf("%d%d",&h,&w)*w++;i=!printf(h?"%d %d\n":"LOOP\n",(p-r)%w,(p-r)/w)){for(p=r;i<h;scanf("%s",r+i++*w));for(h*=w;*p>46&&--h;i=p-r)p+=*p%5?*p&8?*p<63?1:-w:w:-1;}}

Measured memory_bytes: 0
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    int a, b;
    char op;
    cin >> a >> op >> b;
    while(op!='?'){
        int c;
        if(op=='+') c=a+b;
        if(op=='-') c=a-b;
        if(op=='*') c=a*b;
        if(op=='/') c=a/b;
        cout << c << endl;
        cin >> a >> op >> b;
    }
    return 0;
}





Measured memory_bytes: 3096
import math
a, b, h, m = map(int, input().split())
pi = math.pi
xh = math.cos((0.5 - (h + m / 60) / 6) * pi) * a
yh = math.sin((0.5 - (h + m / 60) / 6) * pi) * a
xm = math.cos((0.5 - m / 30) * pi) * b
ym = math.sin((0.5 - m / 30) * pi) * b

print(math.sqrt((xh - xm) ** 2 + (yh - ym) ** 2))

Measured memory_bytes: 9504
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

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

    set<ll> st;

    if (n > 18000){
        FOR(i,1,30000){
            if (i % 2 == 0 || i % 3 == 0) st.insert(i);
        }
        for (int i = 6; st.size() > n; i += 6){
            st.erase(i);
        }
    }else if (n == 3){
        st.insert({2, 5, 63});
    }else if (n == 6){
        st.insert({2, 3, 4, 6, 9, 12});
    }else if (n < 8){
        int sum = 0;
        for (int i = 1; st.size() < n; i++){
            if (i % 2 != 0 && i % 3 != 0) continue;
            if (st.size() < n - 1){
                st.insert(i);
                sum += i;
            }else{
                if ((sum + i) % 6 == 0){
                    st.insert(i);
                    sum += i;
                }
            }
        }
    }else{
        int i = 0;
        for (; st.size() + 8 <= n; i += 12){
            st.insert(i + 2);
            st.insert(i + 3);
            st.insert(i + 4);
            st.insert(i + 6);
            st.insert(i + 8);
            st.insert(i + 9);
            st.insert(i + 10);
            st.insert(i + 12);
        }
        i += 6;
        for (; st.size() < n; i += 6){
            st.insert(i);
        }
    }

    ll sum = 0;

    for (ll x : st){
        printf("%lld ", x);
        sum += x;
    }
    cout << endl;

    // cout << sum % 6 << endl;
    // cout << st.size() << endl;

    return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <math.h>
 
using namespace std;
 
int main(void)
{
	int x,y,ans;
	cin>>x;
	ans=0;
	for(int i=1;i<=x;i++)
	{
		if(i%2==0)
			continue;
		y=0;
		for(int j=1;j<=sqrt(i);j++)
			if(i%j==0)
				y+=2;
		if(i==(int)sqrt(i)*(int)sqrt(i))
			y--;
		if(y==8)
			ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i=0; i<N; i++) cin >> a.at(i);
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  int res=0;
  for (int i=0; i<N; i++) {
    if (i % 2 == 0) res += a.at(i);
    else res -= a.at(i);
  }
  cout << res << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<queue>
#include<deque>
using namespace std;
typedef pair<int, int>P;
typedef pair<int, pair<int, int>>PP;
typedef long long ll;
ll inf = -1;
ll mod = mod = pow(10, 9) + 7;
int h, w;
char grid[2000][2000];
int u[2000][2000];
int d[2000][2000];
int r[2000][2000];
int l[2000][2000];
	int ans[2000][2000];
int main() {
	cin >> h >> w;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> grid[i][j];
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			d[i][j] = 0;
			ans[i][j] = 0;
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			r[i][j] = 0;
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			l[i][j] = 0;
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			u[i][j] = 0;
		}
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (grid[i][j] == '#') {
				u[i][j] = 0;
			}
			else if (i == 0) {
				u[i][j] = 1;
			}
			else {
				u[i][j] = u[i - 1][j] + 1;
			}
		}
	}
	for (int i = h - 1; i >= 0; i--) {
		for (int j = 0; j < w; j++) {
			if (grid[i][j] == '#') {
				d[i][j] = 0;
			}
			else if (i == h - 1) {
				d[i][j] = 1;
			}
			else {
				d[i][j] = d[i + 1][j] + 1;
			}
		}
	}
	for (int j = w - 1; j >= 0; j--) {
		for (int i = 0; i < h; i++) {
			if (grid[i][j] == '#') {
				r[i][j] = 0;
			}
			else if (j == w - 1) {
				r[i][j] = 1;
			}
			else {
				r[i][j] = r[i][j + 1] + 1;
			}
		}
	}
	for (int j = 0; j < w; j++) {
		for (int i = 0; i < h; i++) {
			if (grid[i][j] == '#') {
				l[i][j] = 0;
			}
			else if (j == 0) {
				l[i][j] = 1;
			}
			else {
				l[i][j] = l[i][j - 1] + 1;
			}
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			ans[i][j] = u[i][j] + d[i][j] + r[i][j] + l[i][j] - 3;
		}
	}
	int a = 0;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			a = max(ans[i][j], a);
		}
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 82304
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			String T = br.readLine();
			String P = br.readLine();

			if(P.length() <= T.length()){

				char T_array[] = T.toCharArray();
				char P_array[] = P.toCharArray();

				boolean Found = false,FLG;

				for(int start = 0; start < T.length(); start++){
					FLG = true;
					for(int i = 0; i < P.length(); i++){
						if(P_array[i] != T_array[(start+i)%T.length()]){
							FLG = false;
							break;
						}
					}
					if(FLG){
						Found = true;
						break;
					}
				}

				if(Found){
					System.out.printf("Yes\n");
				}else{
					System.out.printf("No\n");
				}

			}else{

				System.out.printf("No\n");
			}

		} catch (IOException e) {
			e.printStackTrace();
		}


	}
}


Measured memory_bytes: 24624
// 2019/09/01
// AtCoder Beginner Contest 139 - D

#include <bits/stdc++.h>
using namespace std;

int main(){
    // Input
    long long n;
    cin >> n;
    long long ans;

    // Calc
    ans = (n * (n - 1)) / 2;

    // Output
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), K = sc.nextInt();
		char[] li = sc.next().toCharArray();
		if(li[K-1] == 'A')li[K-1] = 'a';
		else if(li[K-1] == 'B') li[K-1] = 'b';
		else li[K-1] = 'c';
		System.out.println(String.valueOf(li));
	}
}

Measured memory_bytes: 22868
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N, a, b;
  cin >> N >> a >> b;
  ll passed = 0;
  string s;
  cin >> s;
  ll b_cnt = 1;
  for (int i = 0; i < N; i++) {
    if (s[i] == 'a') {
      if (passed < a + b) {
        cout << "Yes" << endl;
        passed++;
      } else {
        cout << "No" << endl;
      }
    }
    if (s[i] == 'b') {
      if (passed < a + b && b_cnt <= b) {
        cout << "Yes" << endl;
        passed++;
      } else {
        cout << "No" << endl;
      }
      b_cnt++;
    }
    if (s[i] == 'c') {
      cout << "No" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3740
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define int long long

struct Setup {
    Setup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} SETUP;

signed main() {
    int H, W, h, w;
    cin >> H >> W >> h >> w;
    int white = (H-h) * (W-w);
    cout << white << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n;
	cin >> n;
    int p[n];
    int ans=0;
    fr(i,n){
      cin >> p[i];
    }
    fro(i,1,n-1){
      if((p[i-1]<p[i]&&p[i]<p[i+1])||(p[i-1]>p[i]&&p[i]>p[i+1]))ans++;
    }
      cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
const int LIM = 1000010;
int mygcd(int a, int b){
    if(a < b){
        int t = a; a = b; b = t;
    }
    while(b){
        int r = a%b;
        a = b;
        b = r;
    }
    return a;
}

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];

    int gcd_a = a[0];
    for(int i = 1; i < n; i++) gcd_a = mygcd(a[i], gcd_a);

    if(gcd_a > 1){
        cout << "not coprime" << endl;
    }else{
        vector<int> is_prime(LIM);
        for(int i = 0; i < LIM; i++) is_prime[i] = i;
        for(int i = 2; i < LIM; i++){
            if(is_prime[i] == i){
                for(int j = 2; i*j < LIM; j++){
                    is_prime[i*j] = i;
                }
            }
        }

        bool is_pairwise = true;
        vector<bool> is_used(LIM, false);
        for(int i = 0; i < n; i++){
            int tmp = a[i];
            while(tmp > 1){
                int p = is_prime[tmp];
                if(is_used[p]){
                    is_pairwise = false;
                    break;
                }else{
                    is_used[p] = true;
                    while(tmp % p == 0) tmp /= p;
                }
            }
        }

        if(is_pairwise) cout << "pairwise coprime" << endl;
        else cout << "setwise coprime" << endl;
    } 
    return 0;
}

Measured memory_bytes: 11084
use std::io;
use std::f64::consts::PI;

fn main() {
    let numbers = input_number();
    let a = numbers[0];
    
    println!("{} {}", a * a * PI, 2.0 * a * PI);
}

#[allow(dead_code)]
fn input_number() -> Vec<f64> {
    let mut input = String::new();

    io::stdin().read_line(&mut input)
        .expect("Failed to read line");

    let vec: Vec<f64> = input
        .split_whitespace()
        .map(|x| x.parse().unwrap_or(0.0))
        .collect();
    vec
}



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

int main(void){
    int x[4], y[4], tmp1, tmp2;
    cin >> x[0] >> y[0] >> x[1] >> y[1];
    tmp1 = x[1] - x[0];
    tmp2 = y[1] - y[0];
    x[2] = x[1] - tmp2;
    y[2] = y[1] + tmp1;
    x[3] = x[2] - tmp1;
    y[3] = y[2] - tmp2;
    cout << x[2] << ' ' << y[2] << ' ' << x[3] << ' ' << y[3] << endl;
    return 0;
}

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

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

    stack<char> s;
    int ans = 0;
    for(const auto& c : S){
        if(!s.empty()){
            if(c != s.top()){
                ans += 2;
                s.pop();
            }else{
                s.emplace(c);
            }
        }else{
            s.emplace(c);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
    int arr[3];
    for(int i = 0 ; i < 3 ; ++i )
    cin>>arr[i];
    sort(arr,arr+3);
    cout<<arr[0]<<" "<<arr[1]<<" "<<arr[2]<<"\n";
    
    return 0;
}


Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,t; cin >> s >> t;
    sort(s.begin(),s.end());
    sort(t.begin(),t.end());
    string tD = t;
    for(int i = 0; i < t.size(); i++)
    {
        tD.at(i) = t.at(t.size() - i - 1);
    }
    if(tD > s)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); i++)
#define rep(i, n) rep2(i, 0, n)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const int INF = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS = 1e-10;
const int MOD = int(1e9)+7;
template<typename T> inline bool chmin(T& a, T b) {if(a>b) {a=b; return true;} return false;}
template<typename T> inline bool chmax(T& a, T b) {if(a<b) {a=b; return true;} return false;}
template<typename T> inline int Log2(T& x) {int k; for(k=0; (T(1)<<k)<=x; ++k); return k;} // number of binary digits


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

  ll ans = (x/500)*1000;
  ans += (x%500)/5*5;
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <map>
const int MOD = 1e9+7;
using namespace std;

int ctoi(char c){
	return c - '0';
}

long long dp[101][2][4];

int main(){
	string s;
	int k;
	cin >> s >> k;

	for (int i = 1; i <= s.length(); i++){
		dp[i][0][0] = 1;
	}
	dp[1][0][1] = max(ctoi(s[0])-1, 0);
	dp[1][1][1] = 1;
	for (int i = 2; i <= s.length(); i++){
		for (int j = 1; j <= k; j++){
			dp[i][0][j] = dp[i-1][0][j-1]*9 + dp[i-1][1][j-1]*max(ctoi(s[i-1])-1, 0) + dp[i-1][0][j];
			if (ctoi(s[i-1]) != 0){
				dp[i][0][j] += dp[i-1][1][j];
				dp[i][1][j] = dp[i-1][1][j-1];
			}else{
				dp[i][1][j] = dp[i-1][1][j];
			} 
		}
	}

	cout << dp[s.length()][0][k] + dp[s.length()][1][k] << endl;
	return 0;
}


Measured memory_bytes: 256
M=998244353;n,A,B,K=map(int,input().split());F=[1];a=0
for i in range(n):F+=[F[-1]*(n-i)*pow(i+1,M-2,M)%M]
for i in range(n+1):
 q,r=divmod(K-i*A,B)
 if(r==0)&(0<=q<=n):a+=F[i]*F[q]
print(a%M)

Measured memory_bytes: 73628
import sys
sys.setrecursionlimit(10**5 + 9)
from collections import defaultdict
dp=defaultdict(lambda:0)
n=int(input())
ar,br,cr=[0]*n,[0]*n,[0]*n

for i in range(n):
	ar[i],br[i],cr[i]=map(int,input().split())
if n==1:
	print(max(ar[0],br[0],cr[0]))
	exit()
def points(i,pv):
	if dp[(i,pv)] != 0:
		return dp[(i,pv)]
	if pv==1:
		x,y=br[i],cr[i]
		a,b=2,3
	elif pv==2:
		x,y=ar[i],cr[i]
		a,b=1,3
	else:
		x,y=ar[i],br[i]
		a,b=1,2
	if i==n-1:
		return max(x,y)
	ax=points(i+1,a)+x
	by=points(i+1,b)+y
	ans=max(by,ax)
	dp[(i,pv)]=ans
	return ans
p=points(1,1)+ar[0]
q=points(1,2)+br[0]
r=points(1,3)+cr[0]
print(max(p,q,r))

	
		



Measured memory_bytes: 238852
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
  static final int DIV = 1;
  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    String in = reader.readLine();
    final int input = Integer.parseInt(in);
    List<Long> arr = new ArrayList<>(input);
    int base = 2;
    for (long i = 1; i < 10; i++) {
      arr.add(i);
    }
    int size = 0;
    while (arr.size() < input) {
      long prev = arr.get(size);
      coutNumb(prev, input, arr);
      size++;
    }
    System.out.println(arr.get(input -1 ));
  }

  private static void coutNumb(long prev, int input, List<Long> arr) {
    long lastNumb = prev % 10;
    if(lastNumb > 0 && lastNumb < 9){
      addToArr(lastNumb -1, lastNumb+1, prev, arr, input);
    }else if(lastNumb == 0){
      addToArr(0, 1, prev, arr, input);
    }else if(lastNumb == 9){
      addToArr(8, 9, prev, arr, input);
    }
  }

  private static void addToArr(long i, long i1,long prev, List<Long> arr, int input) {
    long next = prev * 10;
    for(long j = i; j <= i1; j++) {
      arr.add(next + j);
      if(arr.size() > input) break;
    }
  }
}


Measured memory_bytes: 23892
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
s =  sys.stdin.readline().rstrip()

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

Measured memory_bytes: 5588
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)

void chmax(ll& a, ll b) { a = max(a, b); }
void chmin(ll& a, ll b) { a = min(a, b); }



int main() {
    int n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    map<ll, vector<int>> mp;
    rep(i, n) {
        mp[i-a[i]].push_back(i);
    }

    ll ans = 0;
    rep(i, n) {
        ll now = a[i] + i;
        auto itr = upper_bound(mp[now].begin(), mp[now].end(), i);
        int index = itr - mp[now].begin();
        ans += mp[now].size() - index;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 39084
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <iostream>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <chrono>
#include <random>
#include <time.h>
#include <iomanip>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define mt make_tuple
#define tii tuple<int,int,int>
#define pq priority_queue<ll>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define vecbl vector<bool>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string stin(){string s;cin>>s;return s;}

int main(){
    int n=in(),t=in();
    vector<pii> a(n+1);
    rep(i,n){
        int x=in(),y=in();
        a[i+1]=mp(x,y);
    }
    sort(ALL(a));
    vector<vector<pair<ll,int>>> dp(n+1,vector<pair<ll,int>>(t+1));
    fill(ALL(dp[0]),mp(0,0));
    rep(i,n){
        rep2(j,0,t){
            ll x;
            int y;
            if(j < a[i+1].first){
                x = dp[i][j].first;
                y = max(dp[i][j].second, a[i+1].second);
            }else if(dp[i][j].first < dp[i][j-a[i+1].first].first + a[i+1].second){
                x=dp[i][j-a[i+1].first].first + a[i+1].second;
                y=dp[i][j-a[i+1].first].second;
            }else{
                x = dp[i][j].first;
                y = max(dp[i][j].second,a[i+1].second);
            }
            dp[i+1][j] = mp(x,y);
        }
    }
    cout<<dp[n][t-1].first + dp[n][t-1].second<<endl;
}

Measured memory_bytes: 141184
import java.util.*;

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

        int N = sc.nextInt();
        int K = sc.nextInt();

        long ret = 0;

        if (K % 2 == 0) {
            ret += (long) Math.pow(N / K, 3);

            long tmp = N / (K / 2) - N / K;
            ret += (long) Math.pow(tmp, 3);
        } else {
            ret += (long) Math.pow(N / K, 3);
        }

        System.out.println(ret);

    }
}

Measured memory_bytes: 23252
#include <iostream>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <vector>
#include <string>
#include <map>
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
//#define rep(i, n) for(int (i) = 0, TmP = (n); (i) < (int)TmP ; ++(i))
//rep(i, v.size()) v[i]=i;
//#define int long long
#define asort(v, n) sort((v), (v + n)) //Using array
#define vsort(v) sort((v).begin(), (v).end()) // Using vector
#define vint vector<int>

using namespace std;

signed main(){
  string S, T;
  int N;
  cin >> N >> S >> T;

  rep(i, N){
    cout << S[i] << T[i];
  }
  cout << endl;
}


Measured memory_bytes: 256
import bisect
import collections
import itertools

def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [input() for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n,k=getints()
values=getint2d(n)

k -= 1

values = list(sorted(values))
now = -1

for a,b in values:
    now_s = now + 1
    now_e = now + b
    if now_s <= k <= now_e:
        print(a)
        break
    now += b


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

int main() {

    // cinを高速にするためのおまじない
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    //Write code below
    
    int a, b;
    
    cin >> a >> b;
    
    cout << max({a + b, a - b, a * b}) << endl;
}

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

pub 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 main() {
    let n = read::<usize>();
    let mut y:Vec<i64> = vec![0; n];

    for i in 0..n {
        y[i] = read::<i64>();
    }

    y.sort();

    let mut ans:f64 = y[0] as f64;
    for i in 1..n {
        ans = (ans + y[i] as f64) / 2.0;
    }

    println!("{}", ans)
}

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

int main() {
    int N, K, num = 1;
    cin >> N >> K;
    for(int i = 0; i < N; i++) {
        if(num * 2 >= num + K) {
            num += K;
        } else {
            num *= 2;
        }
    }
    cout << num << endl;
}

Measured memory_bytes: 256