Sapın sağ tərəfindəki yarpaqların sayı 1 + 2 + …. + n-yə (ağacda qat var) bərabərdir. Sapın sol tərəfində yarpaqların sayı eynidir. Və yuxarıda daha bir yarpaq.
Suvarma üçün suyun litr sayı ağacdakı yarpaqların sayına bərabərdir. Bu, belə bərabərdir

Yuxarıda qeyd edilən formülə əsasən hesablamaları icra edək.
scanf("%d",&n);
res = n * (n + 1) + 1;
printf("%d\n",res);#include <stdio.h>
int *n, *res;
int main(void)
{
n = new int;
res = new int;
scanf("%d",n);
*res = *n * (*n + 1) + 1;
printf("%d\n",*res);
delete n;
delete res;
return 0;
}#include <stdio.h>
class Long
{
private:
long long value;
public:
Long(long long value = 0) : value(value) {}
void Read(void)
{
scanf("%lld",&value);
}
void Print(void)
{
printf("%lld\n",value);
}
Long operator+ (long long x)
{
return value + x;
}
Long operator* (const Long &x)
{
return value * x.value;
}
};
int main(void)
{
Long n, res;
n.Read();
res = n * (n + 1) + 1;
res.Print();
return 0;
}import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner con = new Scanner(System.in);
int n = con.nextInt();
int res = n * (n + 1) + 1;
System.out.println(res);
}
}n = int(input())
res = n * (n + 1) + 1
print(res)