Copyright
InterviewTime limit1sMemory limit128 MB
Given A songs and a rounded-up average I, find the smallest total copyrighted melodies consistent with ceil(total/A) = I.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
An album contains A songs. The album's copyright average is computed as
(the total number of copyrighted melodies included in the album) / (the number of songs in the album)
and then rounded up to an integer.
Given A and the rounded-up average I, determine the smallest possible total number of copyrighted melodies in the album.
Input
The first line contains two integers A and I.
1 <= A, I <= 100
Output
Print the smallest possible total number of copyrighted melodies.