Knowee
Questions
Features
Study Tools

Input FormatThe first line of input contains T - the number of test cases. It is followed by T lines, each line contains a single odd integer N - the size of the diamond.Output FormatFor each test case, print the test case number as shown, followed by the diamond pattern, separated by a new line.Constraints1 <= T <= 1003 <= N <= 201ExampleInput437515OutputCase #1: ** * *Case #2: * * * * ** * * * * * *Case #3: * * ** * * * *Case #4: * * * * * * * * * * * * ** * * * * * * * * * * * * * *

Question

Input FormatThe first line of input contains T - the number of test cases. It is followed by T lines, each line contains a single odd integer N - the size of the diamond.Output FormatFor each test case, print the test case number as shown, followed by the diamond pattern, separated by a new line.Constraints1 <= T <= 1003 <= N <= 201ExampleInput437515OutputCase #1: ** * *Case #2: * * * * ** * * * * * *Case #3: * * ** * * * *Case #4: * * * * * * * * * * * * ** * * * * * * * * * * * * * *

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

No answer

Similar Questions

Print Hollow Diamond PatternMax Score: 100Print a hollow diamond pattern using '*'. See examples for more details.Input FormatThe first line of input contains T - the number of test cases. It is followed by T lines, each line contains a single odd integer N - the size of the diamond.Output FormatFor each test case, print the test case number as shown, followed by the diamond pattern, separated by a new line.Constraints1 <= T <= 1003 <= N <= 201ExampleInput437515OutputCase #1: ** * *Case #2: * * * * ** * * * * * *Case #3: * * ** * * * *Case #4: * * * * * * * * * * * * ** * * * * * * * * * * * * * *

Input FormatThe first line of input contains T - the number of test cases. It's followed by T lines, each line contains 2 numbers N and P, separated by space.Output FormatFor each test case, print the value of N % P, separated by a new line.Constraints20 points1 <= T <= 1001 <= N <= 10181 <= P <= 10880 points1 <= T <= 1001 <= N <= 10100001 <= P <= 1015ExampleInput45 24 101085377843 817659438290826691135830692772803 95972011Output142242058460316167

Understand the problem statement from the given sample input and output.Input FormatThe first line of input contains T - the number of test cases. It's followed by T lines, each line contains 2 strings A and B, separated by space, consisting only of lowercase English alphabets.Output FormatFor each test case, print the desired output, separated by a new line.Constraints10 points1 <= T <= 1001 <= len(A), len(B) <= 10040 points1 <= T <= 10001 <= len(A) <= 50001 <= len(A), len(B) <= 5000ExampleInput2data structuressmart interviewsOutputsrucuresineview

Even SplitGiven a number N, check if you can split the number into 2 non-zero even parts.InputFirst line of input contains T - number of test cases. Its followed by T lines, each line contains a single integer N.OutputFor each test case, print "Yes" if you can split the number into 2 non-zero even parts, "No" otherwise, separated by new line.Constraints1 <= T <= 1050 <= N <= 1018ExampleInput281OutputYesNoExplanationTest Case 1You can split 8 as 4,4 or 6,2.Test Case 2You cannot split 1 into 2 even parts.

Given a number, swap the adjacent bits in the binary representation of the number, and print the new number formed after swapping.Input FormatThe first line of input contains T - the number of test cases. Each of the next T lines contains a number N.Output FormatFor each test case, print the new integer formed after swapping adjacent bits, separated by a new line.Constraints1 <= T <= 1000000 <= N <= 109ExampleInput410743100Output51123152

1/4

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.