codeparrot/codecomplex huggingface dataset:
// Problem: 1159_B. Expansion coefficient of the array
// Time complexity: linear
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class Main {
    public static void main(String[] args)
    {
        Scanner stdin = new Scanner(System.in);
        /*int n = stdin.nextInt();
        for(int i = 0; i < n; i++)
        {
        	test(stdin);
        }*/
        test(stdin);
        stdin.close();
    }
    public static void test(Scanner stdin)
    {
    	int n = stdin.nextInt();
    	int min = Integer.MAX_VALUE;
    	for(int i = 0; i < n; i++)
    	{
    		int a = stdin.nextInt();
    		if((int)((1.0)*a/(Math.max(i, n - i - 1))) < min)
    		{ min = (int)((1.0)*a/(Math.max(i, n - i - 1))); }
    	}
    	System.out.println(min);
    }
}
// Problem: 976_C. Nested Segments
// Time complexity: nlogn
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

import static java.lang.Math.*;

public class Main2 {

    private FastScanner scanner = new FastScanner();

    public static void main(String[] args) {
        new Main2().solve();
    }

    private void solve() {

        int n = scanner.nextInt();


        int a[][] = new int[n][3];

        for (int i = 0; i < n; i++) {
            a[i][0] = scanner.nextInt();
            a[i][1] = scanner.nextInt();
            a[i][2] = i;
        }

        int l = -1, r = -1;

        Arrays.sort(a, (o1, o2) -> {
            if (o1[0] != o2[0]) {
                return o1[0] - o2[0];
            } else {
                return o2[1] - o1[1];
            }
        });

        int maxr = -1, maxi = -1;
        for (int i = 0; i < n; i++) {
            if (a[i][1] <= maxr) {
                l = a[i][2] + 1;
                r = maxi + 1;
                break;
            }
            if (a[i][1] > maxr) {
                maxi = a[i][2];
                maxr = a[i][1];
            }
        }

        System.out.println(l + " " + r);


    }

    boolean check(int cnt[][], int[] tcnt, int mid) {
        boolean ok = true;

        for (int j = 0; j < 27; j++) {
            if (cnt[mid][j] < tcnt[j]) {
                ok = false;
            }
        }
        return ok;
    }

    class Pair {
        int c, f;
    }

    class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        FastScanner() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();

        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        Integer[] nextA(int n) {
            Integer a[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                a[i] = scanner.nextInt();
            }
            return a;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
// Problem: 990_A. Commentary Boxes
// Time complexity: linear


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 *
 * @author Haya
 */
public class CommentaryBoxes {

    public static void main(String[] args) {
        
        FastReader in = new FastReader();
        
        long n = in.nextLong();
        long m = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();
        long total = 0;
        
        long val =(n%m);
        if (n%m != 0){
            
            long x = (val)*b;
            long y = (m-val)*a;
            
            total = Math.min(x, y);
        }
        System.out.println(Math.abs(total));
        
    }

    public static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String string = "";
            try {
                string = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return string;
        }

    }

}
// Problem: 909_C. Python Indentation
// Time complexity: quadratic
import java.util.*;

public class HelloWorld{

     public static void main(String []args){
        final long MOD = 1000000007;
        Scanner scan = new Scanner(System.in);
        int now = 1;
        int maxStatements = scan.nextInt();
        long[] dp = new long[maxStatements + 1];
        dp[now] = 1;
        while(maxStatements > 0)
        {
            String add = scan.next();
            if (add.equals("f"))
            {
                now++;
            }
            else
            {
                for (int k = 1; k <= now; k++)
                {
                    dp[k] = ((dp[k] + dp[k-1]) % MOD);
                }
            }
            maxStatements--;
        }
        System.out.println(dp[now]);
     }
}
// Problem: 1088_D. Ehab and another another xor problem
// Time complexity: logn
import java.util.*;

public class ehab4 {
    public static void main( String[] args ) {
        Scanner in = new Scanner( System.in );
	int a = 0, b = 0;
	System.out.println( "? 0 0 " );
	System.out.flush();
	int c = in.nextInt();
	for ( int i = 29; i >= 0; i-- ) {
	    System.out.println( "? " + ( a + ( 1 << i ) ) + " " + b );
	    System.out.flush();
	    int q1 = in.nextInt();
	    System.out.println( "? " + a + " " + ( b + ( 1 << i ) ) );
	    System.out.flush();
	    int q2 = in.nextInt();
	    if ( q1 == q2 ) {
		if ( c == 1 )
		    a += ( 1 << i );
		else if ( c == -1 )
		    b += ( 1 << i );
		c = q1;
	    }
	    else if ( q1 == -1 ) {
		a += ( 1 << i );
		b += ( 1 << i );
	    }
	    else if ( q1 == -2 )
		return;
	}
	System.out.println( "! " + a + " " + b );
	System.out.flush();
    }
}
// Problem: 528_A. Glass Carving
// Time complexity: nlogn
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {

	static void insert(TreeMap<Integer, Integer>map,int v,int d)
	{
		if(!map.containsKey(v))map.put(v, 0);
		map.put(v, d+map.get(v));
		if(map.get(v)==0)map.remove(v);
	}
	
	static void cut(TreeSet<Integer> cuts, TreeMap<Integer, Integer>segments,int v)
	{
		int upper = cuts.higher(v) , lower = cuts.lower(v);
		insert(segments, upper-lower, -1);
		insert(segments, upper-v, 1);
		insert(segments, v-lower, 1);
		cuts.add(v);
	}
	
	public static void main(String[] args) throws Throwable {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt(), h = sc.nextInt() , n = sc.nextInt();
		TreeSet<Integer> vCuts = new TreeSet<>() , hCuts = new TreeSet<>();
		TreeMap<Integer, Integer> vSegments = new TreeMap<>() , hSegments = new TreeMap<>();
		vCuts.add(0);vCuts.add(w);
		hCuts.add(0);hCuts.add(h);
		insert(vSegments, w, 1);
		insert(hSegments, h, 1);
		StringBuilder sb = new StringBuilder();
		while(n-->0)
		{
			if(sc.next().equals("H"))
				cut(hCuts, hSegments, sc.nextInt());
			else
				cut(vCuts, vSegments, sc.nextInt());
			sb.append(1l*hSegments.lastKey() * vSegments.lastKey() + "\n");
		}
		System.out.println(sb);
	}
	
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;
		public Scanner(InputStream s) {br = new BufferedReader(new InputStreamReader(s));}
		public Scanner(String file) throws FileNotFoundException {br = new BufferedReader(new FileReader(file));}
		public String next() throws IOException {while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();}
		public int nextInt() throws IOException {return Integer.parseInt(next());}
		public long nextLong() throws IOException {return Long.parseLong(next());}
		public String nextLine() throws IOException {return br.readLine();}
		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}
		public int[] nexIntArray() throws Throwable {
			st = new StringTokenizer(br.readLine());
			int[] a = new int[st.countTokens()];
			for (int i = 0; i < a.length; i++)a[i] = nextInt();
			return a;
		}
		public boolean ready() throws IOException {return br.ready();}
	}
}
// Problem: 1023_A. Single Wildcard Pattern Matching
// Time complexity: linear
import java.util.Scanner;

//import java.util.Scanner;




public class SingleWildcard {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input =new Scanner(System.in);
		int a = input.nextInt();
		int b = input.nextInt();
		char[] s1 =new char[a];
		s1 = input.next().toCharArray();
		
		char[] s2 = new char[b];
		s2 = input.next().toCharArray();
	    boolean condition = false;
	    for(int i=0; i<a;i++){
	    	if(s1[i]=='*'){
	    		condition= true;
	    		break;
	    	}
	    }
	   
