fork(3) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Podzielnosc
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. List<int> l = new List<int>();
  14. List<List<int>> lista = new List<List<int>>();
  15. int t = int.Parse(Console.ReadLine());
  16. for (int i = 0; i < t; i++)
  17. {
  18. string n = Console.ReadLine();
  19. List<int> x = n.Split(' ').Select(Int32.Parse).ToList();
  20. List<int> wynik = new List<int>();
  21. for (int j = 1; j < x[0]; j++)
  22. {
  23. if ((j%x[1]==0) & (j % x[2] != 0))
  24. {
  25. wynik.Add(j);
  26. }
  27. }
  28. lista.Add(wynik);
  29. }
  30. for (int i = 0; i < lista.Count; i++)
  31. {
  32. l = lista[i];
  33. for (int j = 0; j < l.Count; j++)
  34. {
  35. if (j == (l.Count - 1))
  36. {
  37. Console.Write(l[j]); break;
  38. }
  39. Console.Write(l[j] + " ");
  40. }
  41. Console.WriteLine();
  42. }
  43. }
  44. }
  45. }
  46.  
Success #stdin #stdout 0s 131776KB
stdin
2
7 2 4
35 5 12
stdout
2 6 
5 10 15 20 25 30