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 = 1; i < n; ++i) { var x = a[0]; a.RemoveAt(0); cnt -= a.Count(y => y < x); cnt += a.Count(y => y > x); Console.WriteLine(cnt); a.Add(x); } } }