Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem14
- {
- class Program
- {
- static void Main(string[] args)
- {
- int t = int.Parse(Console.ReadLine());
- for (int i = 0; i < t; i++)
- {
- string[] tab = Console.ReadLine().Split(' ');
- Console.WriteLine(Podzielnosc(int.Parse(tab[0]), int.Parse(tab[1]), int.Parse(tab[2])));
- }
- }
- private static string Podzielnosc(int n, int x, int y)
- {
- string wynik = "";
- for (int i = 1; i < n; i++)
- {
- if (i % x == 0 && i % y != 0)
- {
- wynik += i + " ";
- }
- }
- return wynik;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment