import java.util.Arrays; import java.util.Random; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } Random rnd=new Random(); boolean f(int[] A,int[] B,double PA,double PB) { int N=A.length; int sum=0; boolean[] a_used=new boolean[N]; boolean[] b_used=new boolean[N]; for (int i=0;iPA && i!=N-1) { int k=1+rnd.nextInt(N-1-i);//1...,N-i while (k!=0) { ++u; if (!a_used[u]) --k; } } if (pb>PB && i!=N-1) { int k=1+rnd.nextInt(N-1-i); while (k!=0) { ++v; if (!b_used[v]) --k; } } if (A[u]>B[v]) { sum+=A[u]+B[v]; } else { sum-=A[u]+B[v]; } a_used[u]=true; b_used[v]=true; } return sum>0; } void run() { Scanner sc=new Scanner(System.in); int N=sc.nextInt(); double PA=sc.nextDouble(); double PB=sc.nextDouble(); int[] A=new int[N]; int[] B=new int[N]; for (int i=0;i