import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; import java.util.stream.IntStream; /** * Created by nullzine on 2017/01/12. */ public class Main { public static void main(String[] args){ new Main().run(); } private void run(){ Scanner sc = new Scanner(System.in); int[] data = new int[Integer.parseInt(sc.nextLine())]; int k = Integer.parseInt(sc.nextLine()); for(int i=0;iavgResult[e]=calcAvgsub(permutations[e])); double ret = Double.MIN_VALUE; for(Result result:avgResult){ //System.out.println(result); if(retret[e]=genPattern(a,b,e)); return ret; } private String genPattern(int a,int b,int c){ String ret = ""; while(c!=0){ ret=(c%a)+ret; c/=a; } return complementStr(ret,b); } private String complementStr(String str,int limit){ for(int i=str.length();i list; public NumberGroup(){ list = new ArrayList<>(); } public void add(int n){ list.add(n); } public boolean isEmpty(){ return list.isEmpty(); } public double getAvarage(){ double ret = 0.0; for(int n:list){ ret+=n; } return ret/list.size(); } public String toString(){ StringBuilder sb = new StringBuilder(); sb.append("{"); for (int n:list){ sb.append(n+","); } sb.append("}"); return sb.toString(); } }