```
int coffee(int n) {
int s = n * n;
for (int q = 0; q < n; q++)
s = s - q;
for (int q = n; q > 0; q--)
s = s - q;
return s + 2;
}
int tea(int n) {
int r = 0;
for (int i = 1; i < n*n*n; i = i * 2)
r++;
return r * r;
}
int mocha(int n) {
int r = 0;
for (int i=0; i<=n; i = i+16)
for (int j=0; j
```

```
```I'm trying to find the return value in terms $ n $ to the `coffee`

. `tea`

. `mocha`

but I'm stuck right now.

I know `coffee`

returns 2 as the code follows:

$ s = n ^ 2 $

$ s = n ^ 2 - displaystyle sum_ {q = 0} ^ {n-1} q = n ^ 2 - dfrac {n (n-1)} {2} $

$ s = n ^ 2 - dfrac {n (n-1)} {2} - displaystyle sum_ {q = 1} ^ nq = n ^ 2 - dfrac {n (n-1)} {2} - dfrac {n (n + 1)} {2} = 0 $

Then, $ s = 0 + 2 $,

I can not figure it out, though `tea`

. `mocha`

, and `espresso`

because they do not follow +1 steps. Could someone help me how to calculate the return value in terms $ n $?

```
```