akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>

int main(void)
{
  int a,b,c,x,i,j,k,counter=0;
  scanf("%d %d %d %d",&a,&b,&c,&x);
  for(i=0;i<=a;i++)
    {
      for(j=0;j<=b;j++)
	{
	  for(k=0;k<=c;k++)
	    {
	      if(x == 500*i+100*j+50*k)
		{
		  counter++;
		}
	    }
	}
    }
  printf("%d\n",counter);
  return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
int main(void){
    int a,b,d,r;
    double f;
    scanf ("%d %d",&a,&b);
    
    d=a/b;
    r=a%b;
    f=(double)a/(double)b;
    
    printf("%d %d %f",d,r,f);
    
    return 0;
}



Measured memory_bytes: 2104
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 k = sc.nextInt();
        int[] n = new int[100];

        int max = Math.max(a, b);
        int cnt = 0;
        for (int i = 1; i <= max; i++) {
            if (a % i == 0 && b % i == 0)
                n[cnt++] = i;
            else
                continue;
        }
        
        System.out.println(n[cnt - k]);
    }
}


Measured memory_bytes: 21844
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //????????????????????????????????°
            int j = 3;
            //????????????????????????int?????????????????°x?????£??\
            int x = int.Parse(Console.ReadLine());
            //????????????Pow??????????????????????¨??????????????????°ans?????£??\
            int ans = (int)Math.Pow(x, j);
            //???????????¨???
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 9424
#include"bits/stdc++.h"
using namespace std;
struct _ { ios_base::Init i; _() { cin.sync_with_stdio(0); cin.tie(0);cout<<fixed<<setprecision(10); } } ___;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}

#define pii pair<int,int>
#define ff first
#define ss second
#define endll '\n'

using ll = long long int;
using intt = long long int;

int main()
{
    ll a,b,c,d;cin>>a>>b>>c>>d;
    for(int i=1;;i++)
    {
        if(i&1) c -=b;
        else a -=d;

        if(a<=0 or c<=0) break;

    }

    if(a<=0) cout<<"No"<<endll;
    else cout<<"Yes"<<endll;
}


Measured memory_bytes: 3640
n = int(input())
import numpy as np
a = np.array([int(input()) for _ in range(n)])
M = max(a)
if np.sum(a==M) >= 2:
  [print(M) for _ in range(n)]
else:
  result = [M]*n
  result[np.argmax(a)] = sorted(a)[-2]
  [print(i) for i in result]

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/02/24  Problem: ABC 119 C / Link: http://abc119.contest.atcoder.jp/tasks/abc119_c  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL ans = 0LL;

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	LL N; cin >> N;
	VL target(3);
	FOR(i, 0, 3) {
		cin >> target[i];
	}
	VL a(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}
	LL S = 1;
	FOR(i, 0, N)S *= 4;

	auto f = [](const VL& a, LL A) {
		if (SZ(a)) {
			return (SZ(a) - 1) * 10 + abs(A - accumulate(ALL(a), 0LL));
		}
		else {
			return LINF;
		}
	};
	ans = LINF;
	FOR(s, 0, S) {
		LL ss = s;
		VVL se(4);
		FOR(i, 0, N) {
			se[ss % 4].push_back(a[i]);
			ss /= 4;
		}
		LL ret = 0;
		FOR(i, 0, 3) {
			ret += f(se[i], target[i]);
		}
		if (SZ(se[3]) != N)
			ans = min(ans, ret);
	}
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <vector>
#include <algorithm>
#include <time.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  int L[N],R[N];
  int Rq,Lp,p,q;
  int ab[N][2];
  Rq =1000000000;
  Lp =0;
  int distmax=0;

  clock_t start = clock();

  for(int i=0;i<N;i++){
    cin >> L[i] >> R[i];
    if(L[i] > Lp){
      Lp =L[i];
      p = i;
    }
    if(R[i] < Rq){
      Rq=R[i];
      q = i;
    }
    distmax = max(distmax,R[i]-L[i]+1);
  }
  //cout << "dainyuu "<< clock()-start << "\n";
  start =clock();
  for(int i=0;i <N;i++){
    ab[i][1]=max(R[i]-Lp+1,0);
    ab[i][0]=max(Rq-L[i]+1,0);
  }
  int ans1=0;
  //cout << "ab "<< clock()-start << "\n";
  start =clock();

  if(Rq- Lp >= 0) ans1= Rq-Lp+1+distmax;
  ans1=max(ans1,distmax);
  using item = pair<int,int>;
  for(int i=0;i <N;i++){
  //  cout << ab[i][0] <<" " << ab[i][1]<<"\n";
  }
  sort((item*)ab[0],(item*)ab[N],[](item x, item y){if(x.first == y.first){return x.second > y.second;}else return x.first < y.first;});
  //cout << "sort "<< clock()-start << "\n";
  start =clock();

  //int minb[N];
  //int mina[N];
  int mn=ab[0][1];
  int ans2=0;
  int flag=0;
  int backmin =0;
  int i,j;
  for(i=0;i<N;i++){
  //  if(flag==0){
    ans2 =max(ans2,ab[i][0]+mn);
    mn =min(mn,ab[i][1]);
    //  cout << ab[i][0] << " " << ab[i][1] << "\n";
    //  for(j=i+2;j<N;j++){
      //  if(min > ab[j][1]){
        //  min =ab[j][1];
      //  }
      //}
    //  flag=1;
    //}
    //if(ab[i+1][1] == min){
      //flag=0;
    //}
  }
  // for(int i=0;i<N;i++){
  //   if(flag==0){
  //     min =ab[N-1][1];
  //     for(int j=N-2;j>i;j--){
  //       if(min > ab[j][1]){
  //         min =ab[j][1];
  //       }
  //       if(backmin ==min){
  //         break;
  //       }
  //     }
  //     flag=1;
  //   }
  //   if(ab[i+1][1] == min){
  //     flag=0;
  //   }
  //   backmin = min;
  //   if(ans2 <ab[i][0]+min){
  //     ans2 =ab[i][0]+min;
  //   }
  // }
  //cout<< "dainyuu " << (double)(clock()-start)/ (double)CLOCKS_PER_SEC << "\n";
  start =clock();
  cout << max(ans1,ans2) << "\n";
}


