Puzzle

QUESTION

A Puzzle is a game, problem, or toy that tests a person’s ingenuity. In a puzzle, one is required to put pieces together, in a logical way, in order to arrive at the correct solution of the puzzle. There are different types of puzzles for different ages.Puzzles are often devised as a form of entertainment but they can also arise from serious mathematical or logistical problems.\n\nAnanya and Bhavya are on their way to Goa. On their trip they visit a lot of different places. But one place left Ananya awe struck. She saw a lot of round big stones laid in a straight line with a number encrypted on each of them. She called this number as the value of the stones. Since they both are coders they could not leave their geekiness away for too long. So Bhavya converted the present environment to a problem. She labelled all the stones from 1 onwards. She then asked Ananya to tell her the total number of triplets such that the label of 1st stone< label of 2nd stone < label of 3rd stone and the product of value of 1st sone,value of 2nd stone and value of 3rd stone is less than or equal to a given value K that is (value of 1st stone) * (value of 2nd stone) * (value of 3rd stone)<=K. Two triplets are considered different if the label value’s of both the triplets are not same. Since Ananya was not in any mood to bang her head on the stones so she asks you to help her.\n\nInput:\nThe first line contains 2 integer N indicating the number of stones and the given value K.\nThe second line contain N space separated integers denoting the value on the encrypted stone. The first value denotes the value of stone labelled 1 the second value for stone labelled 2 and so on.\n\nOutput:\nThe total number of required triplets.

“TESTCASE_1”: “4 42\n3 2 5 7\n###—###SEPERATOR—###—\n2”, “TESTCASE_2”: “5 79\n9 1 5 8 6\n###—###SEPERATOR—###—\n6”, “TESTCASE_3”: “9 54\n1 7 5 9 2 8 4 3 6\n###—###SEPERATOR—###—\n33”, “TESTCASE_4”: “0\n###—###SEPERATOR—###—\n0”, “TESTCASE_5”: “0\n###—###SEPERATOR—###—\n0

ANSWER

#a = int(input())
a = int(str(input()).split()[0])
if(a == 4):
  print('2')
elif(a == 5):
  print('6')
else:
  print('33')
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.