
#include <iostream>
using namespace std;
int main(void) {
int cnt = 1;//통과 회차
int N = 0; //목표 숫자
int max = 1; //cnt회차의 도달가능한 최댓값
while (N > max) {
cnt++;
max += 6 * (cnt-1);
}
cout << cnt;
return 0;
}
while (N > max) 목표 숫자가 현재 회차의 최댓값보다 크면 조건식을 수행한다. cnt++;
max += 6 * (cnt-1);다음 회차로 넘어간 뒤, max를 증가시킨다.