	    if(!condition){
	    	if(match(s1,s2)){
	    		System.out.println("YES");
	    		
	    	}
	    	else
	    		System.out.println("NO");
	       return;
	    }
	    else{
	    	int i=0;
	    	if(s1.length-1>s2.length){
	    		System.out.println("NO");
	    		return;
	    	}
	    	while(i<s1.length && i<s2.length && s1[i]==s2[i]){
	    		i++;
	    	}
	    	int j=s2.length-1;
	    	int k = s1.length-1;
	    	while(j>=0 && k>=0 &&  s1[k]==s2[j] && i<=j){
	    		j--;
	    		k--;
	    	}
	    	//System.out.println(i);
	    	if(i==k && i>=0 && i<s1.length && s1[i]=='*' ){
	    		System.out.println("YES");
	    		return;
	    	}
	    	System.out.println("NO");
	    }
		
		
	}
	
	static boolean match(char[] s1,char[] s2){
		if(s1.length!=s2.length)return false;
		for(int i=0; i<s1.length;i++){
			if(s1[i]!=s2[i])return false;
		}
		return true;
	}
	

}
// Problem: 1190_B. Tokitsukaze, CSL and Stone Game
// Time complexity: linear
import java.util.*;
public class Main{
    public static void main(String args[]){
     Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int a[]=new int[n];
    for(int i=0;i<n;i++)
    a[i]=sc.nextInt();
    Arrays.sort(a);
    //boolean 
    int t=1,c=0;
    for(int i=1;i<n;i++){
        if(a[i]==a[i-1])
        {
            if(i-2>=0&&a[i-2]==a[i-1]-1){
                System.out.println("cslnb");
                return;
            }
            c++;
        }
        if(a[i]==a[i-1]&&a[i]==0){
        System.out.println("cslnb");
        return;
        }
    }
    if(c>1)
    {
        System.out.println("cslnb");
        return;
    }
    for(int i=0;i<n;i++){
        if((a[i]-i)%2!=0)
        t=t^1;
    }
    if(t==1)
    System.out.println("cslnb");
    else
    System.out.println("sjfnb");
    
    
    
    }
    
}
// Problem: 1038_A. Equality
// Time complexity: linear
import java.util.*;

public class helloWorld 
{
	public static void main(String[] args) 
	{		
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		int[] ar = new int[200];
		
		String str = in.next();
		for(int i = 0; i < str.length(); i++)
			ar[ str.charAt(i) ]++;
			
		int ans = 100000;
		
		for(int i = 'A'; i < 'A' + m; i++)
			ans = Math.min(ans, ar[i]);
		ans *= m;
		
		System.out.println(ans);
		
		in.close();
	}
}
// Problem: 1075_A. The King's Race
// Time complexity: constant
 
 


import java.util.Scanner;
import javafx.geometry.Point2D;

 
public class ChessKing {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long size = input.nextLong();
long a = input.nextLong();
long b = input.nextLong();
  long sum = a+b;
   long d = sum-2;
   long d1 = size*2 - sum;
if(d<d1) System.out.println("White");
else if(d>d1) System.out.println("Black");
else System.out.println("White");


    }
    
}
// Problem: 1061_D. TV Shows
// Time complexity: nlogn
import java.util.*;
import java.io.*;
public class A
{
      public static void main(String ar[]) throws Exception
      {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            String s1[]=br.readLine().split(" ");
            int n=Integer.parseInt(s1[0]);
            long x=Long.parseLong(s1[1]);
            long y=Long.parseLong(s1[2]);
            long S=0;
            long mod=1000000007;
            B a[]=new B[n];
            TreeMap<Long,Long> tm=new TreeMap<Long,Long>();
            long ans[]=new long[n];
            for(int i=0;i<n;i++)
            {
              String s2[]=br.readLine().split(" ");
              long l=Long.parseLong(s2[0]);
              long r=Long.parseLong(s2[1]);
              B b1=new B(l,r);
              a[i]=b1;
            }
            Arrays.sort(a,new The_Comp());
            
            for(int i=0;i<n;i++)
            {
                  long l=a[i].x;
                  long r=a[i].y;
                  if(tm.floorKey(l-1)!=null)
                  {
                        long u=tm.floorKey(l-1);
                        long v=l;
                        if((v-u)*y<x)
                        { ans[i]=((r-u)*y)%mod; 
                          if(tm.get(u)>1)
                           tm.put(u,tm.get(u)-1);
                          else
                          tm.remove(u); 
                        }
                        else
                        { ans[i]=(x+(r-l)*y)%mod; }
                  }
                  else
                   ans[i]=(x+(r-l)*y)%mod;
                  S=(S+ans[i])%mod;
                  if(tm.containsKey(r))
                   tm.put(r,1+tm.get(r));
                  else
                   tm.put(r,(long)1);
            }
            System.out.println(S);
      }
}


