Algorithm


  problem Link : https://www.codechef.com/START97D/problems/RIP2000 

Problem

Chef had collected  notes of Rs. 2000 to pay his total college fees. However, the government banned Rs. 2000 notes.

Chef wants to pay the same amount using Rs. 500 notes only. Find the number of notes Chef needs.

Input Format

Each test case consists of a single integer  - the number of notes of Rs. 2000 that Chef has collected.

Output Format

Output a single integer - the number of Rs. 500 notes needed.

Constraints

  • 1≤�≤100

Sample 1:

Input
 
Output
 
4
16

Explanation:

4 notes of Rs. 2000 make a total of 4⋅2000=8000 rupees. This is equivalent to 16 notes of Rs. 500.

acceptedAccepted
15156
total-SubmissionsSubmissions
19746
accuracyAccuracy
85.2

Code Examples

#1 Code Example with C Programming

Code - C Programming

 #include<bits/stdc++.h>
using namespace std;
using ll = long long;


void solve()
{
    int n;
    cin>>n;
    cout<<n*4<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int TC = 1;
    //cin >> TC;
    //cin.ignore();
    while (TC--) solve();
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
4

Output

x
+
cmd
16
Advertisements

Demonstration


CodeChef solution RIP2000  - 2000 Codechef solution in C,C++

Previous
CodeChef solution CHN15A - Mutated Minions Codechef solution in C,C++
Next
CodeChef solution TRICOIN - Coins and Triangle Codechef solution in C,C++