#K34852. Generate Buns and Toppings Combinations
Generate Buns and Toppings Combinations
Generate Buns and Toppings Combinations
Given two integers \(n\) and \(m\), your task is to generate all possible combinations in the format: BunX with ToppingY
, where \(1 \leq X \leq n\) and \(1 \leq Y \leq m\). The combinations should be listed in order, first by the bun number and then by the topping number.
This problem simulates a simple combinatorial generation scenario. Input is provided from standard input and the output should be printed to standard output, with each combination on a separate line.
inputFormat
The input consists of a single line containing two integers (n) and (m), separated by a space. Here, (n) denotes the number of bun types and (m) denotes the number of topping types.
outputFormat
Output all combinations, each on a new line, in the exact format: "BunX with ToppingY". The combinations should be ordered first by the bun number and then by the topping number.## sample
3 2
Bun1 with Topping1
Bun1 with Topping2
Bun2 with Topping1
Bun2 with Topping2
Bun3 with Topping1
Bun3 with Topping2
</p>