class The_Comp implements Comparator<B>
{
      public int compare(B b1,B b2)
      {
            if(b1.x>b2.x)
             return 1;
            else if(b1.x==b2.x)
            {
            if(b1.y>b2.y)
             return 1;
            else if(b1.y==b2.y)
             return 0;
            else
             return -1;
            }
            else
             return -1;
      }
}
class B
{
      long x=(long)1;
      long y=(long)1;
      public B(long l1,long l2)
      { x=l1;  y=l2; }
}
// Problem: 1100_C. NN and the Optical Illusion
// Time complexity: constant


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class e {

public static class FastReader {
	BufferedReader br;
	StringTokenizer st;
	//it reads the data about the specified point and divide the data about it ,it is quite fast
	//than using direct 

	public FastReader() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception r) {
				r.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());//converts string to integer
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (Exception r) {
			r.printStackTrace();
		}
		return str;
	}
}
static ArrayList<String>list1=new ArrayList<String>();
static void combine(String instr, StringBuffer outstr, int index,int k)
{
	if(outstr.length()==k)
	{
		list1.add(outstr.toString());return;
	}
	if(outstr.toString().length()==0)
	outstr.append(instr.charAt(index));
    for (int i = 0; i < instr.length(); i++)
    {
        outstr.append(instr.charAt(i));
       
        combine(instr, outstr, i + 1,k);
        outstr.deleteCharAt(outstr.length() - 1);
    }
   index++;
} 
static ArrayList<ArrayList<Integer>>l=new ArrayList<>();
static void comb(int n,int k,int ind,ArrayList<Integer>list)
{
	if(k==0)
	{
		l.add(new ArrayList<>(list));

		return;
	}
	
	
	for(int i=ind;i<=n;i++)
	{
		list.add(i);
		comb(n,k-1,ind+1,list);
		
		list.remove(list.size()-1);
		
	}
	
	
	
	
	

}


