using using using using

System; System.Collections.Generic; System.Linq; System.Text;

class Solution {

static void Main(string[] args) { int NoC = 1; List<int> PrimeList = GetPrimeList(12); List<int> PrimeFactor = PrimeFactorList(PrimeList, 12); NoC = PFCombination(PrimeFactor, PrimeList); Console.WriteLine(NoC); } static private bool IsPrime(int Num) { bool Prime = true; if (Num == 1) { Prime = false; } else if (Num == 2) { Prime = true; } else { for (int i = 2; i < (Math.Sqrt(Num) + 1); i++) { if (Num % i == 0) { Prime = false; } } } return Prime; } static private void Equations() { string[] NS = (Console.ReadLine()).Split(); int N = Int32.Parse(NS[0]); int NoC = 1;

j < (Num + 1). } static private int PFCombination(List<int> PrimeFactor.Add(2). NoC = PFCombination(PrimeFactor. PrimeFactor. . i < (Num + 1).List<int> PrimeList = GetPrimeList(N). } static private List<int> PrimeFactorList(List<int> PrimeList. PrimeList). while (x % Menber == 0) { x = x / Menber. j++) { int x = j. N). List<int> PrimeList) { int NumPrime = 1.Add(Menber). if (Num == 2) PrimeList. int Num) { int len = PrimeList. } } } return PrimeFactor.Add(i). i < len.WriteLine(NoC). Console. i++) { int Menber = PrimeList[i]. List<int> PrimeFactor = new List<int>(). } static private List<int> GetPrimeList(int Num) { List<int> PrimeList = new List<int>(). for (int i = 0.Count. i++) { if (IsPrime(i)) { PrimeList. List<int> PrimeFactor = PrimeFactorList(PrimeList. } } } return PrimeList. for (int j = 2. else { for (int i = 2.

Count(). for (int i = 0. } return FJC. } FJC *= NumPrime. NumPrime = 1. } } . i < PrimeList.int FJC = 1. i++) { foreach (int j in PrimeFactor) { if (j == PrimeList[i]) NumPrime++.

Sign up to vote on this title
UsefulNot useful