For this Question: Given an integer K, find a positive integer x such that <b>K = x<sup>2</sup> + 3*x</b>. If no such positive integer x exists, print -1.First and the only line of the input contains an integer K.

Constraints:
1 <= K <= 10<sup>18</sup>Print a positive integer x such that the above equation satisfies. If no such integer x exists, print -1.Sample Input:
28

Sample Output:
4

Explaination:
4<sup>2</sup> + 3*4 = 28
There is no other positive integer that will give such result., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define int long long
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using T = pair<int, int>;
typedef long double ld;
const int mod = 1e9 + 7;
const int INF = 1e9;

void solve(){
    int n;
    cin >> n;
    int l = 1, r = 1e9, ans = -1;
    while(l <= r){
        int m = (l + r)/2;
        int val = m*m + 3*m;
        if(val == n){
            ans = m;
            break;
        }
        if(val < n){
            l = m + 1;
        }
        else r = m - 1;
    }
    cout << ans;
}

signed main(){
    fast
    int t = 1;
    // cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
        if(i != t) cout << endl;
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?