Sunday, May 1, 2016

URI Online Judge Solution 1075 Remaining 2


URI Online Judge | 1075

Remaining 2

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Read an integer N. Print all numbers between 1 and 10000, which divided by N will give the rest = 2.

Input

The input is an integer (< 10000)

Output

Print all numbers between 1 and 10000, which divided by n will give the rest = 2, one per line.
Input SampleOutput Sample
132
15
28
41
...



URI Online Judge Solution 1075 in Java


import java.io.IOException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws IOException {

int N;
Scanner input =new Scanner(System.in);

N =input.nextInt();
for (int i = 0; ((N*i) + 2) < 10000; i++) {
System.out.print((N*i) + 2+"\n");
}
    }

}

No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.