Fractals
Practice
0 (0 votes)
Math
Patterns
Problem
81% Success 215 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Fractals are special geometric shape that have following properties:

1. Finite area

2. Infinite perimeter

SnowFlake is a one of them.

 your task is to find no. of vertices in snowflake after N iterations starting with equilateral triangle.

for explanation first 4 iterations are given in following figure:-

 

Input:

First line consists of Q (1<= Q <= 10^5) denotes no of test cases.

Each test case consist of single integer N (1<= N <= 10^18).

Output:

Single integer denoting no. of outward vertices in new line for each test case.

Note: answer can be very large print answer under modulo 10^9+7

Note: Copy and paste is disabled for all the questions. Try not to use other ides.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
6 votes
Tags:
Basic ProgrammingOpenApprovedEasyMathamatics
Points:20
2 votes
Tags:
Easy
Points:20
926 votes
Tags:
Ad-HocMathematicsEasy