fork download
  1. #include <bits/stdc++.h>
  2. using namespace std ;
  3. int main(){
  4. long long h , m , n , t ;
  5. cin >> h >> m >> n >> t ;
  6. long long x = ( t - 1 ) * m * n + 1 ;
  7. if ( x <= h )
  8. cout << x ;
  9. else
  10. cout << 0 ;
  11. }
  12.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
Standard output is empty