import java.net.NetworkInterface; import java.util.*; public class Main { static long gcd(long a,long b){ return b == 0 ? a : gcd(b, a%b); } static long lcm(long a, long b){ return a*b/gcd(a, b); } static int[] dx = {1,0,-1,0}; static int[] dy = {0,1,0,-1}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] moto = new int[n+1]; int[] ch1 = new int[m]; int[] ch2 = new int[m]; for(int i=0;ii;j--){ int tmp = moto[j]; moto[j]=moto[j-1]; moto[j-1]=tmp; ans++; sb.append(j-1+" "+(j)+"\n"); } } System.out.println(ans); System.out.println(sb); } }