Text

Is my childForm already running in MDIForm(parent)? (C#)

I want to run one childForm a kind to run once at a time, here is a way to verify id there is another one already running. I used to do that because I don’t want my users to open two Forms of the same kind at the time because they found it confusing at a time.

This code is inside my MDI parent Form:

Text

Is my program already running? (C#)

Sometimes to protect data integrity, specially if we are accessing a remote DB. I just want one instance of my program running, here is a way to determinate the number of processes running. Be careful where you write this piece of code. I added it up to program.cs.

The form is not on production yet, but it works checking your processes!

Text

CodeChef, Medium Prime Generator Prime1

All submissions for this problem are available.

Shridhar wants to generate some prime numbers for his cryptosystem. Help him!
Your task is to generate all prime numbers between two given numbers.

Input

The first line contains t, the number of test cases (less then or equal to 10).

Followed by t lines which contain two numbers m and n (1 <= m <= n <= 1000000000, n-m<=100000) separated by a space.

Output

For every test case print all prime numbers p such that m <= p <= n,
one number per line. Separate the answers for each test case by an empty line.

Example

Input:
2
1 10
3 5

Output:
2
3
5
7

3
5

Warning: large Input/Output data, be careful with certain languages (though most should be OK if the algorithm is well designed)

I came up with this answer, but It is giving me a runtime error, the problem is that my method for checking the prime takes to much memory, I’ll work on it over the weekend. The algorithm should be fine, I saw several answers with similar Algos, altho none of them in Ruby.


Text

CodeChef, Peer Problem 1

All submissions for this problem are available.

Reversed number is a number written in arabic numerals but the order of digits is reversed. The first digit becomes last and vice versa. For example, if the number is 1245,it will become 5421 .Note that all the leading zeros are omitted. That means if the number ends with a zero, the zero is lost by reversing (e.g. 1200 gives 21). Also note that the reversed number never has any trailing zeros. Your task is to add two reversed numbers and output their reversed sum. Of course, the result is not unique because any particular number is a reversed form of several numbers (e.g. 21 could be 12, 120 or 1200 before reversing). Thus we must assume that no zeros were lost by reversing (e.g. assume that the original number was 12).

Input

The input consists of N cases (equal to about 10000). The first line of the input contains only positive integer N. Then follow the cases. Each case consists of exactly one line with two positive integers separated by space. These are the reversed numbers you are to add.

Output

For each case, print exactly one line containing only one integer - the reversed sum of two reversed numbers. Omit any leading zeros in the output.

Example

Input:
1
24 1

Output:
34


Answer in Ruby


Link