/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
int[] scores = { 10, 9, 9, 8, 6, 5, 5, 5, 4, 1 };
int prescore = -1;
int cur = 0;
int same = 0;
for (int i : scores)
{
if (i == prescore)
{
System.
out.
println(i
+ " - " + cur
); same++;
}
else
{
cur = cur + same;
cur++;
prescore = i;
same = 0;
System.
out.
println(i
+ " - " + cur
); }
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKICAgICAgICBpbnRbXSBzY29yZXMgPSB7IDEwLCA5LCA5LCA4LCA2LCA1LCA1LCA1LCA0LCAxIH07CiAgICAgICAgaW50IHByZXNjb3JlID0gLTE7CiAgICAgICAgaW50IGN1ciA9IDA7CiAgICAgICAgaW50IHNhbWUgPSAwOwogICAgICAgIGZvciAoaW50IGkgOiBzY29yZXMpCiAgICAgICAgewogICAgICAgICAgICBpZiAoaSA9PSBwcmVzY29yZSkKICAgICAgICAgICAgewogICAgICAgICAgICAJU3lzdGVtLm91dC5wcmludGxuKGkgKyAiIC0gIiArIGN1cik7CiAgICAgICAgICAgIAlzYW1lKys7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBjdXIgPSBjdXIgKyBzYW1lOwogICAgICAgICAgICAgICAgY3VyKys7CiAgICAgICAgICAgICAgICBwcmVzY29yZSA9IGk7CgkJCQlzYW1lID0gMDsKICAgICAgICAgICAgCVN5c3RlbS5vdXQucHJpbnRsbihpICsgIiAtICIgKyBjdXIpOwogICAgICAgICAgICB9CgogICAgICAgIH0KCX0KfQ==