Help me in solving CHEFIZZA problem

My issue

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

int main() {

int X;

// Ask the user for the number of slices
cout << "Enter the number of slices (even number): ";
cin >> X;

// Ensure X is even
if (X % 2 != 0) {
    cout << "Number of slices must be even." << endl;
    return 1;
}

// Since all slices are equal, there will be no smaller pieces
int smallerPieces = 0;

// Output the result
cout << "Number of smaller pieces: " << smallerPieces << endl;

return 0;

}

My code

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

int main() {

    int X;
    
    // Ask the user for the number of slices
    cout << "Enter the number of slices (even number): ";
    cin >> X;
    
    // Ensure X is even
    if (X % 2 != 0) {
        cout << "Number of slices must be even." << endl;
        return 1;
    }
    
    // Since all slices are equal, there will be no smaller pieces
    int smallerPieces = 0;
    
    // Output the result
    cout << "Number of smaller pieces: " << smallerPieces << endl;
    
    return 0;
}




Problem Link: Chef loves Pizza Chef loves halfs Practice Coding Problem

you are doing wrong way input output
you do not need to output "Enter the number of slices (even number): "
like this
refer to code for correct input output
include
#include<bits/stdc++.h>
include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
define ll int128_t
define int long long
define endl “\n”
define mod 1000000007
using namespace std;

int power(int a, int b) {
int res = 1;

while (b) {
if (b & 1) {
res = res * a % mod;
}

b >>= 1;
a = a * a % mod;

}

return res;
}

int inv(int a) {
return power(a, mod - 2);
}

int32_t main() {
cin.tie(0)->sync_with_stdio(false);
int t;cin>>t;
while(t–){
int n;cin>>n;
n*=2;
int l=log2(n);
l=power(2,l);
cout<<n-l<<endl;
}
cerr << "Time : " << 1000 * ((double)clock()) / CLOCKS_PER_SEC << “ms” << endl;
return 0;
}