using System; using System.Collections.Generic; using System.Linq; public class Yuki694 { public static void Main() { var n = int.Parse(Console.ReadLine()); var a = new List(); string s; while((s = Console.ReadLine()) != null) a.Add(int.Parse(s)); var cnt = 0; for(int i = 0; i < n; ++i) { for(int j = i + 1; j < n; ++j) if(a[i] > a[j]) ++cnt; } Console.WriteLine(cnt); for(int i = 0; i < n - 1; ++i) { var x = a[i]; var p = a.Count(y => y > x); var m = a.Count(y => y < x); cnt = cnt + p - m; Console.WriteLine(cnt); } } }