About Me

About Me : I have been working as a Software Engineer for various international companies for four years.Currently, I am working as a full stack Javascript developer in Petronas(Malaysia).

Skills

Skills • Javascript •Typescript •Python •C •Java •ReactJs • Redux • VueJs • NestJs • React Testing Library • Django• PostgreSQL • MySQL • NodeJs • Git • Docker • Jira • Visual Studio Code • Slack

বুধবার, ৩ ডিসেম্বর, ২০১৪

1237 - Expert Enough?

/*MH RIYAD
    mriyad94@gmail.com
*/
#include <cstdio>
#include<iostream>
#include<cmath>
#include<map>
#include<cstring>
#define fr freopen("in.txt","r",stdin);
#define fw freopen("out.txt","w",stdout);
using namespace std;
struct A
{
    int l;
    int h;
    string str;

};
A  H[10001];
int main()
{
     // fr fw
    int test,da,q,price;
    scanf("%d", &test);

   for (int j = 1; j <= test;j++)
    {
        scanf("%d", &da);
        for (int i = 0; i < da; i++) cin >> H[i].str >> H[i].l >> H[i].h;
        scanf("%d", &q);
        while (q--)
        {
            scanf("%d", &price);
            string res;
            int c = 0;
            for (int i = 0; i < da; i++)
            {
                if (price >= H[i].l && price <= H[i].h)
                {
                    res = H[i].str;
                    c++;
                }
            }
            if (c == 0 || c>1) cout << "UNDETERMINED" << endl;
            else cout << res << endl;

        }
        if(j!=test)cout<<endl;

    }

    return 0;
}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন