Masala #DRCXVPMXXH
Funksiya
\(f(n) = \begin{cases} n^2, & {agar\ n\ soni\ manfiy\ bo`lsa} \\ 3n+1, & {agar\ n\ soni\ musbat\ bo`lsa} \\ n+10, & {aks\ holda}\end{cases}\)
Sizga \(n\) soni beriladi siz \(f(n)\) ning qiymatini toping.
BItta qatorda \(n(-10^4\leq n \leq 10^4)\) soni kiritiladi.
Masala javobini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
-10 |
100 |
2 |
1 |
4 |
1-testda: -10 soni manfiy son bo`lgani uchun \(f(n)\) ning qiymati \(n^2\) ga teng bo`ladi. \((-10)^2\) \(= 100\)