日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > php開源 > 綜合技術 > CodeForces 185A. Plant(矩陣快速冪)

CodeForces 185A. Plant(矩陣快速冪)

來源:程序員人生   發布時間:2015-04-23 08:04:55 閱讀次數:3005次

題目鏈接:http://codeforces.com/problemset/problem/185/A


Dwarfs have planted a very interesting plant, which is a triangle directed "upwards". This plant has an amusing feature. After one year a triangle plant directed "upwards" divides into four triangle plants: three of them will point "upwards" and one will point "downwards". After another year, each triangle plant divides into four triangle plants: three of them will be directed in the same direction as the parent plant, and one of them will be directed in the opposite direction. Then each year the process repeats. The figure below illustrates this process.

Help the dwarfs find out how many triangle plants that point "upwards" will be in n years.

Input

The first line contains a single integer n (0?≤?n?≤?1018) ― the number of full years when the plant grew.

Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use cincout streams or the %I64dspecifier.

Output

Print a single integer ― the remainder of dividing the number of plants that will point "upwards" in n years by 1000000007 (109?+?7).

Sample test(s)
input
1
output
3
input
2
output
10
Note

The first test sample corresponds to the second triangle on the figure in the statement. The second test sample corresponds to the third one.


PS:

上3角個數:△-> 3*△ +1*

生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 红桃视频成人免费网站 | 91成人黄色 | 日韩不卡av | 国产伦精品一区二区三区视频金莲 | 国产成人精品在线 | 99亚洲 | 国产精品久久久久久久岛一本蜜乳 | 在线看国产视频 | av片在线观看免费 | 国产日韩视频 | 亚洲激情在线观看 | 尤物在线| 成人av电影网址 | 日韩免费视频一区二区 | 一级片黄色 | 99久久精品国产麻豆演员表 | 欧美视频在线看 | 2021国产精品视频 | 成人免费黄色 | 国产一区亚洲一区 | 九九视频在线 | 久久av在线| 久久久久久国产精品免费 | 日韩久久免费视频 | 日韩精品一二 | 在线观看麻豆视频 | 久久中文在线 | 亚洲区视频在线 | 国产日韩欧美在线 | 久草免费福利 | 国产一区二区三区在线观看视频 | 91精品国产综合久久久久 | 99精品免费久久久久久久久日本 | 在线视频 中文字幕 | 秋霞视频在线观看 | 精品二区 | 男女免费视频网站 | 国产999精品久久久 日韩av成人在线 | 成人在线视频免费 | 成人福利在线免费观看 | 免费高潮|