package no326; import java.util.ArrayList; 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[] p = new int[n]; for(int i=0;i ans = new ArrayList<>(); //insertion sort for(int i=1;i=0;j--) { if (p[j] > p[j+1]) { int temp = p[j]; p[j] = p[j+1]; p[j+1] = temp; ans.add(j); } } } System.out.println(ans.size()); for(int x:ans) { System.out.println((x + 1) + " " + (x + 2)); } } }