package temp;
import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Random;
import java.util.Scanner;
public class Test {
public static void main
(String[] args
) { createData();
calcAverage();
}
static void calcAverage() {
try {
int sum = 0;
int count = 0;
while (true) {
if (line == null) {
break;
}
String[] columns
= line.
split(" "); sum
+= Integer.
parseInt(columns
[2]); count += 1;
}
}
}
}
System.
out.
println("average " + ((double)sum
/ count
)); }
}
static void createData() {
String[] familynames
= new String[] { "佐藤",
"中村",
"佐々木",
"林",
"齋藤",
"池田",
"小川",
"渡邉",
"遠藤",
"石田",
"和田",
"山崎",
"渡邊",
"工藤",
"松井",
"今井",
"木下",
"櫻井",
"久保",
"千葉",
"本田", "渡部", "山内", "西田", "高田", "南", "松下", "安田", "菅野", "高野", "石橋", "吉岡", "関", "澤田", "中原", "森本", "岡", "片岡", "中嶋", "上村", "鈴木", "伊藤", "吉田", "木村",
"前田", "長谷川", "村上", "藤原", "三浦", "原田", "中川", "金子", "上田", "内田", "小山", "村田", "野口", "大塚", "増田", "平田", "杉本", "水野", "松岡", "菊地", "石原", "島田", "西川",
"中田", "永井", "永田", "服部", "大島", "成田", "大山", "岩崎", "山中", "大橋", "浅野", "松永", "小澤", "田中", "小林", "松本", "清水", "山下", "橋本", "後藤", "青木", "近藤", "岡本", "太田",
"中野", "中山", "森田", "横山", "野村", "佐野", "平野", "齊藤", "東", "大西", "杉山", "中西", "古川", "辻", "斎藤", "大谷", "樋口", "望月", "土屋", "西山", "馬場", "黒田", "髙橋", "篠原",
"宮田", "大石", "松浦", "松村", "須藤", "山本", "山田", "山口", "森", "阿部", "岡田", "藤田", "松田", "小野", "西村", "竹内", "柴田", "宮本", "谷口", "市川", "上野", "武田", "川口", "菅原",
"宮崎", "菊池", "小島", "五十嵐", "吉川", "矢野", "高木", "田口", "大久保", "星野", "熊谷", "荒木", "桑原", "松原", "栗原", "白石", "北川", "小田", "青山", "早川", "河合", "高橋", "加藤",
"井上", "渡辺", "石川", "中島", "坂本", "石井", "藤井", "田村", "大野", "福田", "原", "酒井", "安藤", "藤本", "松尾", "河野", "丸山", "川上", "北村", "斉藤", "秋山", "新井", "飯田", "野田",
"久保田", "小松", "川村", "岩田", "堀", "岩本", "吉村", "福島", "小泉", "上原", "本間", "小池", "鎌田", "吉野", "足立", "片山", "安部", "天野", "中尾", "奥田", "川崎", "神谷", "松山", "前川",
"水谷", "金田", "町田", "児玉", "坂田", "岸本", "植田", "森山", "三上", "大川", "森川", "中谷", "堀内", "桜井", "川原", "川端", "谷川", "新田", "米田", "徳永", "岡野", "松島", "落合", "吉澤",
"平川", "福永", "榊原", "大木", "田上", "武井", "内藤", "尾崎", "奥村", "宮下", "牧野", "田代", "小笠原", "川島", "高山", "中澤", "横田", "大澤", "岩井", "村井", "坂井", "小倉" };
int manCount = 0;
int womanCount = 0;
HashSet<String> numbers = new HashSet<>();
try {
for (int i = 0; i < 30; i++) {
// create name
String personalname
= familynames
[random.
nextInt(familynames.
length)] + givennames
[random.
nextInt(givennames.
length)];
if (manCount > 15) {
personalname += "女";
womanCount += 1;
} else if (womanCount > 15) {
personalname += "男";
manCount += 1;
} else {
if (random.nextBoolean()) {
personalname += "女";
womanCount += 1;
} else {
personalname += "男";
manCount += 1;
}
}
// create number
do {
for (int j = 0; j < 6; j++) {
number
+= String.
valueOf(random.
nextInt(10)); }
} while (numbers.contains(number));
numbers.add(number);
// create score
int score = random.nextInt(101);
bw.write(personalname + " " + number + " " + score);
bw.newLine();
}
}
}
}
}
}
}
cGFja2FnZSB0ZW1wOwoKaW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBqYXZhLnV0aWwuQ29tcGFyYXRvcjsKaW1wb3J0IGphdmEudXRpbC5IYXNoU2V0OwppbXBvcnQgamF2YS51dGlsLlJhbmRvbTsKaW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIFRlc3QgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIGNyZWF0ZURhdGEoKTsKICAgICAgICBjYWxjQXZlcmFnZSgpOwogICAgfQogICAgCiAgICBzdGF0aWMgdm9pZCBjYWxjQXZlcmFnZSgpIHsKICAgICAgICB0cnkgewogICAgICAgICAgICBpbnQgc3VtID0gMDsKICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKCiAgICAgICAgICAgIHRyeSAoRmlsZUlucHV0U3RyZWFtIGZpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0oIi9ob21lL2IvRGVza3RvcC9kYXRhLnR4dCIpKSB7CiAgICAgICAgICAgICAgICB0cnkgKElucHV0U3RyZWFtUmVhZGVyIGlzciA9IG5ldyBJbnB1dFN0cmVhbVJlYWRlcihmaXMpKSB7CiAgICAgICAgICAgICAgICAgICAgdHJ5IChCdWZmZXJlZFJlYWRlciBiciA9IG5ldyBCdWZmZXJlZFJlYWRlcihpc3IpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbGluZSA9IGJyLnJlYWRMaW5lKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdbXSBjb2x1bW5zID0gbGluZS5zcGxpdCgiICIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VtICs9IEludGVnZXIucGFyc2VJbnQoY29sdW1uc1syXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudCArPSAxOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIAogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oImF2ZXJhZ2UgIiArICgoZG91YmxlKXN1bSAvIGNvdW50KSk7CiAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewogICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihlKTsKICAgICAgICB9CiAgICB9CiAgICAKICAgIHN0YXRpYyB2b2lkIGNyZWF0ZURhdGEoKSB7CiAgICAgICAgU3RyaW5nW10gZmFtaWx5bmFtZXMgPSBuZXcgU3RyaW5nW10geyAi5L2Q6JekIiwgIuS4readkSIsICLkvZDjgIXmnKgiLCAi5p6XIiwgIum9i+iXpCIsICLmsaDnlLAiLCAi5bCP5bedIiwgIua4oemCiSIsICLpgaDol6QiLCAi55+z55SwIiwgIuWSjOeUsCIsICLlsbHltI4iLCAi5rih6YKKIiwgIuW3peiXpCIsICLmnb7kupUiLCAi5LuK5LqVIiwgIuacqOS4iyIsICLmq7vkupUiLCAi5LmF5L+dIiwgIuWNg+iRiSIsCiAgICAgICAgICAgICAgICAi5pys55SwIiwgIua4oemDqCIsICLlsbHlhoUiLCAi6KW/55SwIiwgIumrmOeUsCIsICLljZciLCAi5p2+5LiLIiwgIuWuieeUsCIsICLoj4Xph44iLCAi6auY6YeOIiwgIuefs+apiyIsICLlkInlsqEiLCAi6ZaiIiwgIua+pOeUsCIsICLkuK3ljp8iLCAi5qOu5pysIiwgIuWyoSIsICLniYflsqEiLCAi5Lit5baLIiwgIuS4iuadkSIsICLpiLTmnKgiLCAi5LyK6JekIiwgIuWQieeUsCIsICLmnKjmnZEiLAogICAgICAgICAgICAgICAgIuWJjeeUsCIsICLplbfosLflt50iLCAi5p2R5LiKIiwgIuiXpOWOnyIsICLkuInmtaYiLCAi5Y6f55SwIiwgIuS4reW3nSIsICLph5HlrZAiLCAi5LiK55SwIiwgIuWGheeUsCIsICLlsI/lsbEiLCAi5p2R55SwIiwgIumHjuWPoyIsICLlpKfloZoiLCAi5aKX55SwIiwgIuW5s+eUsCIsICLmnYnmnKwiLCAi5rC06YeOIiwgIuadvuWyoSIsICLoj4rlnLAiLCAi55+z5Y6fIiwgIuWztueUsCIsICLopb/lt50iLAogICAgICAgICAgICAgICAgIuS4reeUsCIsICLmsLjkupUiLCAi5rC455SwIiwgIuacjemDqCIsICLlpKfls7YiLCAi5oiQ55SwIiwgIuWkp+WxsSIsICLlsqnltI4iLCAi5bGx5LitIiwgIuWkp+apiyIsICLmtYXph44iLCAi5p2+5rC4IiwgIuWwj+a+pCIsICLnlLDkuK0iLCAi5bCP5p6XIiwgIuadvuacrCIsICLmuIXmsLQiLCAi5bGx5LiLIiwgIuapi+acrCIsICLlvozol6QiLCAi6Z2S5pyoIiwgIui/keiXpCIsICLlsqHmnKwiLCAi5aSq55SwIiwKICAgICAgICAgICAgICAgICLkuK3ph44iLCAi5Lit5bGxIiwgIuajrueUsCIsICLmqKrlsbEiLCAi6YeO5p2RIiwgIuS9kOmHjiIsICLlubPph44iLCAi6b2K6JekIiwgIuadsSIsICLlpKfopb8iLCAi5p2J5bGxIiwgIuS4reilvyIsICLlj6Tlt50iLCAi6L67IiwgIuaWjuiXpCIsICLlpKfosLciLCAi5qiL5Y+jIiwgIuacm+aciCIsICLlnJ/lsYsiLCAi6KW/5bGxIiwgIummrOWgtCIsICLpu5LnlLAiLCAi6auZ5qmLIiwgIuevoOWOnyIsCiAgICAgICAgICAgICAgICAi5a6u55SwIiwgIuWkp+efsyIsICLmnb7mtaYiLCAi5p2+5p2RIiwgIumgiOiXpCIsICLlsbHmnKwiLCAi5bGx55SwIiwgIuWxseWPoyIsICLmo64iLCAi6Zi/6YOoIiwgIuWyoeeUsCIsICLol6TnlLAiLCAi5p2+55SwIiwgIuWwj+mHjiIsICLopb/mnZEiLCAi56u55YaFIiwgIuaftOeUsCIsICLlrq7mnKwiLCAi6LC35Y+jIiwgIuW4guW3nSIsICLkuIrph44iLCAi5q2m55SwIiwgIuW3neWPoyIsICLoj4Xljp8iLAogICAgICAgICAgICAgICAgIuWuruW0jiIsICLoj4rmsaAiLCAi5bCP5bO2IiwgIuS6lOWNgeW1kCIsICLlkInlt50iLCAi55+i6YeOIiwgIumrmOacqCIsICLnlLDlj6MiLCAi5aSn5LmF5L+dIiwgIuaYn+mHjiIsICLnhorosLciLCAi6I2S5pyoIiwgIuahkeWOnyIsICLmnb7ljp8iLCAi5qCX5Y6fIiwgIueZveefsyIsICLljJflt50iLCAi5bCP55SwIiwgIumdkuWxsSIsICLml6nlt50iLCAi5rKz5ZCIIiwgIumrmOapiyIsICLliqDol6QiLAogICAgICAgICAgICAgICAgIuS6leS4iiIsICLmuKHovroiLCAi55+z5bedIiwgIuS4reWztiIsICLlnYLmnKwiLCAi55+z5LqVIiwgIuiXpOS6lSIsICLnlLDmnZEiLCAi5aSn6YeOIiwgIuemj+eUsCIsICLljp8iLCAi6YWS5LqVIiwgIuWuieiXpCIsICLol6TmnKwiLCAi5p2+5bC+IiwgIuays+mHjiIsICLkuLjlsbEiLCAi5bed5LiKIiwgIuWMl+adkSIsICLmlonol6QiLCAi56eL5bGxIiwgIuaWsOS6lSIsICLpo6/nlLAiLCAi6YeO55SwIiwKICAgICAgICAgICAgICAgICLkuYXkv53nlLAiLCAi5bCP5p2+IiwgIuW3neadkSIsICLlsqnnlLAiLCAi5aCAIiwgIuWyqeacrCIsICLlkInmnZEiLCAi56aP5bO2IiwgIuWwj+aziSIsICLkuIrljp8iLCAi5pys6ZaTIiwgIuWwj+axoCIsICLpjoznlLAiLCAi5ZCJ6YeOIiwgIui2s+eriyIsICLniYflsbEiLCAi5a6J6YOoIiwgIuWkqemHjiIsICLkuK3lsL4iLCAi5aWl55SwIiwgIuW3neW0jiIsICLnpZ7osLciLCAi5p2+5bGxIiwgIuWJjeW3nSIsCiAgICAgICAgICAgICAgICAi5rC06LC3IiwgIumHkeeUsCIsICLnlLrnlLAiLCAi5YWQ546JIiwgIuWdgueUsCIsICLlsrjmnKwiLCAi5qSN55SwIiwgIuajruWxsSIs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RlciBidyA9IG5ldyBCdWZmZXJlZFdyaXRlcihvc3cpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMzA7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIG5hbWUKICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwZXJzb25hbG5hbWUgPSBmYW1pbHluYW1lc1tyYW5kb20ubmV4dEludChmYW1pbHluYW1lcy5sZW5ndGgpXSArIGdpdmVubmFtZXNbcmFuZG9tLm5leHRJbnQoZ2l2ZW5uYW1lcy5sZW5ndGgpXTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFuQ291bnQgPiAxNSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcnNvbmFsbmFtZSArPSAi5aWzIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b21hbkNvdW50ICs9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdvbWFuQ291bnQgPiAxNSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcnNvbmFsbmFtZSArPSAi55S3IjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYW5Db3VudCArPSAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmFuZG9tLm5leHRCb29sZWFuKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyc29uYWxuYW1lICs9ICLlpbMiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b21hbkNvdW50ICs9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyc29uYWxuYW1lICs9ICLnlLciOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYW5Db3VudCArPSAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIG51bWJlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG51bWJlciA9ICIiOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgNjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlciArPSBTdHJpbmcudmFsdWVPZihyYW5kb20ubmV4dEludCgxMCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKG51bWJlcnMuY29udGFpbnMobnVtYmVyKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJzLmFkZChudW1iZXIpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZSBzY29yZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNjb3JlID0gcmFuZG9tLm5leHRJbnQoMTAxKTsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidy53cml0ZShwZXJzb25hbG5hbWUgKyAiICIgKyBudW1iZXIgKyAiICIgKyBzY29yZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidy5uZXdMaW5lKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOwogICAgICAgIH0gICAgICAgIAogICAgfQp9Cg==