Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Dragons_Hatching
- {
- class Program
- {
- static void Main(string[] args)
- {
- int teams = int.Parse(Console.ReadLine());
- double dragonsHatchingValue = double.Parse(Console.ReadLine());
- double sum = 0;
- for (int i = 0; i < teams; i++)
- {
- string[] input = Console.ReadLine().Split(' ');
- long dragonsHatched = long.Parse(input[0]);
- long teamMembersCount = long.Parse(input[1]);
- double teamPoints = (double)dragonsHatched / teamMembersCount;
- sum += teamPoints;
- }
- if (dragonsHatchingValue != 0)
- {
- double result = sum / dragonsHatchingValue;
- Console.WriteLine($"{result:f3}");
- }
- else
- {
- Console.WriteLine($"{sum:f3}");
- }
- }
- }
- }
- using System;
- namespace Survival_Message
- {
- class Program
- {
- static void Main(string[] args)
- {
- int firstNum = int.Parse(Console.ReadLine());
- char firstUpper = char.Parse(Console.ReadLine().ToUpper());
- char lowerLetter = char.Parse(Console.ReadLine().ToLower());
- char secondUpper = char.Parse(Console.ReadLine().ToUpper());
- int fifthNum = int.Parse(Console.ReadLine());
- int count = int.Parse(Console.ReadLine());
- int counter = 0;
- for (int i = firstNum; i <= 99; i++)
- {
- for (char j = firstUpper; j <= 'Z'; j++)
- {
- for (char k = lowerLetter; k <= 'z'; k++)
- {
- for (char m = secondUpper; m <= 'Z'; m++)
- {
- for (int n = fifthNum; n >= 10; n--)
- {
- if (i % 10 == 2 && n % 10 == 5)
- {
- counter++;
- if (counter == count)
- {
- Console.WriteLine($"{i}{j}{k}{m}{n}");
- Environment.Exit(0);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace The_Great_Samurai_Battle
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> samuraiMasters = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- bool[] deadIndexes = new bool[samuraiMasters.Count];
- for (int i = 0; i < samuraiMasters.Count; i++)
- {
- deadIndexes[i] = true;
- }
- int trueCount = deadIndexes.Count(x => x);
- int sequenceLength = samuraiMasters.Count;
- while (trueCount != 1)
- {
- for (int attackerIndex = 0; attackerIndex < sequenceLength; attackerIndex++)
- {
- if (deadIndexes.Count(x => x)==1)
- {
- return;
- }
- if (deadIndexes[attackerIndex] == false)
- {
- continue;
- }
- int targetIndex = samuraiMasters[attackerIndex] % trueCount;
- int difference = Math.Abs(attackerIndex - targetIndex);
- if (difference == 0)
- {
- deadIndexes[attackerIndex] = false; ;
- Console.WriteLine($"{attackerIndex} performed harakiri");
- }
- else if (difference % 2 != 0)
- {
- deadIndexes[attackerIndex] = false; ;
- Console.WriteLine($"{attackerIndex} x {targetIndex} -> {targetIndex} wins");
- }
- else if (difference % 2 == 0)
- {
- deadIndexes[targetIndex] = false;
- Console.WriteLine($"{attackerIndex} x {targetIndex} -> {attackerIndex} wins");
- }
- }
- trueCount = deadIndexes.Count(x => x);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment