import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] a = new int[N]; int[] sub = new int[N]; for(int i=0; i a[j+K]){ int temp = a[j]; a[j] = a[j+K]; a[j+K] = temp; count ++; } } } return count; } }