using System.Collections.Generic;
private string firstName;
public Person(string firstName, string lastName, int age)
this.FirstName = firstName;
this.LastName = lastName;
public Person(string firstName, string lastName, int age, double salary)
this.FirstName = firstName;
this.LastName = lastName;
get { return this.firstName; }
set { this.firstName = value; }
get { return this.lastName; }
set { this.lastName = value; }
set { this.age = value; }
get { return this.salary; }
set { this.salary = value; }
public override string ToString()
return $"Person with name {this.FirstName} {this.LastName} and age {this.Age} gets {this.Salary} got salary";
public void IncreaseSalary(double percent)
this.Salary += this.Salary * percent / 100;
Console.WriteLine($"{this.FirstName} {this.LastName} and age {this.Age} got {this.Salary * percent / 100} salary");
this.Salary += this.Salary * percent / 200;
Console.WriteLine($"{this.FirstName} {this.LastName} and age {this.Age} got {this.Salary * percent / 100} salary");
public static void Main()
int lines = int.Parse(Console.ReadLine());
List<Person> people = new List<Person>();
for (int i = 0; i < lines; i++)
string[] cmdArgs = Console.ReadLine().Split();
double.Parse(cmdArgs[3]));
var percent = double.Parse(Console.ReadLine());
foreach (Person person in people)
person.IncreaseSalary(percent);
.OrderBy(p => p.FirstName)
.ForEach(p => Console.WriteLine(p));