fork download
  1. local _N = "*n"
  2. local a, b, c, d = io.read(_N,_N,_N,_N)
  3.  
  4. local temp = 0
  5. while temp < b*d do
  6. if a <= b then
  7. if c <= d then
  8. temp = a*c
  9. print(a,c,temp)
  10. if c == d then
  11. a = a + 1
  12. c = 1
  13. else
  14. c = c + 1
  15. end
  16. --print(a,c,temp)
  17. end
  18. end
  19. end
Success #stdin #stdout 0s 2792KB
stdin
2 5 7 9
stdout
2	7	14
2	8	16
2	9	18
3	1	3
3	2	6
3	3	9
3	4	12
3	5	15
3	6	18
3	7	21
3	8	24
3	9	27
4	1	4
4	2	8
4	3	12
4	4	16
4	5	20
4	6	24
4	7	28
4	8	32
4	9	36
5	1	5
5	2	10
5	3	15
5	4	20
5	5	25
5	6	30
5	7	35
5	8	40
5	9	45