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