#[rustfmt::skip] pub mod lib { // pub use ac_library::*; // pub use itertools::{Combinations, Itertools, MultiProduct, Permutations}; pub use proconio::{input,marker::{Chars, Usize1}}; // pub use std::{cmp::*, collections::*, mem::swap}; // pub use regex::Regex; // pub use superslice::Ext; } pub use lib::*; fn main() { input! { x: usize, y: usize } let naka = (0..x).collect::>(); let mut ans = vec![]; for i in 0..naka.len() { ans.push((i, (i + 1) % naka.len())); } let mut nn = naka.len(); for &num in naka.iter() { let mut pre = num; for _ in 0..y - 1 { ans.push((pre, nn)); pre = nn; nn += 1; } } for &(x, y) in ans.iter() { println!("{} {}", x + 1, y + 1); } }