import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
var d = new Documental();
d.run();
}
}
class P {
public static void p(Object o){
System.out.println(o);
}
public static void p(Object[] o){
int i = 0;
for(Object e : o){
p("[" + i + "] => " + e);
i++;
}
}
public static void p(int[] o){
int i = 0;
for(int e : o){
p("[" + i + "] => " + e);
i++;
}
}
}
/* 10人が1pずつ+主催者が1pの合計11pを奪い合う。平均化の統計 */
class Documental {
public Random random = new Random();
public void resetArray(int[] a){
int len = a.length;
for(int i=0; i<len; i++){
a[i] = 0;
}
}
public void round(int[] fighters){
// 参加人数
int len = fighters.length;
// 賞金額
int reward = len + 1;
// 参加費を払う
for(int i=0; i<len; i++){
fighters[i]--;
}
// 勝者を決定する
int winnerId = random.nextInt(10);
// 賞金獲得
fighters[winnerId] += reward;
}
public void run(){
// 参加者 => 獲得ポイント
var fighters = new int[10];
resetArray(fighters);
// 開催回数
int times = 10000;
// 戦う
for(int i=0; i<times; i++){
round(fighters);
}
// 単位の注釈
P.p("単位 : [100万円]");
// 結果発表
P.p(fighters);
// 獲得賞金の合計
dispSum(fighters);
}
public void dispSum(int[] fighters){
int sum = 0;
for(int e : fighters){
sum += e;
}
P.p("sum : " + sum);
}
}