For this Question: Given an integer N, your task is to find the maximum value of X such that sum of some X consecutive natural numbers is N.Input contains a single integer N.

Constraints:-
1 <= N <= 1000000000Print the maximum value of X such that sum of some X consecutive natural numbers is N.Sample Input:-
5

Sample Output:-
2

Explanation:-
2 + 3 = 5

Sample Input:-
50

Sample Output:-
5

Explanation:-
8 + 9 + 10 + 11 + 12 = 50, I have written this Solution Code: 































import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(read.readLine());

		int sumOfCon = 0;

		for(int i=1; i<=N; i++) {
			for(int j=i; j<=N; j++) {
				sumOfCon += j;
				if(sumOfCon > N) {
					break;
				}

				if(sumOfCon == N) {
					System.out.print(j-i+1);
					break;
				}
			}
			if(sumOfCon == N) {
				break;
			}
			sumOfCon = 0;
		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?