Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

A farmer is trying out a planting technique that he hopes will increase the yield on his pea plants. The average number of pods on one of his pea plants is 145 pods with a standard deviation of 100 pods. This year, after trying his new planting technique, he takes a random sample of his plants and finds the average number of pods to be 147. Alpha = 5%


Determine the type of test and motivate


There is an N x N board. Rows and columns are numbered from 1 to N. Two persons P1 and P2 randomly select two numbers A and B in between 2 to 2 * N respectively. They independently paint each block whose sum of row and column numbers is a multiple of their chosen number. The beauty of the board is equal to the number of blocks painted at least once by either one of them. Note that even if they both painted the same block, it only counts once. Print the expected beauty of the board.


Rows and columns are numbered from 1 to N.


Input format

•  The first line contains an integer T denoting the number of test cases.

•  The first line of each test case contains an integer N denoting the size of the board.


Output format


For each test case, print the expected beauty of the board in a new line. Print your answer modulo 1e9+ 7.


Constraints


1 T 1000001 N 1000000


It is guaranteed that the sum of N over T test cases does not exceed 1e6.


Robert has a special set of cards to play with. Each card has an integer written on it and the integer can be negative, positive, or zero. The absolute value of the integer on the card cannot exceed x.

 

Now, Robert misplaced some of the cards and currently has only N cards. He wants to have the sum of integers present on the cards to be zero.

 

Find the minimum number of cards that Robert has to add to N cards to make the sum of integers present on all the cards to be zero.

 

Input format

 

•  The first line contains an integer T denoting the number of test cases.

•  The first line of each test case contains two space-separated integers Nx denoting the number of cards and maximum absolute value present on the card.

•  The second line of each test case contains N space-separated integers denoting the integer written on N cards.

 

Output format

For each test case, print the minimum number of cards that Robert has to add to satisfy the conditions.

 

Constraints

1 ≤ T ≤ 10

1 N 105

1 c 106

-x ≤ A[i] ≤ x

Robert has a special set of cards to play with. Each card has an integer written on it and the integer can be negative, positive, or zero. The absolute value of the integer on the card cannot exceed x.


Now, Robert misplaced some of the cards and currently has only N cards. He wants to have the sum of integers present on the cards to be zero.


Find the minimum number of cards that Robert has to add to N cards to make the sum of integers present on all the cards to be zero.


Input format


•  The first line contains an integer T denoting the number of test cases.

•  The first line of each test case contains two space-separated integers Nx denoting the number of cards and maximum absolute value present on the card.

•  The second line of each test case contains N space-separated integers denoting the integer written on N cards.


Output format


For each test case, print the minimum number of cards that Robert has to add to satisfy the conditions.


Describe your experience so far with peer assessment of Programming Assignments.


  • How do you feel about the aspect assessments and feedback you have received from your peers?
  • How do you think your peers feel about the aspect assessments and feedback you provided them?

You are given an integer N. For each integer i from 2 to N, assign a positive integer Ali] such that the following conditions hold:

•  For any pair of integers (i, j), if i and j are co-prime, then A[i]! = A[j].

•  The maximum value among all A[i] is the minimum possible.



Please view the full question image from the below link :

https://drive.google.com/file/d/1_XuTnf6ymzvsP7-z0zA5DJnQdchyHTQs/view?usp=sharing

Bob decided to go on a trip. There are total N kids on the trip. There are 3 types of toys - 'Type-I ', 'Type-2', and 'Type-3' available for distribution among N kids. Each of the kids is asked, what kind of toy he prefers from the current lot. If the kid does not like any toy from the current lot, then he or she would get a toy among the remaining types with equal probability.


For Full Instructions and Question Please Use Those Images as reference... Please help


https://drive.google.com/file/d/1b3RT2IBIBMG2Ojob6uGqoDglXHg-Z928/view?usp=sharing





A university's library has been having electricity issues and students have been struggling to study during nights.


Each light source can illuminate a circle with a radius of r, and there are n tables in the library and the ith table is positioned at point (xi, yi). You have to help the university find the minimum number of light sources (k), such that each table is illuminated by at least 1 light source.



Input format


• The first line contains integers n and r respectively.


• In each of the next n lines, there are two integers representing xi and yi respectively that display the position of the ith table.


Output format


• In the first line of output, print an integer k that represents the number of light sources.



For Full Instructions and Question Please Use Those Images as reference... Please help


https://drive.google.com/file/d/1wWA7nKnFWaG5XgtzzLPymfbuqiIf7WH8/view?usp=sharing




Odd even prime multiples


Humans have finally made contact with aliens from outer space who call themselves Primes. Naturally, each of their individuals loves prime numbers. Their emperor loves the prime number p the most. However, their maths is much more advanced than the version we use on Earth. They have very long numbers with several digits going up to 100 digits. A number is said to be valid for them if it follows the following conditions:


Task

The emperor has sent the message that he will consider humans an intelligent life form if you can tell him the number of valid numbers between L and R (both inclusive). Since the number of such numbers can be too large, you only need to tell the answer modulo (109+7).


For Full Instructions and Note Please Use Those Images as reference... Please help

https://drive.google.com/file/d/1As_XKXCbB2L2zHCMvbDIZfUiN46_QArO/view?usp=sharing

https://drive.google.com/file/d/1XqxcnlhhjqTTLc8PYcfz7tMdW7AFmcKa/view?usp=sharing

Magical stack


You are given a stack of N books in form of N integers which represent the author id of the book from the bottom of the stack.


Task


You have to answer Q queries, In each query, you are given an integer x representing an author id and you will do the following operation:

•    Remove the book which is at the highest depth of the stack and have the queried author id.

•    Print the number of books below this book.

•    Put this book at top of the stack

The book at the highest depth with author id x is the last book from the top of the stack having the author id x.


For Further Instructions Please view the question and diagram images links below:


https://drive.google.com/file/d/18jICdd1Kz3Cjm5vZKZWVfiT17WTyhxTN/view?usp=sharing

https://drive.google.com/file/d/18jICdd1Kz3Cjm5vZKZWVfiT17WTyhxTN/view?usp=sharing




LATEST TUTORIALS
APPROVED BY CLIENTS