Question

Input: A set of ???? integers, ????. Question: Does ???? can be partitioned into two subsets with the same multiplication? For example, if the input is 1, 2, 3, 4, 6 then the answer is YES because 1 ∗ 2 ∗ 6 = 3 ∗ 4.

Answers

  1. The required math function is :
    import math
    a=list(map(int, input().split()))
    b=1
    for i in range(len(a)): b=a[i]
    if((math.sqrt(b))-(round (math.sqrt(b)))==0):
    print(“yes”)
    else:
    print(“No”)
    What is a math function ?
    C Programming allows us to perform fine operations through the functions defined in title train.
    The title train contains colorful styles for performing fine operations similar as sqrt(), pow(), ceil(), bottom() etc.
    Square Root
    To find the square root of a number, use the sqrt() function
    Round a Number
    The ceil() function rounds a number overhead to its nearest integer, and the bottom() system rounds a number down to its nearest integer, and returns the result
    Power
    The pow() function gives the value of x to the power of y( xy)
    Th required mathematical function for the given problem is
    import math
    a=list(map(int, input().split()))
    b=1
    for i in range(len(a)): b=a[i]
    if((math.sqrt(b))-(round (math.sqrt(b)))==0):
    print(“yes”)
    else:
    print(“No”)
    Output :-
    12346
    yes
    Learn more about math function here:
    #SPJ4

    Reply

Leave a Comment