text: Total number of days taken to complete the task if after certain days one person leaves | C ++ implementation of the approach ; Function to return the number of days required ; Driver code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int numberOfDays ( int a , int b , int n ) { int Days = b * ( n + a ) / ( a + b ) ; return Days ; } int main ( ) { int a = 10 , b = 20 , n = 5 ; cout << numberOfDays ( a , b , n ) ; return 0 ; }