This problem is from Timus Online Judge. The original problem description can be found here.
This problem is marked as for ‘High School Pupils’, which means it very easy. However, just read through the problem description before looking for answers. This will improve your ability of problem solving/analysis.
The problem asks virtually to compute the area (both sides) of given rectangles (total n). 1 square meter uses 1 sulphide.
Pure math, nothing easier… Don’t blame me to post such easy puzzles… I promised you to put all the puzzles I solved in Timus Online Judge here.. 🙂
#include <iostream>
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
cout << n * a * b * 2 << endl;
return 0;
}
Or, if you prefer pure C.
#include <stdio.h>
int main() {
int n, a, b;
scanf("%d %d %d", &n, &a, &b);
printf("%d", n * a * b * 2);
return 0;
}
–EOF (The Ultimate Computing & Technology Blog) —
Last Post: Coding Exercise - Timus Online Judge - 1877. Bicycle Codes - C++ solution
Next Post: Coding Exercise – Timus Online Judge – 1409. Two Gangsters, C/C++ solution
