Exit Code is 1
source link: https://codeforces.com/blog/entry/64383
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Exit Code is 1
Problem : A. Theatre Square
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.
What is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square
import math
n=int(input())
m=int(input())
a=int(input())
if a>=1 and a<=10**9:
square=a
if m>=1 and m<=10**9:
length=m
if n>=1 and n<=10**9:
width=n
total=math.ceil(length/square)*math.ceil(width/square)
print(total)
This code runs fine in my IDE,but gives error when I submit the answer. What to correct?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK