CF106B.Choosing Laptop

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Vasya is choosing a laptop. The shop has nn laptops to all tastes.

Vasya is interested in the following properties: processor speed, ram and hdd. Vasya is a programmer and not a gamer which is why he is not interested in all other properties.

If all three properties of a laptop are strictly less than those properties of some other laptop, then the first laptop is considered outdated by Vasya. Among all laptops Vasya does not consider outdated, he chooses the cheapest one.

There are very many laptops, which is why Vasya decided to write a program that chooses the suitable laptop. However, Vasya doesn't have his own laptop yet and he asks you to help him.

输入格式

The first line contains number nn ( 1<=n<=1001<=n<=100 ).

Then follow nn lines. Each describes a laptop as speedspeed ramram hddhdd costcost . Besides,

  • speedspeed , ramram , hddhdd and costcost are integers
  • 1000<=speed<=42001000<=speed<=4200 is the processor's speed in megahertz
  • 256<=ram<=4096256<=ram<=4096 the RAM volume in megabytes
  • 1<=hdd<=5001<=hdd<=500 is the HDD in gigabytes
  • 100<=cost<=1000100<=cost<=1000 is price in tugriks

All laptops have different prices.

输出格式

Print a single number — the number of a laptop Vasya will choose. The laptops are numbered with positive integers from 11 to nn in the order in which they are given in the input data.

输入输出样例

  • 输入#1

    5
    2100 512 150 200
    2000 2048 240 350
    2300 1024 200 320
    2500 2048 80 300
    2000 512 180 150
    

    输出#1

    4

说明/提示

In the third sample Vasya considers the first and fifth laptops outdated as all of their properties cannot match those of the third laptop. The fourth one is the cheapest among the laptops that are left. Thus, Vasya chooses the fourth laptop.

首页