H. Eyad and Math
 
time limit per test

2.0 s

memory limit per test

256 MB

input

standard input

output

standard output

Eyad was given a simple math problem, but since he is very bad at math he asked you to help him.

Given 4 numbers, abc, and d. Your task is to find whether ab is less than cd or not.

It is guaranteed that the two numbers above are never equal for the given input.

Input

The first line contains an integer T (1 ≤ T ≤ 105), where T is the number of test cases.

Then T lines follow, each line contains four integers abc, and d (1 ≤ a, b, c, d ≤ 109).

Output

For each test case, print a single line containing "<" (without quotes), if ab is less than cd. Otherwise, print ">" (without quotes).

Example
input
  1. 2
    9 2 5 3
    3 4 4 3
output
  1. <
    >

这个题,emnnn,眼瞎,这么大的数,快速幂也跑爆啊。。。中学时代的换底公式,6的飞起。。。

a的b次方假设为x,求对数为logax=b,换成以10为底的,就是lnx为b*lna,同理c的d次方。水题水题。。。

代码:

  1. 1 //H. Eyad and Math-对数,换底公式-快速幂会爆啊啊啊啊啊啊
  2. 2 #include<iostream>
  3. 3 #include<cstring>
  4. 4 #include<cstdio>
  5. 5 #include<cmath>
  6. 6 #include<algorithm>
  7. 7 using namespace std;
  8. 8 int main(){
  9. 9 int t;
  10. 10 while(~scanf("%d",&t)){
  11. 11 int a,b,c,d;
  12. 12 while(t--){
  13. 13 scanf("%d%d%d%d",&a,&b,&c,&d);
  14. 14 double ans1=b*log10(a);
  15. 15 double ans2=d*log10(c);
  16. 16 if(ans1<ans2)printf("<\n");
  17. 17 else printf(">\n");
  18. 18 }
  19. 19 }
  20. 20 return 0;
  21. 21 }

Codeforces Gym101502 H.Eyad and Math-换底公式的更多相关文章

  1. 2017 JUST Programming Contest 3.0 H. Eyad and Math

    H. Eyad and Math time limit per test 2.0 s memory limit per test 256 MB input standard input output ...

  2. 【机器学习理论】换底公式--以e,2,10为底的对数关系转化

    我们在推导机器学习公式时,常常会用到各种各样的对数,但是奇怪的是--我们往往会忽略对数的底数是谁,不管是2,e,10等. 原因在于,lnx,log2x,log10x,之间是存在常数倍关系. 回顾学过的 ...

  3. Codeforces 1037 H. Security

    \(>Codeforces \space 1037\ H. Security<\) 题目大意 : 有一个串 \(S\) ,\(q\) 组询问,每一次给出一个询问串 \(T\) 和一个区间 ...

  4. Codeforces 916E Jamie and Tree (换根讨论)

    题目链接  Jamie and Tree 题意  给定一棵树,现在有下列操作: $1$.把当前的根换成$v$:$2$.找到最小的同时包含$u$和$v$的子树,然后把这棵子树里面的所有点的值加$x$: ...

  5. Codeforces Gym101502 I.Move Between Numbers-最短路(Dijkstra优先队列版和数组版)

    I. Move Between Numbers   time limit per test 2.0 s memory limit per test 256 MB input standard inpu ...

  6. codeforces#1187E. Tree Painting(树换根)

    题目链接: http://codeforces.com/contest/1187/problem/E 题意: 给出一颗树,找到一个根节点,使所有节点的子节点数之和最大 数据范围: $2 \le n \ ...

  7. Codeforces 997D - Cycles in product(换根 dp)

    Codeforces 题面传送门 & 洛谷题面传送门 一种换根 dp 的做法. 首先碰到这类题目,我们很明显不能真的把图 \(G\) 建出来,因此我们需要观察一下图 \(G\) 有哪些性质.很 ...

  8. Codeforces Gym H. Hell on the Markets 贪心

    Problem H. Hell on the MarketsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vj ...

  9. CodeForces 914DBash and a Tough Math Puzzle(线段树的骚操作)

    D. Bash and a Tough Math Puzzle time limit per test 2.5 seconds memory limit per test 256 megabytes ...

随机推荐

  1. LeetCode之Weekly Contest 90

    LeetCode第90场周赛记录 第一题:亲密字符串 问题: 给定两个由小写字母构成的字符串 A 和 B ,只要我们可以通过交换 A 中的两个字母得到与 B 相等的结果,就返回 true :否则返回  ...

  2. list_for_each_entry()函数分析

    list_for_each原型: #define list_for_each(pos, head) \ for (pos = (head)->next, prefetch(pos->nex ...

  3. urlopen SSL证书验证

    错误描述: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777) 解决方法 ...

  4. debian 7 stable 不能编译android源码

    rebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8-linaro/bin/arm-linux-androideabi-gcc: /lib/x86_ ...

  5. JAVA-基础(十) Swing

    在看到applet和Swing的时候,我想起了winform,以及java beans包中各种所谓的组件的时候,一切都那么似曾相识. Swing是AWT的扩展,它提供了更强大和更灵活的组件集合. 除了 ...

  6. 【第一章第一回】BootStrap 简介

    Twitter Bootstrap 是目前最受欢迎的前端框架,它简洁.直观.移动优先.强悍的前端开发框架,让web开发更迅速.简单.基于HTML.CSS和Javascript. 为什么使用Bootst ...

  7. 转:模式窗口showModalDialog的用法总结

    模式窗口showModalDialog的用法总结   最近几天一直在处理模式窗口的问题,索性写了这篇总结,以供参考: 1.打开窗口:var handle = window.showModalDialo ...

  8. day01_01.了解php

    1.了解PHP 第一个程序 echo 'hello world'; 和python的区别,python是 print (hello world) 并且python结尾没有;2.X版本不需要加括号,但是 ...

  9. Educational Codeforces Round 36 (Rated for Div. 2)

    A. Garden time limit per test 1 second memory limit per test 256 megabytes input standard input outp ...

  10. 解决Failed with error: unable to access 'https://git.coding.net/chenmi1234/lianpos.git/': Couldn't resolve host 'git.coding.net'

    代码改变世界 github push 出现问题 Failed with error: unable to access 'https://git.coding.net/chenmi1234/lianp ...