문제
https://www.acmicpc.net/problem/2292
코드
import java.util.*;
import java.io.*;
class Main {
public static void main(String args[]) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
long n = Long.parseLong(br.readLine());
int count = 0;
int range = 1;
while(true) {
if(n <= range) {
count+=1;
break;
}
count += 1;
range = range + count * 6;
}
System.out.print(count);
}
}