Tile Game |Programming_info || python_problem_06

 In connection to the National Mathematics Day celebration, the Regional Mathematical Scholars Society had arranged for a Mathematics Challenge Event where school kids participated in large number. Many interesting math games were conducted, one such game that attracted most kids was the tile game where the kids were given 'n' square tiles of the same size and were asked to form the largest possible square using those tiles.

 
Help the kids by writing a program to find the area of the largest possible square that can be formed, given the side of a square tile (in cms) and the number of square tiles available.
 
Input Format:
First line of the input is an integer that corresponds to the side of a square tile (in cms).
Second line of the input is an integer that corresponds to the number of square tiles available.
 
Output Format:
Output should display the area of the largest possible square that can be formed (in square cms) with the available tiles.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]

Sample Input and Output :
Enter the side in cm of a square tile
5
Enter the number of square tiles available
8
Area of the largest possible square is 100sqcm

Solution:
import math
print("Enter the side in cm of a square tile")
x=int(input())
print("Enter the number of square tiles available")
y=int(input())
area=x*int(math.sqrt(y))
area1=area**2
print("Area of the largest possible square is",area1," sqcm")

Share:

1 comment:

  1. Dejlig og informativ blog! Denne type information giver fakta om at designe et unikt top-to-bund look, som du elsker.
    Hvis du vil vide mere om Fliser Hillerød, Nordsjælland så kan du klikke her.
    Tak fordi du delte.

    ReplyDelete

Translate

Recommended platforms

  1. codechef
  2. hackerrank
  3. codeforces
  4. leetcode
  5. hackerearth

Popular Posts

programming_info. Powered by Blogger.

Recent Posts

other platforms

  • geeks for geeks
  • w3schools
  • codepen
  • skillshare
  • udemy

Pages

reader support Support