Harsh was recently gifted a book consisting of 𝑁N pages. Each page contains exactly 𝑀M 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 FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of two space-separated integers on a single line, 𝑁N and 𝑀M — the number of pages and the number of words on each page, respectively.Output FormatFor each test case, output on a new line, the total number of words in the book.Constraints1≤𝑇≤1001≤T≤1001≤𝑁≤1001≤N≤1001≤𝑀≤1001≤M≤100Sample 1:InputOutput41 14 22 495 421883990Explanation: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.
Question
Harsh was recently gifted a book consisting of 𝑁N pages. Each page contains exactly 𝑀M 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 FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of two space-separated integers on a single line, 𝑁N and 𝑀M — the number of pages and the number of words on each page, respectively.Output FormatFor each test case, output on a new line, the total number of words in the book.Constraints1≤𝑇≤1001≤T≤1001≤𝑁≤1001≤N≤1001≤𝑀≤1001≤M≤100Sample 1:InputOutput41 14 22 495 421883990Explanation: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.
Solution
The problem is asking to find the total number of words in a book. The book has N
Similar Questions
Problem StatementAisha is an avid reader who loves exploring different genres of books. She is looking for a program that allows her to input a series of 8 integers, each representing the number of pages she read in a particular session. Once she has input all eight integers, the program should display the number of pages read in each session.Assist Aisha in writing a program to fulfill the above request.Input format :The input consists of 8 space-separated integer values, representing the number of pages read in a particular session.Output format :The output displays a single line containing eight space-separated integer values representing the number of pages read in each session.Refer to the sample output for the formatting specifications.Code constraints :In the given scenario, the test cases fall under the following constraints:0 ≤ number of pages read ≤ 100Sample test cases :Input 1 :100 27 4 45 5 6 7 0Output 1 :100 27 4 45 5 6 7 0 Input 2 :5 3 8 0 12 7 1 9Output 2 :5 3 8 0 12 7 1 9
Problem StatementWrite a program to count the lines, words and characters in a given text.Input FormatInput the text (Ctrl+D on a new line to end input)Output FormatPrint the no of lines, words, charactersSample Input 1This is a sample text.It has multiple lines.Each line contains words.Sample Output 1Lines: 3Words: 12Characters: 80Sample Input 2Hello WorldHappy CodingSample OutputLines: 2Words: 4Characters: 23
Find the count of letters and words in a file.
Which of the following buttons lets you count the number of pages, words, characters, and lines in a document? 1. Word Count 2. Count 3. Word Number 4. Add Word
Frustrated with repeated poor scores in English, Ajay tore up some consecutive leaves from his English book. If the sum of the page numbers on the leaves that he tore was 678, the number of pages he tore from the book could be _____. (Assume that each torn leaf is numbered on either side.)
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.