CCLEARN - Editorial

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4

Tester: yash_daga
Editorialist: iceknight1093

DIFFICULTY:

287

PREREQUISITES:

None

PROBLEM:

The new CodeChef Learn module has two courses for each language.
If there are courses for N languages, how many courses are present in total?

EXPLANATION:

With two courses for each language, if there are N languages there will be 2\times N courses.

So, the solution is to read in N and print 2\times N.

TIME COMPLEXITY

\mathcal{O}(1) per test case.

CODE:

Code (C++)
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	cout << 2*n << '\n';
	return 0;
}
Code (Python)
n = int(input())
print(2 * n)