Measured memory_bytes: 1792
x1, y1, x2, y2 = gets.split.map(&:to_i)
 
x3 = x2+y1-y2
y3 = y2 + x2 - x1
y4 = y1 + x2 - x1
x4 = x1+y1-y2
puts [x3, y3, x4, y4].join(' ')

Measured memory_bytes: 1916
N = int(input())

H_list = list(map(int, input().split()))


max_move=0

now_move=0

for i in range(N-1):
        if H_list[i] >= H_list[i+1]:
                now_move+=1
                if max_move < now_move:
                        max_move = now_move
        else:
                now_move=0


print(max_move)

Measured memory_bytes: 14224
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int c = Integer.parseInt(sc.next());
    int d = Integer.parseInt(sc.next());
    out.println(max(a*b,c*d));
}}

Measured memory_bytes: 21844
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


int main(){
    int N; cin >> N;
    vector<Pi> A(N);
    rep(i,N) cin >> A[i].first,A[i].second = i;
    sort(A.begin(),A.end());
    rep(i,N){
        if(i) cout << " ";
        cout << A[i].second+1;
    }
    cout << endl;
}



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

#define Int long long;

int main()
{
    int N;
    cin>>N;
    int n = ceil((-1 + sqrt(1 + 8 * N)) / 2);
    int t = n * (n + 1) / 2 - N;
    for(int i=1;i<=n;i++) if(i != t) cout<<i<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
typedef long long ll;
typedef vector<ll> vl;
#define rp(i, f, t) for (long long int i = f; i < t; i++)
#define pr(i, f, t) for (long long int i = t - 1; i >= f; i--)
#define ca(n, a) rp(ca_i, 0, n) cout << a[ca_i] << ((ca_i == n - 1) ? "\n" : " ")
#define ia(n, a) rp(ia_i, 0, n) cin >> a[ia_i]
#define za(n, a) rp(za_i, 0, n) a[za_i] = 0
#define be(a) a.begin(), a.end()
#define ce(a) cout << (a) << endl
int main()
{
    string s, t;
    cin >> s >> t;
    ll ans = 0;
    rp(i, 0, s.size())
    {
        if (s[i] != t[i])
            ans++;
    }
    ce(ans);
}

Measured memory_bytes: 3928
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,n,c1=1,s=0;
  cin >> N;
  for (int i=0;i<9;i++){
    c1 *= 10;
    n = (N % c1) / (c1 / 10);
    s += n;
  }
  if (N % s == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int x,n;
  cin>>x>>n;
  vector<int>d(102);
  rep(i,n){
    int a;
    cin>>a;
    d[a]++;
  }
  P ans(99999,-1);
  for(int i=0;i<=101;i++){
      if(d[i]==1) continue;
      int dif=abs(i-x);
      ans=min(ans,P(dif,i));
  }
  cout<<ans.sc<<endl;
}

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

int A[500005];
int B[500005];

signed main(){
  
  string s;
  cin >> s;
  
  int n = (int)s.size();
  
  int cnt = 0;
  
  for(int i=0;i<n;i++){
    
    if( s[i] == '<' ){
      
      if( i == 0 ) cnt = 0;
      else if( s[i-1] == '>' ) cnt = 0;
      
      A[i] = max( A[i], cnt );
      A[i+1] = max( A[i+1], cnt+1 );
      cnt++;
      
    }
    
  }
  
  cnt = 0;
  
  for(int i=n;i>0;i--){
    
    if( s[i-1] == '>' ){
      
      if( i - 1 == n - 1 ) cnt = 0;
      else if( s[i] == '<' ) cnt = 0;
      
      B[i] = max( B[i], cnt );
      B[i-1] = max( B[i], cnt+1 );
      cnt++;
      
    }
    
  }
  
  int ans = 0;

  for(int i=0;i<=n;i++){
    ans += max( A[i], B[i] );
  }

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


Measured memory_bytes: 8708
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

int n;

int a[100010];
int b[100010];
int c[100010];

int fa[100010];
int fb[100010];
int fc[100010];

int main()
{
	scanf("%d", &n);
	
	for (int i = 1 ; i <= n ; i++)
		scanf("%d%d%d", &(a[i]), &(b[i]), &(c[i]));
		
	fa[0] = 0;
	fb[0] = 0;
	fc[0] = 0;
	
	for (int i = 1 ; i <= n ; i++)
	{
		//a
		fa[i] = fb[i - 1] + a[i];
		if (fa[i] < (fc[i - 1] + a[i]))
			fa[i] = (fc[i - 1] + a[i]);
			
		//b
		fb[i] = fa[i - 1] + b[i];
		if (fb[i] < (fc[i - 1] + b[i]))
			fb[i] = (fc[i - 1] + b[i]);

		//c
		fc[i] = fa[i - 1] + c[i];
		if (fc[i] < (fb[i - 1] + c[i]))
			fc[i] = (fb[i - 1] + c[i]);
	}
	
	int max = -1;
	if (max <= fa[n])
		max = fa[n];
	if (max <= fb[n])
		max = fb[n];
	if (max <= fc[n])
		max = fc[n];
		
	printf("%d\n", max);
	
	return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
int num;
double x,yy1,yy2,yy3,yy4;
const double eps = 1e-8;
const double inf = 1e20;
const double pi = acos(-1.0);
int sgn(double x){
    if(fabs(x)<eps){
        return 0;
    }
    if(x<0){
        return -1;
    }else{
        return 1;
    }
}
struct Point{
    double x,y;
    Point(){}
    void input(){
        scanf("%lf%lf",&x,&y);
    }
    Point(double _x,double _y){
        x = _x;y = _y;
    }
    bool operator < (Point b)const{
        return sgn(x-b.x)==0?sgn(y-b.y)<0:x<b.x;
    }
    Point operator - (const Point &b)const{
        return Point(x-b.x,y-b.y);
    }
    double operator *(const Point &b)const{
        return x*b.x+y*b.y;
    }
    double operator ^(const Point &b)const{
        return x*b.y-y*b.x;
    }
    double distance(Point p){
        return hypot(x-p.x,y-p.y);
    }
};
struct Line{
    Point s,e;
    Line(){}
    Line(Point _s,Point _e){
        s = _s;e = _e;
    }
    //求两直线的交点
    // 要保证两直线不平行或重合
    Point crosspoint(Line v){
        double a1 = (v.e-v.s)^(s-v.s);
        double a2 = (v.e-v.s)^(e-v.s);
        return Point((s.x*a2-e.x*a1)/(a2-a1),(s.y*a2-e.y*a1)/(a2-a1));
    }
};
int main(){
    int q;
    scanf("%d",&q);
    Point p0,p1,p2,p3;
    while(q--){
        p0.input();
        p1.input();
        p2.input();
        p3.input();
        Line line1(p0,p1);
        Line line2(p2,p3);
        Point ans = line1.crosspoint(line2);
        printf("%.10f %.10f\n",ans.x,ans.y);
    }
   
    return 0;
}



Measured memory_bytes: 3216
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	long long int n,m;
	cin >> n >> m;
	if(n==1){
		if(m==1) cout << 1 << endl;
		else cout << m-2 << endl;
	}else{
		if(m==1) cout << n-2 << endl;
		else cout << (m-2)*(n-2) << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll   long long int
void swap(int& a,int& b)
{
	int temp;
	temp=a;
	a=b;
	b=temp;
}
 int main()
{
ll n;
ll a;
cin>>n;
ll ans=1;
for(int i=0;i<n;i++)
{
	cin>>a;
	if(a==ans)
	 ans++;
}
if(ans==1)
 cout<<-1;
 else
 cout<<n-ans+1;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define reps(i,s,n) for(ll (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define reptr(i,n) for(ll (i)=(n);(i)>=0;--(i))
#define All(x) (x).begin(),(x).end()
#define Rall(a) (a).rbegin(), (a).rend()
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>
#define mp make_pair
#define pb push_back
const ll MOD=1e9+7;
const ll INF=1e10+1;
using namespace std;
#define NOT_EXIST -1

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

ll N,M,T;
bool used_side[105][105];
ll len[105][105];

vector<vector<ll> > adj;
vector<ll> A;
vector<ll> d;

void dijkstra(ll st){
  // マイナス距離,今の点,前の点
  priority_queue<pair<ll, ll> > PQ;
  vector<bool> used(N);
  for(ll i=0;i<N;i++){
    d[i] = INF;
    used[i] = false;
  }

  //startに行く距離は0
  d[st] = 0;
  PQ.push(make_pair(0,st));

  while(!PQ.empty()){
    pair<ll, ll> f = PQ.top(); PQ.pop();
    ll u = f.second;

    //最小値を取り出し、それが最短でなければ無視
    if(d[u] < f.first * (-1)) continue;

    for(ll j=0;j<adj[u].size();j++){
      ll v = adj[u][j];
      if(used[v]) continue;
      if(len[u][v] == NOT_EXIST) continue;
      if(d[v] > d[u] + len[u][v]){
        d[v] = d[u] + len[u][v];
        PQ.push(make_pair(d[v] * (-1), v));
      }
    }
  }
}


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

  //初期化
	d = vector<ll>(N);
	adj = vector<vector<ll>>(N);

  for(ll i=0;i<N;i++){
    for(ll j=0;j<N;j++){
      len[i][j] = NOT_EXIST;
      used_side[i][j] = false;
    }
  }

	for(ll i=0;i<M;i++){
		ll a,b,c;
		cin >> a >> b >> c;
		a--,b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
    len[a][b] = c;
    len[b][a] = c;
	}

  for(ll i=0;i<N;i++){
    dijkstra(i);
    for(ll j=0;j<N;j++){
      for(ll k=0;k<N;k++){
        if(len[k][j]==NOT_EXIST || len[j][k]==NOT_EXIST) continue;
        if(d[j] == d[k] + len[k][j] || d[k] == d[j] + len[j][k]){
          used_side[k][j] = true;
          used_side[j][k] = true;
        }
      }
    }
  }
  ll ans = 0;

  for(ll i=0;i<N;i++){
    for(ll j=i+1;j<N;j++){
      if(!used_side[i][j] && len[i][j]!=NOT_EXIST) ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 384
N=int(input())
A=list(map(int,input().split()))
cnt_1=0
cnt_2=0
sum_1=0
sum_2=0

for i in range(N):
    sum_1+=A[i]
    if i%2==1:
        if sum_1<=0:
            cnt_1+=1-sum_1
            sum_1=1
    else:
        if sum_1>=0:
            cnt_1+=sum_1+1
            sum_1=-1

for i in range(N):
    sum_2+=A[i]
    if i%2==1:
        if sum_2>=0:
            cnt_2+=sum_2+1
            sum_2=-1
    else:
        if sum_2<=0:
            cnt_2+=1-sum_2
            sum_2=1

print(min(cnt_1,cnt_2))

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


int solve(vector<int> &a,vector<vector<int>>&dp,ll k,int t)
{
  if(dp[k][t]>-1)
    return dp[k][t];

  int winner=-1;
  for(int i=0;i<a.size();i++)
  {
    if(a[i]<=k)
    {
      int win=solve(a,dp,k-a[i],1-t);
      if(win==t)
        winner=t;
    }
  }
  if(winner==-1)
      winner=1-t;
  return dp[k][t]=winner;
}

int main()
{
  ll n,k;
  cin>>n>>k;
  vector<int> a(n);
  for(int i=0;i<n;i++)
    cin>>a[i];
  vector<vector<int>>dp(k+1,vector<int>(2,-1));

  int p=solve(a,dp,k,0);
  if(p==0)
      cout<<"First\n";
  else
      cout<<"Second\n";
}


Measured memory_bytes: 16456
#include<iostream>
using namespace std;
int main(){
	int n;
	int a,b,c;
	int i,j,k;
	cin>>n;
	for(i=0,b=1,c=1;i<n;i++){
		cin>>a;
		if(a%2==0)b*=2;
		c*=3;
	}
	cout<<c-b<<endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
vector<ll>adj[100007];
int main()
{
    fastio;
   ll n=0,m=0;
   cin>>n>>m;
   ll h[n+1]={0};
   for(ll i=1;i<=n;++i) cin>>h[i];
    for(ll i=0;i<m;++i){
        ll u=0,v=0;
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    int ok[n+1]={0};
    for(ll i=1;i<=n;++i){
    bool f=true;
    for(auto j:adj[i]){
        if(h[j]>=h[i]){
            f=false;
            break;
        }
    }
    if(f) ok[i]=1;
    }
    ll c=0;
    for(ll i=1;i<=n;++i) if(ok[i]) ++c;
    cout<<c;
}

Measured memory_bytes: 10628
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int m = sc.nextInt();
        
        int[] a = new int[m+1];
        
        for(int i = 0; i < n; i++){
            int k = sc.nextInt();
            for(int j = 0; j < k; j++){
                a[sc.nextInt()]++;
            }
        }
       
       int res = 0;
       
       for(int i = 1; i <= m; i++){
           if(n == a[i]) res++;
       }
       
       System.out.println(res);
    }
}


Measured memory_bytes: 22228
#define _USE_MATH_DEFINES
#include <math.h>
#include <time.h>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <iomanip>
#include <iterator>
#include <algorithm>
#include <typeinfo>

using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define reprrev(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); i--)
#define reprev(i, n) reprrev(i, 0, n)

#define PI M_PI
#define INF 1000000000
#define MOD 1000000007;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<bool>> vvb;
typedef vector<vector<string>> vvs;

constexpr int dir[4][2] = { { -1, 0 }, { 0, -1 }, { 1, 0 }, { 0, 1 } };



int main()
{
	int X, Y;
	cin >> X >> Y;
	if (X % Y != 0) cout << X << endl;
	else cout << -1 << endl;



	return 0;
}


Measured memory_bytes: 256
import math

a,b,h,m=map(int, input().split())

min = h + m/60
hour = min/12
min = (min%1)*360
hour = (hour%1)*360

x = abs(min-hour)

if  360 - x < x:
    x = 360 - x

print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(x))))


Measured memory_bytes: 62424
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <math.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 10e+6

using namespace std;

int main(){
    long n;
    cin >>n;
    long a[n+10];
    rep(i,n) cin >>a[i+1];
    
    long b[n+10];
    //nが偶数
    if(n%2==0){
        long t=n/2;
        for(long i=0;i<t;i++){
            b[i+1]=a[n-2*i];
        }
        for(long i=1;i<=t;i++){
            b[i+t]=a[2*i-1];
        }
        for(long i=1;i<=n;i++){
            if(i!=n){
                cout << b[i] << " ";
            }
            else{
                 cout << b[i] << endl;
            }
        }
    }
    //nが奇数
    else{
        long t=n/2;
        for(long i=0;i<t+1;i++){
            b[i+1]=a[n-2*i];
        }
        for(long i=1;i<=t;i++){
            b[i+t+1]=a[2*i];
        }
        for(long i=1;i<=n;i++){
            if(i!=n){
                cout << b[i] << " ";
            }
            else{
                cout << b[i] << endl;
            }
        }
    }
}



Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,n,t;
    cin>>n>>a>>b;

        if( (b-a)%2==0)
        cout<<(b-a)/2;
        else{
            if(a-1>n-b)
                t=n-b;
            else
                t=a-1;


            cout<<t+1+(b-a)/2;}
}





Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

// int max: 2 x 10^9, long long max: 9 x 10^18

using namespace std;

int main()
{
  int a,b,c,d;
  cin >> a >> b >> c >> d;

  vector<long long> mul(4);

  mul[0] = (long long)a * (long long)c;
  mul[1] = (long long)a * (long long)d;
  mul[2] = (long long)b * (long long)c;
  mul[3] = (long long)b * (long long)d;

  long long max = LONG_MIN;
  for(int i=0; i<4; i++){
    if(max < mul[i]){
      max = mul[i];
    }
  }

  cout << max;

  return 0;
}

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

int main (void){
    ll N;
    unsigned long long K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i,N){
        cin >> A[i];
        A[i]--;
    }

    deque<int> a;                   //履歴のメモ，2重終端que
    vector<bool> Tripped(N,false);  //その町は既に訪れているか
    int tmp=0;  //0-index
    while(true){
        // 一度訪れた町にたどり着いた場合
        if(Tripped[tmp]){
            while(a[0] != tmp){
                // 閉路にたどり着くまでの数手を除く
                --K;
                a.pop_front();//キューの前から経路を抜いていく
                if(K == 0){
                    cout << a[0] + 1 << endl;
                    return 0;
                }
            }
            break;
        }
        //履歴を保存
        a.push_back(tmp);
        Tripped[tmp] = true;
        tmp=A[tmp]; //次の町
    }
    // a.size():閉路の大きさ
    cout << a[K % a.size()] + 1 << endl;
    return 0;
}

Measured memory_bytes: 5608
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
using ll = long long;

int main(){
    ll a,b,c,d,e,k,l,m,n,o=0,p,q,x,y,z,max1=0,ans;
    string s,t,u;
    cin>>a>>b>>c>>d>>e>>k;
    if(e-a<=k){cout<<"Yay!"<<endl;}
    else cout<<":("<<endl;
}




Measured memory_bytes: 256
#include<stdio.h>

int main(void) {
int a = 0, b = 0, x = 0, y = 0;
scanf("%d", &a);
scanf("%d", &b);

if (1 <= a && b <= 100) {
x = a * b;
y = 2 * a + 2 * b;
}
printf("%d %d\n", x, y);
}


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

int main() {
	int n,m,k=1;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		k = k * 2;
	}
	printf("%d", (100*(n-m)+ 1900*m)*k);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "Yes" << endl;
#define POK cout << "OK" << endl;
#define PNO cout << "No" << endl;
#define PNG cout << "NG" << endl;

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

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

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> l(n + 1);
  vector<int> r(n);
  l[0] = 0;
  repz(i, 1, n + 1) l[i] = max(l[i - 1], a[i - 1]);
  r[n] = 0;
  for (int i = n - 2; i >= 0; i--) r[i] = max(a[i + 1], r[i + 1]);
  repz(i, 0, n) cout << max(l[i], r[i]) << endl;
  return 0;
}


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

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::vector<long long> H){

  for(long long i = N-2; i >= 0; i--) {
    if (H[i] > H[i+1] + 1) {
         cout << NO << endl;
         return;
     }
    else if(H[i] == H[i+1] + 1) {
      H[i] = H[i+1];
    }
  }

  cout << YES << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
  scanf("%lld",&N);
  std::vector<long long> H(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&H[i]);
  }
    solve(N, std::move(H));
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
const int64_t INF =1e18;
int main () {
  int n1,n2,n3,n4;
  cin >> n1>>n2>>n3>>n4;
  
  if ((n1*n1 + n2*n2 + n3*n3 + n4*n4) == (1*1 + 7*7 + 9*9 + 4*4))
  {
    cout << "YES" << endl;
  }
  else
  cout << "NO" << endl;
}


Measured memory_bytes: 256
import java.io.PrintWriter
import kotlin.math.pow

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun Int.pow(n: Int) = pow(n.toLong())
fun Int.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()
fun Long.pow(n: Int) = pow(n.toLong())
fun Long.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val N = nextInt()
    var ans = 0L
    var a = 0
    repeat(N) {
        val A = nextInt()
        ans += (A + a) / 2
        a = if (A != 0) (A + a) and 1 else 0
    }
    println(ans)
}

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

