Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

List Comprehensions

**Let's learn about list comprehensions! You are given three integers X,Y and Z representing the dimensions of a cuboid along with an integer N. You have to print a list of all possible coordinates given by (i,j,k) on a 3D grid where the sum of i+j+k is not equal to N. Here , 0<=i<=X; 0<=j<=Y; 0<=k<=Z **

Input Format
Four integers X,Y,Z and N each on four separate lines, respectively.

Output Format
For each test case, print the required answer in a new line.

Constraints
Print the list in lexicographic increasing order.

Sample Input
1
1
1
2

Sample Output
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 1]]