Problem list
Log in
#r02964 · Online Judge > GoldOJ

All Ordered Triples

Bronze III 2.0 s 1024 MB

Given $a$, $b$, $c$, print every triple $(i, j, k)$ with $1 \le i \le a$, $1 \le j \le b$, $1 \le k \le c$, in lexicographic order, one per line as i j k.

Input

Three integers $a$, $b$, $c$ ($1 \le a, b, c \le 20$).

Output

Print all $a \cdot b \cdot c$ triples, one per line.

Example 1

Input
2 2 3
Output
1 1 1
1 1 2
1 1 3
1 2 1
1 2 2
1 2 3
2 1 1
2 1 2
2 1 3
2 2 1
2 2 2
2 2 3
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code