Using LINQ to Objects
Processing Single Sequences
LinqObj1°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Client code> <Year> <Month number> <Session length (in hours)> Find the sequence element with the minimum session length. Output this length and its corresponding year and month number (in the specified order on the same line). If there are several elements with the minimum length, output the data of the element that is the last in the initial sequence.
LinqObj2°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Month number> <Year> <Client code> <Session length (in hours)> Find the sequence element with the maximum session length. Output this length and its corresponding year and month number (in the specified order on the same line). If there are several elements with the maximum length, output the data corresponding to the latest date.
LinqObj3°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Year> <Month number> <Session length (in hours)> <Client code> Determine the year in which the total session length of all clients was the longest, and output that year and the longest total length. If there were several such years, output the minimal one.
LinqObj4°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Year> <Month number> <Session length (in hours)> <Client code> For each client present in the source data, determine the total session length for all years (output the total length first, then the client code). The information about each client should be displayed on a new line and ordered by descending total length, and if they are equal — by ascending client code.
LinqObj5°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Client code> <Session length (in hours)> <Year> <Month number> For each client present in the source data, determine the total number of months during which he/she attended classes (first output the number of months, then the client code). The information about each client should be displayed on a new line and ordered by ascending number of months, and if they are equal — by ascending client code.
LinqObj6°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Client code> <Session length (in hours)> <Year> <Month number> For each month, determine the total session length of all clients for all years (output the total length first, then the month number). If there is no data about some month, output 0 for this month. Information about each month should be output on a new line and ordered by descending total length, and in case of equal length — by ascending month number.
LinqObj7°. An integer K is the code of one of the clients of the fitness center. The initial sequence contains information about clients of this fitness center. Each element of the sequence includes the following integer fields: <Session length (in hours)> <Year> <Month number> <Client code> For each year, in which the client with the code K visited the center, determine the month in which the session length of this client was the longest for this year (if there are several such months, select the month with the lowest number). The information about each year should be displayed on a new line in the following order: year, month number, session length in this month. Arrange the information in descending order of the year number. If there is no data about the client with code K, write the line "No data" to the resulting file.
LinqObj8°. An integer K is the code of one of the clients of the fitness center. The initial sequence contains information about clients of this fitness center. Each element of the sequence includes the following integer fields: <Session length (in hours)> <Client code> <Year> <Month number> For each year in which the client with the code K visited the center, determine the month in which the session length of this client was the shortest for this year (if there are several such months, select the first of these months in the initial sequence; months with zero session length are not considered). The information about each year should be displayed on a new line in the following order: the shortest session length, year, month number. Arrange the information in ascending order of the session length, and in case of equal length — in ascending order of the year number. If there is no data about the client with code K, write the line "No data" to the resulting file.
LinqObj9°. An integer K is the code of one of the clients of the fitness center. The initial sequence contains information about clients of this fitness center. Each element of the sequence includes the following integer fields: <Client code> <Session length (in hours)> <Month number> <Year> For each year in which the client with the code K visited the center, determine the number of months for which the session length of this client exceeded 15 hours (first output the number of months, then the year). If the required months are missing for some year, output 0 for it. Output information about each year on a new line; the data should be ordered by descending number of months, and in case of equal number of months — by ascending of the year number. If there is no data about the specified client, write the line "No data" to the resulting file.
LinqObj10°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Year> <Month number> <Client code> <Session length (in hours)> For each "year–month" pair present in the source data, determine the number of clients who visited the center at the specified time (the year is displayed first, then the month, then the number of clients). The information about each "year–month" pair should be displayed on a new line and ordered by descending year number, and for the same year number — by ascending month number.
LinqObj11°. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Client code> <Year> <Month number> <Session length (in hours)> For each "year–month" pair present in the source data, determine the total session length of all clients at the specified time (the total length is displayed first, then the year, then the month). The information about each "year–month" pair should be displayed on a new line and ordered by ascending total length, for the same length — by descending year number, and for the same year number — by ascending month number.
LinqObj12°. An integer P (10 < P < 50) is given. The initial sequence contains information about clients of the fitness center. Each element of the sequence includes the following integer fields: <Session length (in hours)> <Client code> <Month number> <Year> For each year present in the source data, determine the number of months in which the total session length of all clients was more than P percent of the total length for that year (output the number of months first, then the year). If for a some year, the required condition is not fulfilled for any month, then output 0 for this year. Information about each year should be displayed on a new line and ordered by descending number of months, and for the same number of months — by ascending the year number.
LinqObj13°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <School number> <Year of enrollment> <Family name> For each year present in the source data, find the school with the highest number among the schools graduated from by the entrants enrolled in that year and output the year and the found school number. Output the information about each year on a new line and arrange it in ascending order of the year number.
LinqObj14°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Year of enrollment> <School number> <Family name> Determine in which years the total number of entrants for all schools was the highest and output this number and the number of such years. Output both numbers on the same line.
LinqObj15°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <School number> <Year of enrollment> <Family name> Determine in which years the total number of entrants for all schools was the highest, and output this number, as well as the years in which it was reached (arrange the years in ascending order, output the highest number of entrants and the year on each line).
LinqObj16°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Year of enrollment> <School number> <Family name> For each year present in the source data, output the total number of entrants enrolled in that year (first output the number of entrants, then the year). The information about each year should be displayed on a new line and ordered by descending number of entrants, and for the same number of entrants — by ascending the year number.
LinqObj17°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <School number> <Year of enrollment> <Family name> For each year present in the source data, output the number of different schools graduated from by the entrants enrolled in that year (first output the number of schools, then the year). The information about each year should be displayed on a new line and arranged in ascending order of the number of schools, and for the same number of schools — in ascending order of the year number.
LinqObj18°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Year of enrollment> <School number> <Family name> Find the years for which the number of entrants was not less than the average of all years (first output the number of entrants for the given year, then the year). Output the information about each year on a new line and order it by descending number of entrants, and for the same number of entrants — by ascending the year number.
LinqObj19°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Family name> <Year of enrollment> <School number> For each school, output the total number of entrants for all years and the family name of the first entrant of this school contained in the initial sequence (first output the school number, then the number of entrants, then the family name). Output the information about each school on a new line and arrange it in ascending order of school numbers.
LinqObj20°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Family name> <School number> <Year of enrollment> Determine for which schools the total number of entrants for all years was the highest, and output data on entrants from these schools (first output the school number, then the family name of the entrant). The information about each entrant should be displayed on a new line and arranged in ascending order of school numbers, and for the same school number — in the order of entrants in the initial sequence.
LinqObj21°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Family name> <Year of enrollment> <School number> Determine for which schools the total number of entrants for all years was the highest, and output for each of these schools the data about the first entrant in alphabetical order (first output the entrant's family name, then the school number). Output the information about each entrant on a new line and arrange it in alphabetical order of family names, and for the same family name — in ascending order of school numbers.
LinqObj22°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Family name> <School number> <Year of enrollment> For each school, find the years of enrollment of entrants from this school and output the school number and the years found for it (the years are located on the same line as the school number and are arranged in ascending order). Output the information about each school on a new line and arrange the school numbers in ascending order.
LinqObj23°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Family name> <Year of enrollment> <School number> For each "year–school" pair present in the initial data, find the number of entrants belonging to that year and school and output the year, school number and the number of entrants found. Output the information about each "year–school" pair on a new line and order it by descending year number, and for the same year — by ascending school number.
LinqObj24°. The initial sequence contains information about the university entrants. Each element of the sequence includes the following fields: <Family name> <School number> <Year of enrollment> For each "school–year" pair present in the initial data, find the first three entrants belonging to that school and year, and output the school number, year and the found family names (in the order they appear in the initial sequence). If there are less than three entrants for some "school–year" pair, output information about all entrants belonging to this pair. Output information about each "school–year" pair on a new line and arrange the school number in ascending order, and for the same school number — in descending order of the year numbers.
LinqObj25°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Family name> <Debt> <Apartment number> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. Find the entrance, whose residents have the largest total debt, and output this entrance number together with the size of the total debt (output with two fractional digits). It should be assumed that the total debts for all entrances have different values.
LinqObj26°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Apartment number> <Family name> <Debt> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 4 entrances of the building, output information about the debtors living in this entrance: the entrance number, number of debtors, average debt for the residents of this entrance (output with two fractional digits). Residents who have no debt are not taken into account when calculating the average debt. Information about each entrance should be displayed on a new line and ordered by ascending entrance number. If there are no debtors in any of the entrances, the data about this entrance is not output.
LinqObj27°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Family name> <Apartment number> <Debt> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 9 floors of the building, output information about the debtors living on this floor: the number of debtors, floor number, total debt for the residents of this floor (output with two fractional digits). Information about each floor should be displayed on a new line and ordered by ascending number of debtors, and for the same number of debtors — by ascending floor number. If there are no debtors on any floor, the data about this floor should not be output.
LinqObj28°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Debt> <Family name> <Apartment number> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 9 floors of the building, output information about the debtors living on this floor: floor number, total debt for the residents of this floor (displayed with two fractional digits), number of debtors. Information about each floor should be displayed on a new line and ordered by descending floor number. If there are no debtors on any floor, then output zero data for this floor.
LinqObj29°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Apartment number> <Family name> <Debt> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 4 entrances of the building, find the resident with the highest debt and output information about him: entrance number, apartment number, family name of the resident, debt (output with two fractional digits). It should be assumed that in the initial sequence all debts have different values. The information about each debtor should be displayed on a new line and ordered by ascending entrance number. If there are no debtors in any of the entrances, then the data about this entrance should not be output.
LinqObj30°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Family name> <Debt> <Apartment number> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 9 floors of the building, find the resident with the lowest debt and output information about him: apartment number, floor number, family name of the resident, debt (output with two fractional digits). It should be assumed that all debts in the initial sequence have different values. The information about each debtor should be displayed on a new line and ordered by ascending apartment number. If there are no debtors on any floor, do not output data about this floor.
LinqObj31°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Debt> <Family name> <Apartment number> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 4 entrances of the building, find three residents with the highest debt and output information about them: debt (displayed with two fractional digits), entrance number, apartment number, family name of the resident. It should be assumed that all debts in the initial sequence have different values. The information about each debtor should be displayed on a new line and sorted in descending order by the size of the debt (do not take into account the entrance number when sorting). If the number of debtors in any entrance is less than three, then include all debtors of this entrance in the obtained set.
LinqObj32°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Family name> <Apartment number> <Debt> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 9 floors of the building, find the resident with the lowest debt and output information about him: floor number, debt (output with two fractional digits). It should be assumed that all debts in the initial sequence have different values. The information about each floor should be output on a new line and ordered by ascending floor number. If there are no debtors on any floor, output the debt equal to 0.00 for that floor.
LinqObj33°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Apartment number> <Debt> <Family name> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. Find the residents whose debt is not less than the average debt for the building and output information about them: apartment number, family name, debt (output with two fractional digits). Residents who have no debt are not taken into account when calculating the average debt. Information about each debtor should be displayed on a new line and arranged in ascending order of apartment numbers.
LinqObj34°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Debt> <Apartment number> <Family name> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. Find the residents whose debt is not greater than the average debt for the building and output information about them: floor number, apartment number, family name, debt (output with two fractional digits). Residents who have no debt are not taken into account when calculating the average debt. Information about each debtor should be displayed on a new line and ordered by descending floor number, and for the same floor number — by ascending apartment number.
LinqObj35°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Debt> <Family name> <Apartment number> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 4 entrances of the building, find the debtors whose debt is not less than the average debt for this entrance, and output information about them: entrance number, debt (displayed with two fractional digits), family name, apartment number. Residents who have no debt are not taken into account when calculating the average debt. Information about each debtor should be displayed on a new line and ordered by ascending entrance number, and for the same entrance — by descending debt size. It should be assumed that all debts in the initial sequence have different values.
LinqObj36°. The initial sequence contains information about utility debtors living in a 144-apartment 9-storey building. Each element of the sequence includes the following fields: <Apartment number> <Family name> <Debt> The debt is indicated as a fractional number. There are 4 apartments on each floor in each of four entrances. For each of the 9 floors of the building, find the debtors whose debt is not more than the average debt for this floor, and output information about them: floor number, debt (displayed with two fractional digits), family name, apartment number. Residents who have no debt are not taken into account when calculating the average debt. Information about each debtor should be displayed on a new line and ordered by ascending floor number, and for the same floor — by ascending debt size. It should be assumed that all debts in the initial sequence have different values.
LinqObj37°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Company> <Gasoline brand> <Price> <Street> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each brand of gasoline present in the source sequence, determine the minimum and maximum price of a liter of gasoline of this brand (first output the brand, then the prices in the specified order). The information about each brand should be displayed on a new line and ordered by the descending brand number.
LinqObj38°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Price> <Gasoline brand> <Company> <Street> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each brand of gasoline present in the source sequence, determine the number of stations offering this brand (first output the number of stations, then the brand number). The information about each brand should be displayed on a new line and ordered by ascending number of gas stations, and for the same number of gas stations — by ascending brand number.
LinqObj39°. Given an integer M is the value of one of the brands of gasoline. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Street> <Company> <Gasoline brand> <Price> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each street, determine the number of gas stations that offered gasoline brand M (first output the number of gas stations on this street, then the street name; the number of gas stations can be equal to 0). The information about each street should be displayed on a new line and ordered by ascending number of gas stations, and for the same number of gas stations — by street names in alphabetical order.
LinqObj40°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Company> <Street> <Gasoline brand> <Price> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each street, determine the number of gas stations offering a certain brand of gasoline (first output the street name, then three numbers — the number of gas stations for 92, 95 and 98 brand; some of these numbers may be equal to 0). The information about each street should be displayed on a new line and organized alphabetically by street name.
LinqObj41°. Given an integer M is the value of one of the brands of gasoline. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Gasoline brand> <Street> <Company> <Price> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each street, where there are gas stations with brand M, determine the maximum price of gasoline of this brand (first output the maximum price, then street name). The information about each street should be displayed on a new line and ordered by ascending maximum price, and for the same price — by street names in alphabetical order. If no gas stations with brand M are found, write the line "No" to the resulting file.
LinqObj42°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Gasoline brand> <Company> <Street> <Price> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each street, determine the minimum price of each brand of gasoline (first output street name, then three numbers — the minimum price for 92, 95 and 98 brand). If there is no gasoline of the required brand, output the number 0. Information about each street should be output on a new line and ordered alphabetically by street names.
LinqObj43°. Given an integer M is the value of one of the brands of gasoline. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Price> <Gasoline brand> <Street> <Company> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each company, determine the price spread for gasoline of the specified brand M (first output the difference between the maximum and minimum price of gasoline of brand M for the gas station of the company, then company name). If gasoline of brand M was not offered by this company, then the spread should be equal to −1. Information about each company should be displayed on a new line, the data should be ordered by descending values of the spread, and for equal values of the spread — by company names in alphabetical order.
LinqObj44°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Gasoline brand> <Price> <Company> <Street> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each company, determine the price spread for all brands of gasoline (first output the company name, then three numbers — the price spread for gasoline brands 92, 95 and 98). If there is no gasoline of the required brand, output the number −1. Information about each company should be displayed on a new line and ordered alphabetically by company names.
LinqObj45°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Company> <Price> <Gasoline brand> <Street> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each street, determine the number of gas stations (first output the street name, then the number of gas stations). The information about each street should be displayed on a new line and ordered alphabetically by street names.
LinqObj46°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Street> <Gasoline brand> <Price> <Company> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. For each company, determine the number of gas stations that offered all three brands of gasoline (first output the number of gas stations, then the company name; the number can be equal to 0). The information about each company should be displayed on a new line and ordered by descending number of gas stations, and in case of equal numbers — by company names in alphabetical order.
LinqObj47°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Price> <Company> <Street> <Gasoline brand> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. Output information about all the gas stations that offered at least two brands of gasoline (first output the company name, then the street name, then the number of brands of gasoline offered). Information about each gas station should be displayed on a new line and ordered alphabetically by company names, and for the same company — by street names (also in alphabetical order). If no required gas station is found, then write the line "No" to the resulting file.
LinqObj48°. The initial sequence contains information about gas stations. Each element of the sequence includes the following fields: <Price> <Street> <Gasoline brand> <Company> Company and street names do not contain spaces. The numbers 92, 95 or 98 are indicated as gasoline brand. Each company has no more than one gas station on each street; prices at different gas stations of the same company may differ. Search all possible combinations of streets and companies contained in the initial sequence, and for each "street–company" pair output the street name, company name, and the number of gasoline brands offered by the gas station of the given company located on the given street (if there is no gas station, the number is assumed to be 0). The information about each pair should be displayed on a new line and ordered alphabetically by street names, and for the same street — by company names (also in alphabetical order).
LinqObj49°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Family name> <Initials> <School number> <Scores> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. Determine the lowest total score and output information about all students who received this score (for each student, output the family name, initials, school number, and total score). The information about each student should be displayed on a new line and arranged in the order of their succession in the initial sequence.
LinqObj50°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Family name> <Initials> <Scores> <School number> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. Determine the two highest total scores and output information about all students who received one of the two highest total scores (for each student, output the family name, initials and total score). The information about each student should be displayed on a new line and arranged in the order of their succession in the initial sequence. It should be assumed that the initial sequence always contains students with different total scores.
LinqObj51°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Scores> <Family name> <Initials> <School number> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school, output the information about the student who got the highest score in chemistry among the students of this school (first output the school number, then the student's family name, initials and score in chemistry). If there are several such students, output information about the first student in the order of their succession in the initial sequence. The information about each student should be displayed on a new line and arranged in ascending order of the school number.
LinqObj52°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <School number> <Family name> <Initials> <Scores> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school, output the student with the lowest total score among the students of that school (first output the school number, then the total score, family name and initials of the student). If there are several such students, output information about the first student in alphabetical order of their family names and initials. The information about each student should be displayed on a new line and arranged in descending order of the school number.
LinqObj53°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Family name> <Initials> <School number> <Scores> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school, determine the number of students whose total score exceeds 150 points (first output the number of students with a total score greater than 150 points, then the school number; the number of students can be 0). Information about each school should be displayed on a new line and ordered by descending number of students, and for the same number of students — by ascending school number.
LinqObj54°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Scores> <School number> <Family name> <Initials> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school, find the average value of the total score obtained by the students of this school (the average value is the result of integer dividing the sum of all students' scores by the number of students). Information about each school should be displayed on a new line, indicating the average total score and school number. The data should be ordered by descending average score, and in case of equal values of the average score — by ascending school number.
LinqObj55°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Scores> <Family name> <Initials> <School number> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. Output information about students who scored at least 50 points in each subject (first output the family name and initials, then the school number and the total score for all subjects). Information about each student should be displayed on a new line in alphabetical order of family names and initials, and if they coincide — in the order of students in the initial sequence. If none of the students meet the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj56°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Family name> <Initials> <Scores> <School number> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. Output information about students who scored more than 90 points in at least one of the subjects (first output the family name and initials, then the school number). Information about each student should be displayed on a new line and arranged in alphabetical order of family names and initials, and if they coincide — in ascending order of school number. If none of the students meet the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj57°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <School number> <Family name> <Initials> <Scores> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school, output the family names and initials of the first three students (in alphabetical order) who scored less than 50 points in each subject (first output school number, then family name and initials). Information about each student should be displayed on a new line and arranged in ascending order of school numbers, and for the same school number — in alphabetical order of family names and initials. If for some school there are less than three students meeting the specified conditions, output information about all such students. If there are no students in the initial sequence that meet the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj58°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Family name> <Initials> <School number> <Scores> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school, find the first three students (in alphabetical order) who scored less than 50 points in at least one subject and output their family name, initials and school number. Information about each student should be displayed on a new line and arranged in alphabetical order of family names and initials, and if they coincide — in ascending order of school number. If for some school there are less than three students meeting the specified conditions, output information about all such students. If there are no students in the initial sequence that meet the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj59°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <School number> <Scores> <Family name> <Initials> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school and each subject, determine the number of students who scored at least 50 points in that subject (the school number is displayed first, followed by three numbers — the number of students in that school who scored the required number of points in mathematics, physics and chemistry; some of the numbers may be equal to 0). The information about each school should be displayed on a new line and ordered by ascending school number.
LinqObj60°. The initial sequence contains information about the results of exams passed by students in mathematics, physics and chemistry (in the specified order). Each element of the sequence includes the following fields: <Family name> <Initials> <Scores> <School number> Scores are three integers ranging from 0 to 100, which are separated from each other by one space. For each school and each subject, find the average value of the score obtained by the students of this school (the average value is the result of integer dividing the sum of all students' scores by the number of students). Information about each school should be displayed on a new line, indicating the school number and average scores in mathematics, physics and chemistry. The data should be ordered by descending school number.
LinqObj61°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Family name> <Initials> <Class number> <Course name> <Grade> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. For each student, determine the average grade for each subject and output it with two fractional digits (if a student has not received any grade in any subject, output 0.00 for that subject). Output information about each student on a new line, indicating family name, initials and average grades in algebra, geometry and physics. Arrange the data in alphabetical order of family names and initials.
LinqObj62°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Class number> <Family name> <Initials> <Grade> <Subject name> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. For each student, determine the number of grades for each subject (if a student has not received any grade in any subject, then output the number 0 for that subject). Output information about each student on a new line, indicating class, family name, initials and number of grades in algebra, geometry and physics. The data should be arranged in ascending order of class numbers, and for the same class — in alphabetical order of family names and initials.
LinqObj63°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Subject name> <Family name> <Initials> <Class number> <Grade> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. Output information about students with an average grade of 4 or less in algebra: family name, initials, class number and average grade in algebra (output with two fractional digits). For students who do not have any algebra grade, consider the average grade to be 0.00. Information about each student should be displayed on a new line and arranged in alphabetical order of their family names and initials. If none of the students satisfies the specified conditions, write the text "Students not found" to the resulting file.
LinqObj64°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Class number> <Family name> <Initials> <Subject name> <Grade> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. Output information about students who have an average grade of at least 4 in physics: class number, family name, initials and average grade in physics (output with two fractional digits). Information about each student should be displayed on a new line and arranged in ascending order of class numbers, and for the same class — in alphabetical order of family names and initials. If none of the students meets the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj65°. The string S is the name of one of three subjects: algebra, geometry or physics. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Family name> <Initials> <Subject name> <Grade> <Class number> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. For each class present in the initial sequence, determine the number of students who have an average grade of 3.5 or less in subject S or who have no grades in this subject. Output each class on a new line, indicating the number of students found (the number can be 0) and the class number. The data should be ordered by ascending number of students, and for the same number — by descending class number.
LinqObj66°. The string S is the name of one of three subjects: algebra, geometry or physics. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Subject name> <Family name> <Initials> <Grade> <Class number> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. For each class present in the initial sequence, determine the number of students who have an average grade of at least 3.5 in subject S and who have not received a grade 2 in this subject. Output the information about each class on a new line, indicating the class number and the number of students found (the number can be equal to 0). The data should be ordered by ascending class number.
LinqObj67°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Class number> <Subject name> <Family name> <Initials> <Grade> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. Find all the students who received at least one grade 2 in a subject. Output information about each of these students: class number, family name, initials and the number of grades 2 received. The information about each student should be displayed on a new line and arrange it in descending order of classes, and for the same class — in alphabetical order of family names and initials. If there are no students in the initial sequence that meet the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj68°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Class number> <Grade> <Family name> <Initials> <Subject name> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. Find all students who have not received any grades 2 or 3, but have at least one grade 4 in any subject. Output information about each found student: the number of grades 4 received, family name, initials and class number. The information about each student should be displayed on a new line and arranged in ascending order of the number of grades 4, and for the same number — in alphabetical order of family names and initials. If there are no students in the initial sequence that meet the specified conditions, then write the text "Students not found" to the resulting file.
LinqObj69°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Class number> <Family name> <Initials> <Subject name> <Grade> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. For each class, find students who received the maximum total number of grades 2 in this class for all subjects (the number should not be zero). Output information about each of the found students: family name, initials, class number and the number of grades 2 received. The information about each student should be displayed on a new line and arranged in alphabetical order of their family names and initials (no sorting by class). If there are no grades 2 in the initial sequence, write the text "Students not found" to the resulting file.
LinqObj70°. The initial sequence contains information about students' grades in three subjects: algebra, geometry and physics. Each element of the sequence contains data about one grade and includes the following fields: <Grade> <Class number> <Family name> <Initials> <Subject name> There are no full namesakes (with matching last name and initials) among the students. Class number is specified as an integer, grade is an integer in the range of 2–5. The name of the subject is given with a capital letter. For each class, find the top-performing students, that is, students who received the maximum total number of grades 5 in the given class in all subjects (the number should not be zero). When searching for these students (in particular, when determining the maximum total number of grades 5), students with at least one grade 2 or 3 should be excluded. Output information about each of the top-performing students: class number, family name, initials and the number of grades 5 received. The information about each student should be displayed on a new line and arrange in ascending order of classes, and for the same classes — in alphabetical order of family names and initials. If there are no students in the initial sequence that meet the specified conditions, then write the text "Students not found" to the resulting file.
Processing Multiple Related Sequences
LinqObj71°. Sequences A and C are given, including the following fields: A: <Consumer code> <Year of birth> <Street of residence> C: <Consumer code> <Discount (percentage)> <Shop name> The properties of the sequences are described in the subgroup preamble. For each shop, determine the consumers who have the maximum discount in this shop (the shop name is displayed first, followed by the consumer code, his/her year of birth and the value of the maximum discount). If for some shop there are several consumers with the maximum discount, then output the data about the consumer with the minimum code. The information about each shop should be displayed on a new line and ordered alphabetically by shop name.
LinqObj72°. Sequences A and C are given, including the following fields: A: <Consumer code> <Street of residence> <Year of birth> C: <Discount (percentage)> <Consumer code> <Shop name> The properties of the sequences are described in the subgroup preamble. For each consumer specified in A, determine the number of shops in which he/she gets a discount (first output the number of shops, then the consumer code, then his/her street of residence). If some consumer does not have a discount in any shop, then the number of shops for him/her is output as zero. Information about each consumer should be displayed on a new line and ordered by ascending number of shops, and for the same number — by ascending consumer code.
LinqObj73°. Sequences A and C are given, including the following fields: A: <Year of birth> <Consumer code> <Street of residence> C: <Consumer code> <Shop> <Discount (percentage)> The properties of the sequences are described in the subgroup preamble. For each shop and each street, determine the number of consumers who live on that street and have a discount at that shop (first output the shop name, then the street name, then the number of consumers with a discount). If for some "shop–street" pair consumers with a discount are not found, the data about this pair are not output. Information about each "shop–street" should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — by street names (also in alphabetical order).
LinqObj74°. Sequences A and C are given, including the following fields: A: <Street of residence> <Consumer code> <Year of birth> C: <Shop name> <Discount (percentage)> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each shop and each year of birth from A, determine the average discount in this shop (in percent) for consumers with this year of birth (first output the shop name, then the year of birth, then the value of the average discount in percent). The fractional part of the found average value is discarded, the discount is displayed as an integer. When calculating the average discount, only consumers of the given year of birth who have a discount in the given shop are taken into account. If there are no such consumers for a given shop, then for this "shop–year" pair the zero value is output as the average discount. Information about each "shop–year" pair should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — in ascending order of year numbers.
LinqObj75°. Sequences B and D are given, including the following fields: B: <Product article> <Product type> <Country of manufacture> D: <Shop name> <Product article> <Price> The properties of the sequences are described in the subgroup preamble. For each shop and each type of products, determine the number of different articles of product of this type available in this shop (first output the shop name, then the product type, then the number of different product articles). If for some shop there are no products of this type, the information about the corresponding "shop–type" pair is not output. Information about each "shop–type" pair should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — by type names (also in alphabetical order).
LinqObj76°. Sequences B and D are given, including the following fields: B: <Country of manufacture> <Product type> <Product article> D: <Product article> <Shop name> <Price> The properties of the sequences are described in the subgroup preamble. For each country of manufacture, determine the number of shops offering products produced in this country, as well as the minimum price for products from this country for all shops (first output the number of shops, then the country name, then the minimum price). If for some country no products are found in any shop, then the number of shops and the minimum price are assumed to be 0. The information about each country should be displayed on a new line and ordered by the ascending number of shops, and for the same number of shops — by the names of countries in alphabetical order.
LinqObj77°. Sequences B and D are given, including the following fields: B: <Product type> <Product article> <Country of manufacture> D: <Product article> <Price> <Shop name> The properties of the sequences are described in the subgroup preamble. For each type of products, determine the number of shops that offer products of this type, as well as the number of countries in which the products of this type, presented in shops, are produced (the number of shops is displayed first, then the type name, then the number of countries). If for some type there are no products presented in any shop, then the information about this type is not output. Information about each type should be displayed on a new line and ordered by descending number of shops, and for the same number of shops — by type names in alphabetical order.
LinqObj78°. Sequences D and E are given, including the following fields: D: <Price> <Product article> <Shop name> E: <Consumer code> <Shop name> <Product article> The properties of the sequences are described in the subgroup preamble. For each product, determine the number of purchases of this product and the maximum purchase price (the number of purchases is displayed first, then the product article, then the maximum purchase price). If some product has never been sold, the information about this product is not output. Information about each product should be displayed on a new line and ordered by ascending number of purchases, and for the same number of purchases — by product articles in alphabetical order.
LinqObj79°. Sequences D and E are given, including the following fields: D: <Shop name> <Price> <Product article> E: <Consumer code> <Product article> <Shop name> The properties of the sequences are described in the subgroup preamble. For each shop and each consumer, determine the total value of purchases made by this consumer in this shop (first output the shop name, then the consumer code, then the total value of purchases). If the consumer has not purchased any products in a certain shop, the information about the corresponding "shop–consumer" pair is not output. Information about each "shop–consumer" pair should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — in ascending order of consumer codes.
LinqObj80°. Sequences D and E are given, including the following fields: D: <Price> <Shop name> <Product article> E: <Product article> <Shop name> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each "shop–product" pair specified in D, determine the total value of sales of this product in this shop (first output the shop name, then the product article, then the total value of its sales). If the product has never been sold in a certain shop, then for the corresponding "shop–product" pair the zero value is output as the total value. Information about each "shop–product" pair should be displayed on a new line and arranged by shop names in alphabetical order, and for the same shop — by product articles (also in alphabetical order).
LinqObj81°. Sequences B, D and E are given, including the following fields: B: <Product article> <Country of manufacture> <Product type> D: <Shop name> <Product article> <Price (in rubles)> E: <Shop name> <Consumer code> <Product article> The properties of the sequences are described in the subgroup preamble. For each country of manufacture, determine the number of purchased products from this country and the total cost of purchased products (first output the country name, then the number of products, then the total cost). If there is no information about the sold products for some country, the information about this country is not output. Information about each country should be displayed on a new line and ordered alphabetically by country names.
LinqObj82°. Sequences B, D and E are given, including the following fields: B: <Product type> <Country of manufacture> <Product article> D: <Price> <Product article> <Shop name> E: <Product article> <Consumer code> <Shop name> The properties of the sequences are described in the subgroup preamble. For each consumer, determine the number of types of products purchased by him/her and the maximum price of one of his/her purchases (the number of product types is displayed first, then the consumer code, then the maximum purchase price). Information about each consumer should be displayed on a new line and ordered by descending number of types, and for the same number of types — by ascending consumer code.
LinqObj83°. Sequences B, D and E are given, including the following fields: B: <Country of manufacture> <Product article> <Product type> D: <Price (in rubles)> <Shop name> <Product article> E: <Shop name> <Product article> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each shop specified in E and each country of manufacture, determine the total value of products from this country sold in this shop (first output the shop name, then the country name, then the total value). If for some "shop–country" pair there is no information about the sold products, then 0 is output as the total value. Information about each "shop–country" pair should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — by country names (also in alphabetical order).
LinqObj84°. Sequences C, D and E are given, including the following fields: C: <Discount (percentage)> <Shop name> <Consumer code> D: <Product article> <Shop name> <Price> E: <Product article> <Shop name> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each shop and each product, determine the number of discounted purchases of this product in this shop and the total cost of these purchases with the discount (the shop name is displayed first, then the product article, then the number of discounted purchases and their total cost). When calculating the discount amount for a product, the fractional part is discarded. If no discounted purchases are found for some "shop–product" pair, the information about this pair is not output. If no matching "shop–product" pair is found, then write the text "Data not found" to the resulting file. Information about each "shop–product" pair should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — by product articles (also in alphabetical order).
LinqObj85°. Sequences C, D and E are given, including the following fields: C: <Shop name> <Consumer code> <Discount (percentage)> D: <Product article> <Price> <Shop name> E: <Product article> <Consumer code> <Shop name> The properties of the sequences are described in the subgroup preamble. For each "consumer–shop" pair specified in E, determine the total amount of discounts for all products purchased by this consumer in this shop (the consumer code is displayed first, then the shop name, then the total amount of discount). When calculating the discount amount for each purchased product, the fractional part is discarded. If the consumer has purchased products from some shop without a discount, no information about the matching "consumer–shop" pair is output. If no matching "consumer–shop" pair is found, then write the text "Data not found" to the resulting file. Information about each "consumer–shop" pair should be displayed on a new line and ordered by ascending consumer code, and for the same code — by shop names in alphabetical order.
LinqObj86°. Sequences C, D and E are given, including the following fields: C: <Discount (percentage)> <Consumer code> <Shop name> D: <Shop name> <Price> <Product article> E: <Consumer code> <Shop name> <Product article> The properties of the sequences are described in the subgroup preamble. For each "product–shop" pair specified in E, determine the maximum discount for this product when it is purchased in this shop (the product article is displayed first, then the shop name, then the maximum discount). When calculating the size of the discount for a product, the fractional part is discarded. If all sales of a product in a certain shop were conducted without a discount, then 0 is output as the maximum size of the discount for this pair. Information about each "product–shop" pair should be displayed on a new line and ordered by product articles in alphabetical order, and for the same article — by the names of shops (also in alphabetical order).
LinqObj87°. Sequences A, D and E are given, including the following fields: A: <Year of birth> <Street of residence> <Consumer code> D: <Product article> <Shop name> <Price> E: <Shop name> <Consumer code> <Product article> The properties of the sequences are described in the subgroup preamble. For each street of residence and each shop specified in E, determine the total cost of purchases in this shop made by all consumers living on this street (first output the name of the street, then the name of the shop, then the total cost of purchases). If for some "street–shop" pair there is no information about the sold products, then 0 is output as the total cost. Information about each "street–shop" pair should be displayed on a new line and ordered by street names in alphabetical order, and for the same street — by shop names (also in alphabetical order).
LinqObj88°. Sequences A, D and E are given, including the following fields: A: <Street of residence> <Year of birth> <Consumer code> D: <Product article> <Price> <Shop name> E: <Shop name> <Product article> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each year of birth specified in A and each product specified in E, determine the total value of purchases of this product made by all consumers with this year of birth (first output the year of birth, then the product article, then the total value of purchases). If for some "year–product" pair there is no information about the sold products, the information about this pair is not output. Information about each "year–product" pair should be displayed on a new line and ordered by descending year number, and for the same year — by product articles in alphabetical order.
LinqObj89°. Sequences A, D and E are given, including the following fields: A: <Consumer code> <Year of birth> <Street of residence> D: <Shop name> <Price> <Product article> E: <Consumer code> <Product article> <Shop name> The properties of the sequences are described in the subgroup preamble. For each shop specified in E, find the consumer with the lowest year of birth, who bought one or more products in this shop (first output the shop name, then the consumer code, year of birth and the total cost of products purchased by the consumer in this shop). If for some shop there are several consumers with the lowest year of birth, the data on all such consumers are output. Information about each "shop–consumer" pair should be displayed on a new line and ordered by shop names in alphabetical order, and for the same shop — in ascending order of consumer codes.
LinqObj90°. Sequences A, B and E are given, including the following fields: A: <Street of residence> <Consumer code> <Year of birth> B: <Country of manufacture> <Product type> <Product article> E: <Product article> <Consumer code> <Shop name> The properties of the sequences are described in the subgroup preamble. For each year of birth from A, determine the country in which the maximum number of products purchased by consumers of this year of birth was produced (first output the year of birth, then the country name, then the maximum number of purchases). If for some "year–country" pair there is no information about products sold, then this pair is not processed (in particular, if consumers of some birth year did not make any purchases, then information about this year is not output). If for any year of birth there are several countries with the largest number of purchased products, then data on the first of such countries (in alphabetical order) are output. Information about each year should be displayed on a new line and ordered by descending year number.
LinqObj91°. Sequences A, B and E are given, including the following fields: A: <Street of residence> <Year of birth> <Consumer code> B: <Product article> <Country of manufacture> <Product type> E: <Shop name> <Product article> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each street and each product type, determine the number of countries in which the products of this type purchased by consumers living on this street were produced (first output the street name, then the type name, then the number of countries). If for some type there is no information about products purchased by the residents of some street, then information about the corresponding "street–type" pair is not output. Information about each "street–type" pair should be displayed on a new line and ordered by street names in alphabetical order, and for the same street — by type names (also in alphabetical order).
LinqObj92°. Sequences A, B and E are given, including the following fields: A: <Year of birth> <Street of residence> <Consumer code> B: <Country of manufacture> <Product article> <Product type> E: <Product article> <Shop name> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each product type, determine the street with the maximum total number of products of this type purchased by the residents of this street (first output the type name, then the street name, then the maximum total number of purchases). If for some type there is no information about the products purchased by the residents of some street, then the total number of purchases for the corresponding "type–street" pair is considered to be equal to 0 (therefore, it is possible that the largest number of purchases for some product type is equal to 0). If for some type there are several streets with the largest number of purchases, the data on all such streets are displayed. The information about each "type–street" pair should be displayed on a new line and ordered alphabetically by type names, and for the same type — by street names (also in alphabetical order).
LinqObj93°. Sequences A, B, C and E are given, including the following fields: A: <Consumer code> <Street of residence> <Year of birth> B: <Product type> <Country of manufacture> <Product article> C: <Shop name> <Consumer code> <Discount (percentage)> E: <Consumer code> <Product article> <Shop name> The properties of the sequences are described in the subgroup preamble. For each country of manufacture and street of residence, determine the maximum discount (in percent) for products manufactured in this country and purchased by consumers living on this street (first output the name of the country, then the name of the street, then the maximum discount). If, for some "country–street" pair, all products were purchased without a discount, then 0 is output as the maximum discount value. If for some "country–street" pair there is no information about purchased products, then information about this pair is not output. Information about each "country–street" pair should be displayed on a new line and ordered by country names in alphabetical order, and for the same country — by street names (also in alphabetical order).
LinqObj94°. Sequences A, B, C and E are given, including the following fields: A: <Year of birth> <Consumer code> <Street of residence> B: <Product article> <Product type> <Country of manufacture> C: <Consumer code> <Shop name> <Discount (percentage)> E: <Shop name> <Consumer code> <Product article> The properties of the sequences are described in the subgroup preamble. For each shop specified in E and each product type, determine the minimum value of the year of birth of those consumers who purchased one or more products of this type in this shop, and the number of products of this type purchased at a discount in this shop by consumers of this year of birth (the shop name is displayed first, then the type name, then the minimal year of birth and the number of products purchased at a discount). If for some "shop–type" pair there is no information about the purchased products, the data about this pair is not output. If for some "shop–type" pair consumers with the minimum year of birth purchased all products without discount, then 0 is output as the number of products purchased with discount. Information about each "shop–type" pair should be displayed on a new line and arranged by shop names in alphabetical order, and for the same shop — by type names (also in alphabetical order).
LinqObj95°. Sequences A, C, D, and E are given, including the following fields: A: <Consumer code> <Street of residence> <Year of birth> C: <Shop name> <Discount (percentage)> <Consumer code> D: <Shop name> <Product article> <Price> E: <Consumer code> <Shop name> <Product article> The properties of the sequences are described in the subgroup preamble. For each product article specified in E and each street of residence, determine the total amount of discount for products of this article purchased by consumers living on this street (first the product article is displayed, then the street name, then the total amount of discount). When calculating the discount amount for a product, the fractional part is discarded. If there is no discount on the sold products, the discount value is assumed to be 0. If for some "product–street" pair there is no information about the purchased products, the data about this pair is not output. If for some "product–street" pair all products were purchased without discounts, then 0 is output as the total discount for this pair. Information about each "product–street" pair should be output on a new line and ordered by product articles in alphabetical order, and for the same product article — by street names (also in alphabetical order).
LinqObj96°. Sequences A, C, D and E are given, including the following fields: A: <Street of residence> <Year of birth> <Consumer code> C: <Consumer code> <Discount (percentage)> <Shop name> D: <Price> <Product article> <Shop name> E: <Shop name> <Product article> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each year of birth specified in A and each shop specified in E, determine the total cost of all products (with discount) sold in this shop to consumers of the given year of birth (the year number is displayed first, then the shop name, then the total cost of products sold including discount). When calculating the discount amount for products, the fractional part is discarded. If there is no discount on the sold products, its size is assumed to be 0. If for some "year–shop" pair there is no information about the sold products, the information about this pair is not output. Information about each "year–shop" pair should be displayed on a new line and ordered by ascending year number, and for the same year — by the names of shops in alphabetical order.
LinqObj97°. Sequences B, C, D and E are given, including the following fields: B: <Product type> <Product article> <Country of manufacture> C: <Discount (percentage)> <Shop name> <Consumer code> D: <Price> <Shop name> <Product article> E: <Shop name> <Consumer code> <Product article> The properties of the sequences are described in the subgroup preamble. For each country of manufacture and each consumer, determine the total cost (with discount) of all products produced in this country and purchased by this consumer (first output the name of the country, then the consumer code, then the total cost including the discount). When calculating the discount amount for a product, the fractional part is discarded. If there is no discount on the sold product, its size is assumed to be 0. If for some "country–consumer" pair there is no data on purchases, the information about this pair is not output. Information about each "country–consumer" pair should be displayed on a new line and ordered by country names in alphabetical order, and for the same country — in ascending order of consumer codes.
LinqObj98°. Sequences B, C, D, and E are given, including the following fields: B: <Country of manufacture> <Product article> <Product type> C: <Discount (percentage)> <Consumer code> <Shop name> D: <Product article> <Price> <Shop name> E: <Consumer code> <Product article> <Shop name> The properties of the sequences are described in the subgroup preamble. For each product type and each shop specified in E, determine the total discount for all products of this type sold in this shop (the type name is displayed first, then the shop name, then the total discount). When calculating the size of the discount for a product, the fractional part is discarded. If there is no discount on the sold products, its size is assumed to be 0. If there were no sales for some type of products in some shop, then the total discount for this "type–shop" pair is assumed to be equal to −1. Information about each "type–shop" pair should be displayed on a new line and ordered by type names in alphabetical order, and for the same type — by shop names (also in alphabetical order).
LinqObj99°. Sequences A, B, D and E are given, including the following fields: A: <Consumer code> <Street of residence> <Year of birth> B: <Product type> <Country of manufacture> <Product article> D: <Product article> <Shop name> <Price> E: <Product article> <Shop name> <Consumer code> The properties of the sequences are described in the subgroup preamble. For each type of products and each street of residence, determine the shop that sold the products of this type at the minimum price to the consumer living on this street (first output the name of the product type, then the name of the street, then the name of the shop and the minimum price of the products). If for some "type–street" pair there is no information about the sold products, the information about this pair is not output. If for some "type–street" pair there are several shops that sold products at the minimum price, then data about all such shops are output. Information about each "type–street–shop" triple should be displayed on a new line and ordered by product type names in alphabetical order, for the same type — by street names, and for the same street — by shop names (also in alphabetical order).
LinqObj100°. Sequences A, B, D and E are given, including the following fields: A: <Street of residence> <Consumer code> <Year of birth> B: <Product article> <Country of manufacture> <Product type> D: <Shop name> <Price> <Product article> E: <Product article> <Consumer code> <Shop name> The properties of the sequences are described in the subgroup preamble. For each country of manufacture and each shop, determine the consumer with the highest year of birth who bought one or more products produced in this country in this shop (first output the name of the country, then the name of the shop, then the consumer's year of birth, his/her code, and the total cost of products from this country bought in this shop). If for some "country–shop" pair there is no information about the sold products, the information about this pair is not output. If for some "country–shop" pair there are several consumers with the highest year of birth, then information about all such consumers is output. Information about each "country–shop–consumer" triple should be displayed on a new line and ordered by country names in alphabetical order, for the same country — by shop names (also in alphabetical order), and for the same shop — in ascending order of consumer codes.
|