Help solving my doubt from Starter 120 contest

question - Largest K (Div 4)

My code - include
include
using namespace std;

int main() {
int t;
cin >> t;

while (t--) {
    long long int x, y;
    cin >> x >> y;

    // x = 0s, y = 1s, gap = x - 1
    long long int gap = x - 1;
    if(y%gap==0){
        cout<<y/gap<<endl;
        
    }
    else if(y%gap!=0 ){
        cout<<floor(y/gap)<<endl;
    }
}

return 0;

}

What’s the error ?

@srajvardhan080
I have corrected your code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while (t--) {
     int x, y;
    cin >> x >> y;

    // x = 0s, y = 1s, gap = x - 1
     int gap = x - 1;
    if(y%gap==0){
        cout<<y/gap<<endl;
        
    }
    else if(y%gap!=0 ){
        int val=floor(y*1.0/gap*1.0);
        cout<<val<<endl;
    }
}

}