Problem p03059 (C++)

Buggy submission (status: Runtime Error):
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define endl '\n'
#define rep(i, a, b) for (int i = a; i < b; i++)
#define ff first
#define pii pair<int, int>
#define vii vector<pair<int, int>>
#define vi vector<int>
#define vvi vector<vector<int>>
#define ss second
#define mod 998244353
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL << 61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\n'
#define debug3(x, y, z)                                                        \
  cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "     \
       << z << '\n'
using namespace std;
// int dx[]={1,0,-1, 0};int dy[]={0,1,0, -1}; //4 Direction
// int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
bool compare(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.ff == b.ff) {
    return (b.ss < a.ss);
  }
  return (a.ff < b.ff);
}

int n, m;
int col[100005];
vi g[100005];
int ans[100005];
map<pair<int, int>, int> map1;
int32_t main() {
  IOS;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  /********************* From here ***********************/
  double a, b, t;
  cin >> a >> b >> t;
  int ans = 0;
  int time = a;
  while (time < t + 0.5) {
    // cout << time << " " << ans;
    ans += b;
    time += a;
  }
  cout << ans;
}


Fixed submission:
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define endl '\n'
#define rep(i, a, b) for (int i = a; i < b; i++)
#define ff first
#define pii pair<int, int>
#define vii vector<pair<int, int>>
#define vi vector<int>
#define vvi vector<vector<int>>
#define ss second
#define mod 998244353
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL << 61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\n'
#define debug3(x, y, z)                                                        \
  cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "     \
       << z << '\n'
using namespace std;
// int dx[]={1,0,-1, 0};int dy[]={0,1,0, -1}; //4 Direction
// int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
bool compare(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.ff == b.ff) {
    return (b.ss < a.ss);
  }
  return (a.ff < b.ff);
}

int n, m;
int col[100005];
vi g[100005];
int ans[100005];
map<pair<int, int>, int> map1;
int32_t main() {
  // IOS;
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  // #endif
  /********************* From here ***********************/
  double a, b, t;
  cin >> a >> b >> t;
  int ans = 0;
  int time = a;
  while (time < t + 0.5) {
    // cout << time << " " << ans;
    ans += b;
    time += a;
  }
  cout << ans;
}