Problem p02885 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define inc(i, a, b) for (long long int i = a; i <= b; i++)
#define dec(i, a, b) for (long long int i = a; i >= b; i--)
#define fast                                                                   \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define lv vector<ll>
#define cv vector<char>
#define dv vector<ld>
#define rall(c) (c).rbegin(), (c).rend()
#define lpr pair<ll, ll>
#define mp make_pair
#define input(c)                                                               \
  ll c;                                                                        \
  cin >> c;
#define lmap map<ll, ll>
#define vinp(a, n)                                                             \
  inc(i, 1, n) {                                                               \
    input(k);                                                                  \
    a.pb(k);                                                                   \
  }
#define LIM 1000000007
#define F first
#define S second
#define fr(n) inc(i, 0, n - 1)
#define fri(n, a)                                                              \
  inc(i, 0, n - 1) { cin >> a[i]; }
void solve() {
  ll i, j;
  ll a, b;
  cin >> a >> b;
  if (a - 2 * b < 0)
    cout << 0;
  else
    cout << a - 2 * b;
}
int main() {
  fast;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ll t = 1;
  // cin>>t;
  while (t--)
    solve();
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define inc(i, a, b) for (long long int i = a; i <= b; i++)
#define dec(i, a, b) for (long long int i = a; i >= b; i--)
#define fast                                                                   \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define lv vector<ll>
#define cv vector<char>
#define dv vector<ld>
#define rall(c) (c).rbegin(), (c).rend()
#define lpr pair<ll, ll>
#define mp make_pair
#define input(c)                                                               \
  ll c;                                                                        \
  cin >> c;
#define lmap map<ll, ll>
#define vinp(a, n)                                                             \
  inc(i, 1, n) {                                                               \
    input(k);                                                                  \
    a.pb(k);                                                                   \
  }
#define LIM 1000000007
#define F first
#define S second
#define fr(n) inc(i, 0, n - 1)
#define fri(n, a)                                                              \
  inc(i, 0, n - 1) { cin >> a[i]; }
void solve() {
  ll i, j;
  ll a, b;
  cin >> a >> b;
  if (a - 2 * b < 0)
    cout << 0;
  else
    cout << a - 2 * b;
}
int main() {
  fast;
  ll t = 1;
  // cin>>t;
  while (t--)
    solve();
}