import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { int N = scan.nextInt(); int list[] = new int[101]; int ansList[] = new int[101]; int sum = 0; for(int i=0; i 0) { ansList[index] = value; sum -= value; if(sum < mid) { value--; } else { value++; } index++; } int ans = 0; for(int i=0; i<101; i++) { int diff = list[i] - ansList[i]; if(diff > 0) { ans += diff; } } System.out.println(ans); } } }