adplus-dvertising

Counting Words CodeChef Solution

We Are Discuss About CODECHEF SOLUTION

Counting Words CodeChef Solution

Counting Words CodeChef Solution

Harsh was recently gifted a book consisting of NN pages. Each page contains exactly MM words printed on it. As he was bored, he decided to count the number of words in the book.

Help Harsh find the total number of words in the book.

Input Format

  • The first line of input will contain a single integer¬†TT, denoting the number of test cases.
  • Each test case consists of two space-separated integers on a single line,¬†NN¬†and¬†MM¬†‚ÄĒ the number of pages and the number of words on each page, respectively.

Counting Words CodeChef Solution

Output Format

For each test case, output on a new line, the total number of words in the book.

Constraints

  • 1‚ȧT‚ȧ1001‚ȧT‚ȧ100
  • 1‚ȧN‚ȧ1001‚ȧN‚ȧ100
  • 1‚ȧM‚ȧ1001‚ȧM‚ȧ100

Sample Input 1 

4
1 1
4 2
2 4
95 42

Sample Output 1 

1
8
8
3990

Explanation

Counting Words CodeChef Solution

Test case 11: The book consists of only 11 page, and each page has only 11 word. Hence, the total number of words is 11.

Test case 22: The book consists of 44 pages, and each page has 22 words. Hence, the total number of words is 2+2+2+2=82+2+2+2=8.

Test case 33: The book consists of 22 pages, and each page has 44 words. Hence, the total number of words is 4+4=84+4=8.

Test case 44: The book consists of 9595 pages, and each page has 4242 words. Hence, the total number of words is 39903990.

Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here ScishowEngineer   Then Follow US HERE and Join Telegram.

If You Want To Learn Something New Then Visit Our Official Channel YOUTUBE

Related Posts

2 thoughts on “Counting Words CodeChef Solution

Leave a Reply

Your email address will not be published.