import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
// System.out.println("Hello world!");
// FIND OUT Whether the given number N is a prime number or composite number.
// Scanner scn = new Scanner(System.in);
// int n = scn.nextInt();
// int count = 0;
// if(n<=1){
// System.out.println("Please enter a number greater than 1");
// }
// else{for(int i=1;i<=n;i++){
// if(n%i==0){
// count++;
// }
// if(count>2){
// break;
// }
// }if(count==2){
// System.out.println("Prime Number");
// }else{
// System.out.println("Composite Number");
// }
// }
//-------------------------------------------------------------
// Scanner scn = new Scanner(System.in);
// int A = scn.nextInt();
// int B = scn.nextInt();
// int N = 0;
// int hcf = 1;
// if(A>=B){
// N=B;
// }else{
// N=A;
// }
// for(int i=1;i<=N;i++){
// if(A%i==0&&B%i==0){
// hcf=i;
// }
// }System.out.println(hcf);
// ----------------------------------------------------LECTURE CLASS PROBLEM:----------------------------------------------------
// Scanner scn = new Scanner(System.in);
// int N = scn.nextInt();
// int count = 0;
// int num=0;
// for(int i=1;i<=N;i++){
// if(count>2){
// break;
// }
// if(N%i==0){
// count++;
// }
// }
// if(count==2){
// System.out.println("Yes");
// }else{
// System.out.println("No");
// }
//-------------------------------------------------------------
//==============================================ASSIGNMENTS==========================================================================================
// Q1. Problem Description: Print Factors of a Number
// Take an integer N as input and print its factors.
// The factor of a number is the number that divides it perfectly leaving no remainder.
// Example: 1, 2, 3, and 6 are factors of 6.
// Problem Constraints: 1 <= N <= 300
// Input Format: The first and only line of input contains a single integer N.
// Output Format: Print the factors of N space separated.
// Example Input
// Input 1: 5
// Input 2: 10
// Example Output
// Output 1: 1 5
// Output 2: 1 2 5 10
// Scanner scn = new Scanner(System.in);
// int n = scn.nextInt();
// for(int i=1; i<=n;i++){
// if(n%i==0){
// System.out.print(i + " ");
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q2. Problem Description: Is It Prime?
// Take an integer A as input, you have to tell whether it is a prime number or not.
// A prime number is a natural number greater than 1 which is divisible only by 1 and itself.
// Problem Constraints: 1 <= A <= 106
// Input Format: First and only line of the input contains a single integer A.
// Output Format: Print YES if A is a prime, else print NO.
// Example Input
// Input 1: 3
// Input 2: 4
// Example Output
// Output 1:YES
// Output 2: NO
// Scanner scn = new Scanner(System.in);
// int A = scn.nextInt();
// int count = 0;
// if(A<2){
// System.out.println("");
// }
// else{
// for(int i=1;i<=A;i++){
// if(A%i==0){
// count++;
// }if(count>2){
// break;
// }
// }if(count>2){
// System.out.println("NO");
// }else{
// System.out.println("Yes");
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q3. Problem Description: LCM - Easy
// Implement a program that takes two positive integers A and B in the input and prints their LCM.
// Definition of LCM : The Least Common Multiple or LCM of two numbers say A and B, is denoted as LCM (A,B). And the LCM is the smallest or least positive integer that is divisible by both A and B.
// Problem Constraints: 1 <= A,B <= 200
// Input Format: Two space separated integers A and B in the input.
// Output Format: Output a single integer that is the LCM of A and B.
// Example Input : Input 1: 5 10 || Input 2: 2 3
// Example Output : Output 1: 10 || Output 2: 6
// Scanner scn = new Scanner(System.in);
// int A = scn.nextInt();
// int B = scn.nextInt();
// for(int i=1;i<=A*B;i++){
// if(i%A==0&&i%B==0){
// System.out.println(i);
// break;
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q4. Problem Description: HCF - Easy
// Write a program to input two integers A & B from user and print their HCF.
// Definition Of HCF: The HCF(Highest Common Factor) or the GCD(greatest common
// divisor) of two positive integers happens to be the largest positive integer that
// divides the numbers without leaving a remainder.
// Problem Constraints: 1 <= A,B <= 100000
// Input Format: First line will contain 2 integers A and B
// Output Format: An integer which is the HCF of A & B.
// Example Input: Input 1: 15 105 || Input 2: 24 36
// Example Output: Output 1: 15 || Output 2: 12
// Scanner scn = new Scanner(System.in);
// int A = scn.nextInt();
// int B = scn.nextInt();
// int N = 0;
// int hcf=0;
// if(A>B){
// N=B;
// }else if (B>A){
// N=A;
// }
// for(int i=1;i<=N;i++){
// if(A%i==0&&B%i==0){
// hcf=i;
// }
// }System.out.print(hcf);
// -----------------------
// Scanner scn = new Scanner(System.in);
// int A = scn.nextInt();
// int B = scn.nextInt();
// int N =0;
// int hcf=1;
// if(A>=B){
// N=B;
// }else{
// N=A;
// }
// for(int i=1;i<=N;i++){
// if(A%i==0&&B%i==0){
// hcf=i;
// }
// }System.out.println(hcf);
//--------------------------------------------------------------------------------------------------------------
// Q5. Problem Description: Print A to B except X and Y - continue
// Given A, B, X and Y, Print all the numbers from A to B except X and Y.
// Problem Constraints
// -100000 <= A, B <= 100000
// A <= B
// A <= X, Y <= B
// Input Format
// In first line, take A from user.
// In second line, take B from user.
// In third line, take X from user.
// In fourth line, take Y from user.
// Output Format: Print values in single line, give one space after every element.
// Example Input
// Input 1 : 1 10 4 7 || Input 2 : 7 13 9 12
// Example Output Output 1 : 1 2 3 5 6 8 9 10 || Output 2 : 7 8 10 11 13
// Example Explanation: Explanation 1 : In the range 1 to 10 all values except 4 & 7 are -> 1 2 3 5 6 8 9 10
// Explanation 2 : In the range 7 to 13 all values except 9 & 12 are -> 7 8 10 11 13
// Scanner scn = new Scanner(System.in);
// int A = scn.nextInt();
// int B = scn.nextInt();
// int X = scn.nextInt();
// int Y = scn.nextInt();
// for(int i=A;i<=B;i++){
// if(i==X || i==Y){
// continue;
// }System.out.print(i + " ");
// }
//--------------------------------------------------------------------------------------------------------------
// Q6. For loop-2 MCQ E
// A Highest Common Factor (HCF) of a,b is defined as _______.
// A. It is the smallest integer divisible by both a and b
// B. It is the greatest integer divisor of both a and b - CORRECT ANSWER.
// C. It is the sum of the number a and b
// D. None of the above
//--------------------------------------------------------------------------------------------------------------
// Q7. For loop-2 MCQ F
// A Least Common Multiple (LCM) of a, b is defined as _____.
// A. It is the smallest integer divisible by both a and b - CORRECT ANSWER.
// B. It is the greatest integer divisible by both a and b
// C. It is the sum of the number a and b
// D. None of the above
//--------------------------------------------------------------------------------------------------------------
// Q8. For loop-2 MCQ H
// What keyword is used to end the current loop iteration and proceed execution with the next iteration of that loop?
// A. break
// B. continue - CORRECT ANSWER.
// C. end
// D. skip
//--------------------------------------------------------------------------------------------------------------
// Q9. For loop-2 MCQ I
// What if the output of the following program?
// A. 1
// B. 0 - CORRECT ANSWER
// C. 10
// D. 9
// import java.util.*;
// public class Main {
// public static void main(String[] args) {
// int i = 0;
// for(i = 0; i < 10; i++) {
// break;
// }System.out.println(i);
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q10. For loop-2 MCQ A
// For any two numbers N and i (where N >= i), if (N % i) == 0, then what is the relation between N and i?
// A. i is multiple of N
// B. i is factor of N - CORRECT ANSWER
// C. i is even and N is odd
// D. i is odd and N is even
//--------------------------------------------------------------------------------------------------------------
// Q11. For loop-2 MCQ B
// Write the correct output for the following code :
// A. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// B. 2 4 6 8 10 12 14 16 18 20
// C. 1 2 4 5 10 20 - CORRECT ANSWER (ALL THE NUMBER AS 'i' THAT DIVIDES N WITHOUT LEAVING ANY REMAINDER - ONLY ZERO '0')
// D. 1 3 5 7 9 11 13 15 17 19
// import java.util.*;
// public class Main {
// public static void main(String[] args) {
// int n = 20;
// for (int i = 1; i <= n; i++) {
// if (n % i == 0) {
// System.out.print(i + " ");
// }
// }
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q12. For loop-2 MCQ C
// If A, B are two distinct prime numbers then the highest common factor of A & B will be
// A. 2
// B. 0
// C. 1 - CORRECT ANSWER
// D. A * B
//--------------------------------------------------------------------------------------------------------------
// Q13. For loop-2 MCQ D
// The number of factors of a prime numbers are :
// A. 2 - CORRECT ANSWER - PRIME NUMBERS ARE DIVISIBLE ONLY BY ITSELF AND NUMBER 1. HENCE, ONLY TWO FACTORS.
// B. 3
// C. Depends on the prime number
// D. None of the above
// ----------------------------------------------- //
//---------------------------------------------------ADDITIONAL PROBLEMS-----------------------------------------------------------
// Q1. Problem Description: Count factors
// Take an integer N as input and print the count of its factors.
// The factor of a number is the number that divides it perfectly leaving no remainder.
// Example: 1, 2, 3, and 6 are factors of 6
// Problem Constraints: 1 <= N <= 300
// Input Format: The first and only line of input contains a single integer N.
// Output Format: Print the count of factors of N.
// Example Input
// Input 1: 5 || Input 2: 10
// Example Output Output 1: 2 || Output 2: 4
// Example Explanation
// Explanation 1: Factors of 5 are 1 and 5.
// Explanation 2: Factors of 10 are 1, 2, 5 and 10.
// Scanner scn = new Scanner(System.in);
// int N = scn.nextInt();
// int count = 0;.
// for(int i=1;i<=N;i++){
// if(N%i==0){
// count++;
// }
// }System.out.print(count);
//--------------------------------------------------------------------------------------------------------------
// Q2. Problem Description: Is It Perfect?
// Given the Number of Test Cases as T, For each test case, take an integer N as input, you have to tell whether it is a perfect number or not.
// A perfect number is a positive integer that is equal to the sum of its proper positive divisors (excluding the number itself). A positive proper divisor divides a number without leaving any remainder.
// Problem Constraints 1 <= T <= 10 || 1 <= N <= 106
// Input Format: The first line of the input contains a single integer T. Each of the next T lines contains a single integer N.
// Output Format: For each testcase, print YES if the given integer is perfect, else print NO, in a separate line
// Example Input: Input 1: 2 4 6 || Input 2: 1 3
// Example Output Output 1: NO YES || Output 2: NO
// Example Explanation
// Explanation 1:
// For the first test case A = 4, the answer is "NO" as sum of its proper divisors = 1 + 2 = 3, is not equal to 4.
// For the second test case A = 6, the answer is "YES" as sum of its proper divisors = 1 + 2 + 3 = 6, is equal to 6.
// Explanation 2:
// For the first test case A = 3, the answer is "NO" as sum of its proper divisors = 1, is not equal to 3.
// Scanner scn = new Scanner(System.in);
// int T = scn.nextInt();
// for(int i=1;i<=T;i++){
// int N = scn.nextInt();
// int perfect=0;
// for(int j=1;j<N;j++){
// if(N%j==0){
// perfect=perfect+j;
// }
// }if(perfect==N){
// System.out.println("YES");
// }else{
// System.out.println("NO");
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q3. Problem Description: Print the Primes!
// You are given an integer N you need to print all the Prime Numbers between 1 and N.
// Prime numbers are numbers that have only 2 factors: 1 and themselves. For example, the first 5 prime numbers are 2, 3, 5, 7, and 11.
// Problem Constraints
// 1 <= N <= 300
// Input Format
// First and only line of input contains a single integer N.
// Output Format
// Print all the prime numbers between between 1 and N each in a new line.
// Example Input
// Input 1: 5
// Input 2: 10
// Example Output
// Output 1: 2 3 5
// Output 2: 2 3 5 7
// Example Explanation
// Explanation 1: Prime numbers between [1, 5] are (2, 3, 5).
// Explanation 2: Prime numbers between [1, 10] are (2, 3, 5, 7)
// Scanner scn = new Scanner(System.in);
// int N = scn.nextInt();
// for(int i=2;i<=N;i++){
// int count = 0;
// int prime = 0;
// for(int j=1;j<=i;j++){
// prime = j;
// if(i%j==0){
// count=count+1;
// }if(count>=3){
// break;
// }
// }if(count==2){
// System.out.println(prime);
// }
// }
//--------------------------------------------------------------------------------------------------------------
// Q4. Problem Description: Largest Multiple of X from 1 to N
// Given two numbers N and X, Print largest multiple of X from 1 to N.
// Multiple : if A % B == 0, then A is multiple of B.
// Problem Constraints 0 < N <= 100000 || 0 < X <= 100000
// Input Format: In first line, take N from user. || In second line, take X from user.
// Output Format: Print largest multiple in single line.
// Example Input--> Input 1 : 10 | 4 || Input 2 : 90 | 25
// Example Output--> Output 1 : 8 || Output 2 : 75
// Example Explanation--> Explanation 1 : Between 1 to 10, all multiple of 4 is 4 and 8 || So largest multiple of 4 between 1 t 10 is 8.
// Explanation 2 : Between 1 to 90, all multiple of 25 is 25, 50 and 75 || So largest multiple of 25 between 1 t 90 is 75.
// Scanner scn = new Scanner(System.in);
// int N = scn.nextInt();
// int X = scn.nextInt();
// int mul = 0;
// for(int i=1; i<=N; i++){
// if(i%X==0){
// mul = i;
// }
// }System.out.print(mul + " ");
//--------------------------------------------------------------------------------------------------------------
// Q5. Problem Description: Smallest Multiple of X from A to B
// Given three numbers X, A and B, Print smallest multiple of X from A to B.
// Multiple : if n % m == 0, then n is multiple of m.
// Problem Constraints: 0 < X <= 100000 || 0 < A <= 100000 || 0 < B <= 100000
// Input Format: In first line, take X from user. || In second line, take A from user. || In third line, take B from user.
// Output Format: Print smallest multiple in single line.
// Example Input --> Input 1 : 4 18 30 || Input 2 : 25 20 100 ||
// Example Output--> Output 1 : 20 || Output 2 : 25 ||
// Example Explanation:
// Explanation 1 : Between 18 to 30, all multiple of 4 is 20, 24, 28 || So smallest multiple of 4 between 18 to 30 is 20.
// Explanation 2 : Between 20 to 100, all multiple of 25 is 25, 50, 75 and 100 || So smallest multiple of 25 between 20 to 100 is 25.
Scanner scn = new Scanner(System.in);
int X = scn.nextInt();
int A = scn.nextInt();
int B = scn.nextInt();
for(int i=A;i<=B;i++){
if(i%X==0){
System.out.print(i + " ");
// break;
}
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//==============================================ASSIGNMENTS==========================================================================================
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: