2157 It's the most fun to pick up the Apple's magic horse

Source: Internet
Author: User
Description

A Cong took fish balls to see the apple tree that Newton was hit by. At this time, an apple fell down from the tree, the fish balls are so angry that she wants to pick up all the apples on the tree!

Here we will give a Cong's height h_boy and weight w_boy, the height of the fish ball h_girl and the weight of the w_girl. When a Cong's weight is higher than that of the fish ball, the fish ball can stand on a Cong to pick up the apple, if the fish balls are too fat, there is no way> _ <

As long as the height of an apple is not higher than that of a fish ball, the fish ball can take it off!

Input

T group data.

For each group of data: the first line first gives n, h_boy, w_boy, h_girl, and w_girl. N indicates a total of N apples. Other variables have the same meanings as the topic description. The second row contains N numbers, representing the height of N Apples (T <= 10, n <1000, h_boy, w_boy, h_girl, and w_girl). For details, see normal human data, the unit of height is cm, the unit of weight is kg, and the height of apple is a positive integer and within 500, in cm)

Output

For each group of data, output a line indicating that the fish balls can pick up several apples

Sample Input
2
10 172 55 160 49
300 330 120 90 170 160 220 400 50 500
10 172 55 160 56
300 330 120 90 170 160 220 400 50 500
Sample output
8
4
 
   
Simulate the question and compare the height.
#include <stdio.h>int main(){int number,t;int n,hb,wb,hg,wg;int a[1005],i;int count;scanf("%d",&number);for(t=1;t<=number;t++){count=0;scanf("%d %d %d %d %d",&n,&hb,&wb,&hg,&wg);for(i=0;i<n;i++)scanf("%d",&a[i]);for(i=0;i<n;i++){if((wb>wg)&&((hb+hg)>=a[i]))count++;if((wb<=wg)&&(hg>=a[i]))count++;}printf("%d\n",count);}return 0;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.