Nirmit Dalal

Greenhorn
+ Follow
since Mar 12, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nirmit Dalal



i wanted to know when are the objects created ? when are they initialized? and how is show() getting called without any reference or "this" ?
9 years ago
Recently i tried this problem at CodeChef.This is the Problem Definition.

This is probably the easiest task of this problem set. To help you understand the task let us define two key functions: f(n,k), (with k <= n) which gives the number of ways we can draw a sample of k objects from a set of n-distinct objects where order of drawing is not important and we do not allow repetition. G(x1, x2, x3, ... , xn) is the largest integer that perfectly divides all of {x1, x2, x3, ... , xn}. Given an integer N, your task is to compute the value of Y where Y = G( f(2*N,1), f(2*N,3), f(2*N,5), ... , f(2*N,2*N-1)).

Input

The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. The first and the only line of each test case contains a single integer denoting the given N as described in the problem statement.

Output

For each test case, output a single line containing the value of Y. Constraints

1 ≤ T ≤ 10000 2 ≤ N ≤ 1011

Example

Input: 3 6 5 4 Output: 4 2 8

Now i wrote a code in Java which works perfectly fine but the CodeChef online judge give TLE error, so i tried it a couple of different ways but with no success. So i checked some solution which others had posted and i Didnt have a clue what their algorithm did but magically it always came to the right answer So what my concern is that what books should i refer to improve the way these algorithms are written . P.S. Yes i have read Corman

Some other solution did some normal addition and subtraction and Bang!! their answer were correct This was one such solution

I am also showing what i had attempted :-


okay this question may be subjective but i would really like some suggestion as to where to start from
10 years ago
then saying
ArrayList<Integer> al =new ArrayList<Integer>(); is same
10 years ago
i came across this code

How do you interpret this ?
10 years ago
So have i got it correct if i say that instanceof operator is just used with classes who are linked with some inheritance design and results in error otherwise?




This is question from Enthuware . i cant figure out why this code wont compile
For Core Java programming practice i visited the CodingBat website and Euler project website. They both really helped me in understanding the various ways in which some basic api can be used. Now i wanted similar practice sessions for Collections Framework , any idea?
And with the presence of the Collection framework why does one still have to work with array the old style since unlike Collections they dont offer good efficiency and usability?
10 years ago

i tried to compute this as i=i*++i...ie i=56*57 which gives me 3192 but my program says the value is 2162

I dont why this is giving me a compile time error
Why does it only happen if assignment operation of boolean variable is done in the condition expression of IF statement and not with other data type?
10 years ago
okay ...Thanks guys
10 years ago
Jesper i made a change in the IF condition please make a note of it ...and it compiles and runs perfectly
10 years ago



Output
b is true

if my variable b stores false as a value then why does the output show "b is true"
10 years ago
op3.g.gData.clear();
op3.g.gData.setValue(v1,"What you saved","");
op3.g.gData.setValue(v1,"What you paid","");
11 years ago
in my original program i am trying to do the same thing but instead of JButton i am using JLabel so thats why MOuseListener
i even tried chartPanel.addMouseListener(this) ...but still no change ...
11 years ago