what's wrong in this code for the problem MUFFINS3 ?

#include <iostream>
#include <cmath>
using namespace std;

int main() {
	// your code goes here
	int t{0};
	cin >> t;
	while(t--){
	    int n{0};
	    cin >> n;
	    if(n % 2 == 0){
	        cout << (n/2)+1 << endl;
	    }
	    else{
	        cout << ceil(static_cast<double>(n)/2) << endl;
	    }
	}
	return 0;
}