Codechef Problems: Squid Game - Piggy Bank (SQUIDBANK)

 Problem Statement: 


Solution: 

given, 
    N : Initial Number of participants 
    K : Number of participants survived

condition: each eliminated player contributes 10000 units to the prize pool 

eliminated players = N - K 
total price pool = eliminated players * 10000
                         = ( N - K ) * 10000

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;

    cout << (n - k) * 10000 << endl;
    return 0;
}

Comments

Popular Posts