CMED206-Editorial

PROBLEM LINK:

Practice

DIFFICULTY:

EASY

PREREQUISITES:

MATHS

EXPLANATION:

Chef wants to achieve coins that are multiple of 100, So suppose chef has x coins then to check the how much more coins are needed we can do 100-(x%100). Here % represents modulas.

SOLUTION:


#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{long long int x;
    cin>>x;
  long long int a=((x+99)/100);
 // cout<<a<<endl;
  cout<<(a*100)-x<<endl;
 
 
    return 0;
}