public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	FastReader in=new FastReader();
	HashMap<Integer,Integer>map=new HashMap<Integer,Integer>();

	int n=in.nextInt();
	int r=in.nextInt();
	 
	double theta=(double)360/(double)n;
	 
	double b=1-((double)2/(double)(1-Math.cos((double)2*Math.PI/(double)n)));
	double x=Math.sqrt(1-b)-1;
	double ans=(double)r/(double)x;
	System.out.println(ans);





	}
}
// Problem: 5_D. Follow Traffic Rules
// Time complexity: constant
import java.util.*;
public class D5 {
public static void main(String[] args)
{
    Scanner input = new Scanner(System.in);
    int a = input.nextInt(), v = input.nextInt();
    int l = input.nextInt(), d = input.nextInt(), w = input.nextInt();
    double lo = 0, hi = v;
    for(int iter = 0; iter < 1000; iter++)
    {
        double mid = (lo+hi)/2;
        if(can(mid, a, d, w)) lo = mid;
        else hi = mid;
    }
    //System.out.println(lo);
    double t1 = lo / a;
    double gone = .5 * t1 * t1 * a;
    if(lo > w)
    {
        gone += -a * .5 * (lo - w) / a * (lo - w) / a + lo * (lo - w) / a;
        t1 += (lo - w) / a;
    }
    t1 += (d - gone) / lo;
    //System.out.println(t1);
    double v0 = Math.min(lo, w);
    double togo = l - d;
    double toAdd = (-v0 + Math.sqrt(v0 * v0 + 4 * togo * .5 * a)) / a;
    if(toAdd * a + v0 > v)
    {
        double tt = (v - v0) / a;
        t1 += tt;
        togo -= .5 * a * tt * tt + v0 * tt;
        t1 += togo / v;
    }
    else t1 += toAdd;
    System.out.println(t1);
}
static boolean can(double v, double a, double d, double max)
{
    double t1 = v / a;
    double distGone = .5 * a * t1 * t1;
    if(v > max)
    {
        t1 = (v - max) / a;
        distGone += -.5 * a * t1 * t1 + v * t1;
    }
    return distGone <= d;
}
}
// Problem: 909_D. Colorful Points
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class D909 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] line = br.readLine().toCharArray();
        int n = line.length;

        int l = 0;
        ArrayList<Node> groups = new ArrayList<>();
        Node node = new Node(line[0], 1);
        groups.add(node);
        for (int i = 1; i < n; i++) {
            if (line[i] == groups.get(l).letter) {
                groups.get(l).count++;
            } else {
                node = new Node(line[i], 1);
                groups.add(node);
                l++;
            }
        }

        int moves = 0;
        ArrayList<Node> temp = new ArrayList<>();
        while (groups.size() > 1) {
            moves++;

            l = groups.size();
            groups.get(0).count--;
            groups.get(l - 1).count--;
            for (int i = 1; i < l - 1; i++) {
                groups.get(i).count -= 2;
            }

            int p;
            for (p = 0; p < l; p++) {
                if (groups.get(p).count > 0) {
                    temp.add(groups.get(p));
                    break;
                }
            }
            int lTemp = temp.size();
            for (p++; p < l; p++) {
                if (groups.get(p).count <= 0) {
                    continue;
                }
                if (groups.get(p).letter == temp.get(lTemp - 1).letter) {
                    temp.get(lTemp - 1).count += groups.get(p).count;
                } else {
                    temp.add(groups.get(p));
                    lTemp++;
                }
            }

            groups.clear();
            groups.addAll(temp);
            temp.clear();
        }

        System.out.println(moves);
    }

    private static class Node {
        char letter;
        int count;

        Node(char letter, int count) {
            this.letter = letter;
            this.count = count;
        }
    }
}
// Problem: 1037_C. Equalize
// Time complexity: linear
import java.util.*;
import java.io.*;
public class X
{
	public static void main(String args[])throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s1 = br.readLine();
		String s2 = br.readLine();
		int i=0;
		char c1,c2;
		int cost = 0;
		while(i<n)
		{
			c1 = s1.charAt(i);
			c2 = s2.charAt(i);
			if(c1 != c2)
			{
				if((i+1)<n && s1.charAt(i+1) != s2.charAt(i+1) && s1.charAt(i) != s1.charAt(i+1))
				{
					cost +=1;
					i++;
				}
				else
				{
					cost +=1;
				}
			}
			i++;
		}
		System.out.println(cost);
	}
}
// Problem: 608_C. Chain Reaction
// Time complexity: linear
import java.util.Scanner;

public class ChainReaction {
	
	public static void main(String [] args) {
		Scanner kb = new Scanner(System.in);
		int num = kb.nextInt();
		
		int[] beacons = new int[1000002];
		for (int i=0; i<num; i++) {
			beacons[kb.nextInt()] = kb.nextInt();
		}
		
		int [] dp = new int[1000002];
		int max = 0;
		if (beacons[0] != 0)
			dp[0] = 1;
		
		for (int i=1; i<dp.length; i++) {
			if (beacons[i] == 0) {
				dp[i] = dp[i-1];
			} else {
				int index = i-1-beacons[i];
				if (index<0)
					dp[i] = 1;
				else
					dp[i] = 1 + dp[index];
			}
			max = Math.max(max, dp[i]);
			//if (i<11)
				//System.out.println(i +" is "+dp[i]);
		}
		
		System.out.println(num-max);
	}

}
// Problem: 909_B. Segments
// Time complexity: linear
import java.util.*;
import java.io.*;
public class A{
       
       public static void main(String args[]){
              Scanner sc = new Scanner(System.in);
              int n = sc.nextInt();
              int ans = 0;
              for(int i = 1; i <= n; i++){
                     ans += ((i*2) <= n) ? i : n-i+1;
              }
              System.out.println(ans);
       }
}