HackerRank Solution: Cutting Paper Squares

Sakshi Singh
1 min readMar 31, 2019

--

In Python3

import math

import os

import random

import re

import sys

# Complete the solve function below.

def solve(n, m):

k = (n*m)-1

return k

if __name__ == ‘__main__’:

fptr = open(os.environ[‘OUTPUT_PATH’], ‘w’)

nm = input().split()

n = int(nm[0])

m = int(nm[1])

result = solve(n, m)

fptr.write(str(result) + ‘\n’)

fptr.close()

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Sakshi Singh
Sakshi Singh

No responses yet

Write a response