Codechef Problems: Notebook Counting (NOTECNT)
Problem Statement:
Solution:
Given,
A : number of notebooks chef has
B : number of pages in each notebook
50: number of lines on each page
2: sides of page
to find: total number of lines chef can write
number of books chef has = A
number of pages chef has = number of books * number of pages in each book
= A * B
number of lines chef has = number of pages * number of lines in a page * number of sides of page
= A * B * 50 * 2
therefore, the final answer will be:
total number of lines = A * B * 50 * 2
Code Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a * b * 50 * 2 << endl;
return 0;
}
Comments
Post a Comment