Codechef Programs: Spring Cleaning (SPRCLN)

 Problem Statement: 


Solution: 

Given, 
    X : number of small rooms 
    Y : number of large rooms 
    30: time for cleaning a small room 
    60: time for cleaning a large room 

to find, total time for cleaning all rooms in the house 

time for cleaning all small rooms = X * 30
time for cleaning all large rooms = Y * 60 
total time for cleaning all rooms = (X * 30) + (Y * 60) 

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int x, y;
    cin >> x >> y;

    cout << (x * 30) + (y * 60) << endl;
    return 0;
}

Comments