Maricruz have a lot of cards, she always uses her cards to build pyramids as shown in the following image:A pyramid card of 3 levels. She always wonder how many cards does she need to make a pyramid card of N levels. Your task is to answer that question.InputThe first line of the input contains an integer 1 <= T <= 1,000. Each of the following T lines will have an integer 1 <= N <= 1,000,000.OutputFor each case, output a single line consisting of the number of cards needed to build a pyramid card of level N modulo 1,000,007.ExampleInput Example237Output Example1577 Submit solution!
Question
Maricruz have a lot of cards, she always uses her cards to build pyramids as shown in the following image:A pyramid card of 3 levels. She always wonder how many cards does she need to make a pyramid card of N levels. Your task is to answer that question.InputThe first line of the input contains an integer 1 <= T <= 1,000. Each of the following T lines will have an integer 1 <= N <= 1,000,000.OutputFor each case, output a single line consisting of the number of cards needed to build a pyramid card of level N modulo 1,000,007.ExampleInput Example237Output Example1577 Submit solution!
Solution
The problem is asking to find out how many cards Maricruz needs to build a pyramid of N levels.
Here are the steps to solve this problem:
- Understand that the number of cards needed for each
Similar Questions
ScenarioListen to this story: a boy and his father, a computer programmer, are playing with wooden blocks. They are building a pyramid.Their pyramid is a bit weird, as it is actually a pyramid-shaped wall – it's flat. The pyramid is stacked according to one simple principle: each lower layer contains one block more than the layer above.The figure illustrates the rule used by the builders:Your task is to write a program which reads the number of blocks the builders have, and outputs the height of the pyramid that can be built using these blocks.Note: the height is measured by the number of fully completed layers – if the builders don't have a sufficient number of blocks and cannot complete the next layer, they finish their work immediately.
Listen to this story: a boy and his father, a computer programmer, are playing with wooden blocks. They are building a pyramid.Their pyramid is a bit weird, as it is actually a pyramid-shaped wall – it's flat. The pyramid is stacked according to one simple principle: each lower layer contains one block more than the layer above.The figure illustrates the rule used by the builders:Your task is to write a program which reads the number of blocks the builders have, and outputs the height of the pyramid that can be built using these blocks.Note: the height is measured by the number of fully completed layers – if the builders don't have a sufficient number of blocks and cannot complete the next layer, they finish their work immediately.
Write a C program to print the Pyramid with numbersWrite a program to print a pyramid of numbers separated by spaces for the given number of rows.At the time of execution, the program should print the message on the console as:Enter number of rows : For example, if the user gives the input as:Enter number of rows : 5then the program should print the result as:Enter number of rows : 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ou are making gift boxes. Each box contains 7 items.Given 200 items in total, you need to calculate and output how many items will be left over if you create gift boxes from all of the items.The modulo operator % can be useful in solving this challenge.
The Surface Area of a square pyramid is 3600 ft2. The slant height is 80 feet and the base is 20 feet. At most how many 1 foot cubic blocks can be stuffed in the pyramid?(*Some of the blocks might have to be cut up to fit into crevices*)
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.