int main(){
  ll n,ans=0;
  cin >> n;
  vector<ll>acm(n);
  for(int i=0; i<n; i++){
    ll a;
    cin >> a;
    if(i == 0) acm[i] = a;
    else acm[i] = acm[i-1] + a;
  }
  sort(acm.begin(),acm.end());
  ll now = acm[0],count = 0;
  
  for(int i=0; i<n; i++){
    if(acm[i] == 0){
      ans++;
    }
    if(acm[i] == now){
      count++;
    }else{
      ans += count*(count-1)/2;
      now = acm[i];
      count = 1;
    }
  }
  ans += count*(count-1)/2;
  
  cout << ans << endl;
  
}


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

using namespace std;

int main()
{
  int N, L;

  scanf("%d %d", &N, &L);

  string ans[N], s;

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

  sort(ans, ans + N);

  for (int i = 0; i < N; i++)
  {
    cout << ans[i];
  }
  cout << "\n";
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n,ans = 100000;
  cin >>n;
  while(n--){
    ans = (int)((double)ans*1.05);
    if(ans%1000>0) ans = (ans/1000+1)*1000;
  }
  cout <<ans<<endl;
  return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
int main(){
  unsigned x;
  int count1=0, count2=0;
  scanf("%u", &x);
  while(x>=500){
    x=x-500;
    count1++;
  }
  if(x>0){
    while(x>=5){
      x=x-5;
      count2++;
    }
  }
  printf("%d",count1*1000+count2*5);
  return 0;
}
  


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

public class Main {

    public static void main(String[] args) {

        int j = 0;

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

        try {
            int i = Integer.parseInt(br.readLine());
            if (0 <= i && i <= 100) {
                for (int k = 1; k <= i; k++) {
                    j = j + k;
                }
            }
            System.out.println(j);
        } catch (NumberFormatException | IOException e) {
        }
    }
}

Measured memory_bytes: 32668
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define pi 3.1415926536
#define loopj(n) for(int j=0;j<n;j++)
#define loopi(a,b,k) for(int i=a;i<b;i=i+k)
#define  deb(x) cout<<#x<<"  "<<x<<endl
int main()
{
	int n=0;
	cin>>n;
	int a[n];
	loopj(n)
	cin>>a[j];
	ll sum=0;
	loopi(1,n,1)
	{
		if(a[i]<a[i-1])
		{
		sum+=(a[i-1]-a[i]);
		a[i]+=(a[i-1]-a[i]);
	}
	}
	cout<<sum;
}

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

typedef long long int int64;

const int mod=1000000007;

int *fact=NULL;
int *iFact=NULL;
void init(const int n){
  fact=(int *)calloc(n+1,sizeof(int));
  iFact=(int *)calloc(n+1,sizeof(int));
  fact[0]=1;
  int i;
  for(i=1;i<=n;i++) fact[i]=(int64)i*fact[i-1]%mod;
  int t=1;
  int a=fact[n];
  while(a>1){
    t=(int64)t*(mod-mod/a)%mod;
    a=mod%a;
  }
  iFact[n]=t;
  for(i=n-1;i>=0;i--) iFact[i]=(int64)(i+1)*iFact[i+1]%mod;
}

int comb(int n,int k){
  if(!(0<=k && k<=n)) return 0;
  return (int64)fact[n]*iFact[n-k]%mod*iFact[k]%mod;
}

int calc(int k,int *r,int *c,int *dp,int n){
  if(dp[k]>=0) return dp[k];
  int local=comb(r[k]+c[k],r[k]);
  int i;
  for(i=0;i<n;i++){
    if(i==k) continue;
    if(r[i]>r[k] || c[i]>c[k]) continue;
    local=(local-(int64)calc(i,r,c,dp,n)*comb((r[k]-r[i])+(c[k]-c[i]),r[k]-r[i])%mod+mod)%mod;
  }
  dp[k]=local;
  return local;
}

void run(void){
  int h,w,n;
  scanf("%d%d%d",&h,&w,&n);
  init(h+w);
  int *r=(int *)calloc(n+1,sizeof(int));
  int *c=(int *)calloc(n+1,sizeof(int));
  int i;
  for(i=0;i<n;i++){
    scanf("%d%d",r+i,c+i);
    r[i]--;
    c[i]--;
  }
  r[n]=h-1;
  c[n]=w-1;
  int *dp=(int *)calloc(n+1,sizeof(int));
  for(i=0;i<=n;i++) dp[i]=-1;
  int ans=calc(n,r,c,dp,n+1);
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 1792
#include <cstring>
#include <cstdint>
#include <iostream>
#include <string>
#include <memory>
#include <queue>
#include <limits>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <sstream>
#include <random>
#include <functional>
#include<algorithm>
#include <array>
using namespace std;

int dx[4000], dy[4000];

int main() {
	for (size_t i = 0; i < 4000; i++)
	{
		dx[i] = dy[i] = 0;
	}

	bool bx = true;
	int ix = 0, iy = 0;
	string s;
	int x, y;
	cin >> s;
	cin >> x >> y;
	for (char c : s)
	{
		if (c == 'F') {
			if (bx)dx[ix]++;
			else dy[iy]++;
		}
		else if (c == 'T') {
			if (bx)ix++;
			else iy++;
			bx = !bx;
		}
	}
	unordered_set<int> beforep;
	unordered_set<int> nowp;
	nowp.insert(dx[0]);
	for (size_t i = 1; i < ix + 1; i++)
	{
		beforep.swap(nowp);
		nowp.clear();
		for (int p : beforep)
		{
			nowp.insert(p + dx[i]);
			nowp.insert(p - dx[i]);
		}
	}
	if (nowp.count(x) == 0) {
		cout << "No";
		goto End;
	}

	beforep.clear();
	nowp.clear();
	nowp.insert(0);
	for (size_t i = 0; i < iy + 1; i++)
	{
		beforep.swap(nowp);
		nowp.clear();
		for (int p : beforep)
		{
			nowp.insert(p + dy[i]);
			nowp.insert(p - dy[i]);
		}
	}
	if (nowp.count(y) == 0) {
		cout << "No";
		goto End;
	}

	cout << "Yes";
End:

	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int n,a,b,c;
int main()
{
 //freopen(".in","r",stdin);
 //freopen(".out","w",stdout);
 cin>>n>>a>>b>>c;
 if(n>a) cout<<a*b+(n-a)*c;
 if(n<=a) cout<<n*b;
 return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <bitset>
#include <stack>
#include <deque>
#include <set>
#include <unordered_set>
#include <list>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <climits>
#include <ctime>
#include <random>
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define eps 1e-9
#define inf 0x3f3f3f3f
#define mod 1000000007
using namespace std;

int main() {
	speed;
	char c;
	cin >> c;
	if (isupper(c))
		cout << 'A';
	else
		cout << 'a';
}

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

typedef long long ll;

#define REP(i, n) for(int i=0; i<(n); i++)
#define REPS(i, n) for(int i=0; i<=(n); i++)
#define FOR(i, a, b) for(int i=a; i<(b); i++)
#define FORS(i, a, b) for(int i=a; i<=(b); i++)
// for container x
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;

int main(){
    int n;
    cin >> n;
    vector<int> d(n);
    REP(i, n) cin>>d[i];

    int ans = 0;
    REP(i, n){
        FOR(j, i+1, n){
            ans+= d[i]*d[j];
        }
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		if( N%10==3 ){
			System.out.println("bon");
		}else if( N%10==0 || N%10==1 || N%10==6 || N%10==8 ){
			System.out.println("pon");
		}else{
			System.out.println("hon");
		}
	}
}

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

string a,b,c;
bool p1[40000],p2[40000],p3[40000];
bool*okab=&p1[20000],*okac=&p2[20000],*okbc=&p3[20000];

int main(){
	cin>>a>>b>>c;
	memset(p1,true,sizeof(p1));
	memset(p2,true,sizeof(p2));
	memset(p3,true,sizeof(p3));
	for(int i=-6000;i<=6000;i++){
		bool A=true,B=true,C=true;
		rep(j,a.size()){
			int k=j-i;
			if(0<=k&&k<b.size()&&a[j]!=b[k]&&a[j]!='?'&&b[k]!='?')A=false;
			if(0<=k&&k<c.size()&&a[j]!=c[k]&&a[j]!='?'&&c[k]!='?')B=false;
		}
		rep(j,b.size()){
			int k=j-i;
			if(0<=k&&k<c.size()&&b[j]!=c[k]&&b[j]!='?'&&c[k]!='?')C=false;
		}
		okab[i]=A;okac[i]=B;okbc[i]=C;
	}
	int Min=INT_MAX;
	for(int i=-5000;i<=5000;i++){
		for(int j=-5000;j<=5000;j++){
			if(okab[i]&&okac[j]&&okbc[j-i]){
				int l=min({0,i,j});
				int r=max({0+(int)a.size(),i+(int)b.size(),j+(int)c.size()});
				Min=min(Min,r-l);
			}
		}
	}
	cout<<Min<<endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define IL inline
#define rep(i,j,k) for(int i=j;i<=k;++i)
#define repd(i,j,k) for(int i=j;i>=k;--i)
#define pb push_back
#define db double
#define mp make_pair
#define mp3(a,b,c) mp(a,mp(b,c))
#define pii pair<int,int>
#define fr first
#define se second
#define ll long long 
#define pbc(x) __builtin_popcount(x)
IL int read(){int x;int _w=scanf("%d",&x);return x;}
IL void write(int x){printf("%d\n",x);}
template<typename T>IL void debug(T x){cerr<<x;return;}
const int maxn=1e5+10;
int n;
vector<int>ans[1000];
int main(){
	n=read();
	int k=-1;
	for(int i=1;i<=1000;++i){
		if(i*(i+1)/2==n){k=i;break;}
	}
	if(k==-1){puts("No");return 0;}
	puts("Yes");
	cout<<k+1<<endl;
	int cnt=0;
	rep(i,1,k)rep(j,i+1,k+1){
		cnt++;	
		ans[i].pb(cnt);
		ans[j].pb(cnt);
	}
	rep(i,1,k+1){
		cout<<k<<' ';
		for(int v:ans[i])printf("%d ",v);
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 2304
n = input().split()
a,b,c = map(int,n)
if a < b:
    pass
else:
    a,b = b,a
if b < c:
    pass
else:
    b,c = c,b
if a < b:
    pass
else:
    a,b = b,a
print(f"{a} {b} {c}")


Measured memory_bytes: 5612
n = gets.to_i

a_h = gets.split.map(&:to_i)
a_l = gets.split.map(&:to_i)

sum_h = Array.new(n + 1, 0)
sum_l = Array.new(n + 1, 0)

n.times do |i|
  sum_h[i + 1] = sum_h[i] + a_h[i]
  sum_l[i + 1] = sum_l[i] + a_l[i]
end

ans = 0

n.times do |i|
  c = sum_h[i + 1] + sum_l[n] - sum_l[i]
  ans = c if c >= ans
end

puts ans


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vvec<int> g(N);
    for(int i=0;i<N-1;i++){
        int a,b;
        cin >> a >> b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    int r = -1;
    for(int i=0;i<N;i++) if(g[i].size()>2){
        r = i;
        break;
    }
    if(r==-1){
        cout << 1 << "\n";
        return 0;
    }
    int ans = 0;
    auto dfs = [&](auto&& self,int cur,int par)->bool{
        int cnt = 0;
        int c = 0;
        if(g[cur].size()==1){
            return true;
        }
        for(auto& x:g[cur]) if(x!=par){
            c++;
            cnt += self(self,x,cur);
        }
        if(!cnt) return false;
        if(cnt==1 && c==1) return true;
        ans += cnt-1;
        return false;
    };
    dfs(dfs,r,-1);
    cout << ans << "\n";
}

Measured memory_bytes: 7424
// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;
#define rank tavas
#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define int long long
const int N = (int) 1e5 + 5, L = 20, mod = (int) 1e16 + 7, base = 727;
int h[N], pw[N], n;
string t;
int get_hash(int l, int r) {
    return (h[r] - (h[l] * 1ll * pw[r - l] % mod) + mod) % mod;
}
int sa[N], rank[N][L], lcp_table[N], ind[N], adr[N];
pair<int, int> value[N];
int a[N], b[N], c[N];

void radix_sort(int n) {
    memset(c, 0, sizeof c);
    for (int i = 0; i < n; ++i) c[value[a[i]].second]++;
    for (int i = 1; i < N; ++i) c[i] += c[i - 1];
    for (int i = 0; i < n; ++i) b[--c[value[a[i]].second]] = a[i];
    memset(c, 0, sizeof c);
    for (int i = 0; i < n; ++i) c[value[b[i]].first]++;
    for (int i = 1; i < N; ++i) c[i] += c[i - 1];
    for (int i = n - 1; i >= 0; --i) a[--c[value[b[i]].first]] = b[i];
}

void make_suffix_array() {
    for (int i = 0; i < n; ++i)
        rank[i][0] = t[i];    
    for (int g = 1; g < L; ++g) {
        for (int i = 0; i < n; ++i) {
            value[i] = make_pair(rank[i][g - 1], (i + (1 << g - 1)) < n? rank[i + (1 << g - 1)][g - 1]: 0);
            a[i] = i;
        }
        radix_sort(n);
        int cnt = 1;
        for (int i = 0; i < n; ++i) {
            cnt += (i > 0 && value[a[i]] != value[a[i - 1]]);
            rank[a[i]][g] = cnt;
            sa[i] = a[i];
        }
    }
}

int lcp(int a, int b) {
    int l = 0;
    for (int j = L - 1; j >= 0; --j) if (a < n && b < n)
        if (rank[a][j] == rank[b][j]) {
            a += 1 << j;
            b += 1 << j;
            l += 1 << j;
        }
    return l; 
}
int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> t; n = (int) t.size();
    make_suffix_array();
    int mx = 0;
    for (int i = 0; i < n - 1; ++i)
        mx = max(mx, lcp(sa[i], sa[i + 1]));
    cout << n - mx << endl;

}

Measured memory_bytes: 20816
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int w[N],ne[N],la[N],t,n,u,v,dep[N];
void link(int x,int y){
	w[++t]=y;
	ne[t]=la[x];
	la[x]=t;
}
int dfs(int x,int fa=0){
	int res=x;
	for (int y=la[x];y;y=ne[y]){
		int z=w[y];
		if (z==fa)continue;
		dep[z]=dep[x]+1;
		int z1=dfs(z,x);
		if (dep[z1]>dep[res])res=z1;
	}return res;
}
int cnt[N],tag[N];
int go(int x,int tar,int fa){
	if (x==tar){
		tag[x]=1;
		return 1;
	}
	for (int y=la[x];y;y=ne[y]){
		int z=w[y];
		if (z==fa)continue;
		dep[z]=dep[x]+1;
		if (go(z,tar,x)){
			tag[x]=1;
			return 1;
		}
	}return 0;
}
int a[N],b[N],t1;
int main(){
	cin>>n;
	for (int i=1;i<n;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		link(x,y);
		link(y,x);
	}
	int u=dfs(1),v=dfs(u);
	dep[u]=0;
	go(u,v,0);
	for (int x=1;x<=n;x++){
		if (tag[x])continue;
		int cnt1=0;
		for (int y=la[x];y;y=ne[y]){
			int z=w[y];
			if (tag[z])cnt1++,cnt[dep[z]]++;
		}
		if (cnt1!=1){
			cout<<-1<<endl;
			return 0;
		}
	}
	t=0;
	for (int i=0;i<=dep[v];i++){
		a[++t]=t;
		for (int j=1;j<=cnt[i];j++)
			a[++t]=t,swap(a[t],a[t-1]);
	}
	t=0;
	reverse(cnt,cnt+dep[v]+1);
	for (int i=0;i<=dep[v];i++){
		b[++t]=t;
		for (int j=1;j<=cnt[i];j++)
			b[++t]=t,swap(b[t],b[t-1]);
	}
	for (int i=1;i<=n;i++){
		if (a[i]<b[i])break;
		if (a[i]>b[i]){
			memcpy(a,b,sizeof a);
			break;
		}
	}
	for (int i=1;i<=n;i++)printf("%d ",a[i]);
}

Measured memory_bytes: 10880
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007

int main(){
   int n;
   cin >>n;
   int p[n],cnt=0,MIN=1000000;
   for(int i=0;i<n;i++){
      int p;
      cin >>p;
      if(p <= MIN){
         MIN =p;
         cnt++;
      }
   }

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

Measured memory_bytes: 256
#include <stdio.h>
#define ll long long
ll gcd(ll p,ll q){while(q){ll t=p%q;p=q;q=t;}return p;}
int main(){
	ll a,b;
	scanf("%lld%lld",&a,&b);
	ll d=gcd(a,b);
	int ans=1;
	for(ll i=2;i*i<=d;i++)if(d%i==0){
		ans++;
		while(d%i==0)d/=i;
	}
	printf("%d",ans+(d!=1));
}

Measured memory_bytes: 1676
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
    int N; cin >> N;
    vector<int> A(N);
    for (int &x : A) cin >> x;
    ll ans = 0, cnt = 0;
    int pt = 0;
    while (pt < N) {
        while (pt < N && A[pt] != 0) cnt += A[pt++];
        ans += cnt / 2;
        cnt = 0;
        pt++;
    }
    ans += cnt / 2;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
package main
import (
  "fmt"
  "math"
  "os"
)
func main() {
  var n,s,m int64
  fmt.Scan(&n)
  fmt.Scan(&s)
  if s == n {
    fmt.Println(n+1)
    os.Exit(0)
  }
  m = int64(math.Sqrt(float64(n)))
  for b:=int64(2);b<=m;b++ {
    if f(b,n) == s {
      fmt.Println(b)
      os.Exit(0)
    }
  }
  for p:=m;p>0;p-- {
    if (n-s)%p != 0 { continue }
    b := (n-s)/p+1
    if b < 2 { continue }
    if f(b,n) == s {
      fmt.Println(b)
      os.Exit(0)
    }
  }
  fmt.Println(-1)
}
func f(b int64,n int64) int64 {
  if n < b { return n }
  return f(b,n/b)+n%b
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ft first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=1e5+7;
static const ll MOD=1e9+7;
ll max(ll a, ll b) {return a>b?a:b;}
ll min(ll a, ll b) {return a<b?a:b;}

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

class segTree {
public:
  ll n, hei;
  vector<ll> dat;
  
  segTree(ll _n) {
    n=1;
    hei=1;
    while(n<_n) {
      n<<=1;
      hei++;
    }
    dat=vector<ll>(2*n-1, 0);
  }
  
  void update(ll i, ll x) {
    i+=n-1;
    dat[i]=x;
    while(i>0) {
      i=(i-1)/2;
      dat[i]=gcd(x, dat[i]);
    }
  }
  
  ll _getRes(ll a, ll b, ll k, ll l, ll r) {
    if(r<=a||b<=l) return 0;
    if(a<=l&&r<=b) return dat[k];
    else {
      ll s=_getRes(a, b, k*2+1, l, (l+r)/2);
      ll t=_getRes(a, b, k*2+2, (l+r)/2, r);
      return gcd(s, t);
    }
  }
  
  ll getRes(ll a, ll b) {
    return _getRes(a, b, 0, 0, n);
  }
  
};

int main(void) {
  ll N;
  cin >> N;
  ll i;
  
  segTree seg(N);
  for(i=0; i<N; i++) {
    ll a;
    cin >> a;
    seg.update(i, a);
  }
  
  ll ans=0;
  for(i=0; i<N; i++) {
    ll a=seg.getRes(0, i);
    ll b=seg.getRes(i+1, N);
    chmax(ans, gcd(a, b));
  }
  
  pt(ans);
  
}













Measured memory_bytes: 2304
#include <iostream>
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,a) for(ll i=0;i<a;i++)
#define jkl ll debug = 0;
#define RREP(i,a) for(ll i=a-1;i>=0;i--)
#define rrep(i,a,b) for(ll i=a-1;i>=b;i--)
#define printall(n,array) {for(ll i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> Pi;
typedef pair<ll, Pi> V;
typedef vector<ll> VE;
const ll mod = 1e9 + 7; //10^9+7

int main(){
    int n;
    int p[12];
    cin >> n;
    REP(i, n)cin >> p[i];
    int max_ = 0;
    REP(i, n){
        max_ = max(max_, p[i]);
    }
    ll ans = 0;
    REP(i, n){
        ans += p[i];
    }
    print(ans - max_ / 2);
}

Measured memory_bytes: 256
# C
import itertools
import sys


def dist(A, B):
    return((A[0] - B[0]) ** 2 + (A[1] - B[1]) ** 2) ** 0.5


n = int(input())

position = []
for _ in range(n):
    position.append(list(map(int, sys.stdin.readline().strip().split())))

distance = []
count = 0
for i in itertools.permutations(range(n)):
    for j in range(n - 1):
        distance.append(dist(position[i[j]], position[i[j + 1]]))
    count += 1

# print(count)
# print(distance)
print(sum(distance) / count)

Measured memory_bytes: 60784