1075 Remaining 2

SemiColon
By -
0
URI Online Judge | 1075

Remaining 2

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
...


Solution:

#include <stdio.h>

int main()
{
 int n, i;

 scanf("%d", &n);

 for (i = 1; i <= 10000; ++i)
 {
  if(i % n == 2){
   printf("%d\n", i);
  }
 }

 return 0;

}


Tags:

Post a Comment

0Comments

Post a Comment (0)