UVA-913 - Joana and the Odd Numbers

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 相同題目:ZOJ-d096

題意概要

題目給定一個奇數的排列方式如下:

 1
 3  5  7
 9 11 13 15 17
19 21 23 25 27 29 31
...

題目給定一個數字 ,表示某一列有 個奇數,試求:該列的最後三個數之總和。


Input

The input is a sequence of lines, one odd number () per line.


Output

For each input line write the sum of the last three odd numbers written by Joana in that line with numbers. This sum is guaranteed to be less than .


Sample Input

3
5
7

Sample Output

15
45
87
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus