void abort() { };
                                                                                                                                                          
                                                                        
extern short __VERIFIER_nondet_short();
                        
void assume_abort_if_not(int cond) {
  if(!cond) {abort();}
}
/*@ 
    requires ((1 <= cond)) && (cond != 0);
    ensures ((1 <= cond)) && (1);
@*/
void __VERIFIER_assert(int cond) {
    if (!(cond)) {
    ERROR:
        {/*@ assert(0); */;}
    }
    return;
}

int counter = 0;
/*@ 
    requires ((counter == 0));
    ensures ((\old(counter) == 0));
@*/
int main() {
    short k; 
    long long y, x, c;
    k = __VERIFIER_nondet_short();

    y = 0;
    x = 0;
    c = 0;

/*@
loop invariant ((((((3 * ((__int128) y * y)) + y) + ((((__int128) y * y) * y) * 2)) == ((__int128) x * 6)) && (\old(counter) == 0)));
@*/
    while (counter++<100) {
        __VERIFIER_assert(6*x - 2*y*y*y - 3*y*y - y == 0);

        if (!(c < k))
            break;

        c = c + 1;
        y = y + 1;
        x = y * y + x;
    }
    __VERIFIER_assert(6*x - 2*y*y*y - 3*y*y - y == 0);
    return 0;
}