# Triples with Properties in Python

## Problem Statement:

Joey wants to find a triplet of integers x, y, and z such that it satisfies these two conditions:

1. (y+z)-x <= A
2. (y*z)*(-x) <= B

where A and B are given input integers.

Design a Python program that takes two integers as input A and B and prints these triplets. Also, print the count of triplets.

For Example
Input:
Enter A and B: 2 4
Output:
Count of Triplets: 10
Triplets: [0, 0, 0], [0, 0, 1], [0, 0, 2], [0, 1, 0], [0, 1, 1], [0, 2, 0], [1, 0, 0], [1, 0, 1], [1, 1, 0], [2, 0, 0]

## Code for Triples with Properties in Python:

```#function for finding triplets
def findTriplets(A,B):
triplets = []
for x in range(A+1):
for y in range(A-x+1):
for z in range(A-(x+y)+1):
if(y+z-x<=A and x*y*z<=B):
triplets.append([x,y,z])

return triplets

#input the integers
A,B=map(int,input("Enter A and B: ").split())
triplets = findTriplets(A,B)

#print the output
print("Count of Triplets: ",len(triplets))
print("Triplets: ",end=" ")
for x in triplets:
print(x,end=" ")```

## Output: 