There is another fascination in Singapore Zoo: The Infinite Zoo.    The Infinite Zoo can be addressed by a chart with a limitless number of vertices marked 1,2,3,… . There is a guided edge from vertex u to vertex u+v if and provided that u&v=v, where and indicates the bitwise AND activity. There could be no different edges in the chart.    Animal specialist has q

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else downvoted. Computer science.

 

 There is another fascination in Singapore Zoo: The Infinite Zoo. 

 

The Infinite Zoo can be addressed by a chart with a limitless number of vertices marked 1,2,3,… . There is a guided edge from vertex u to vertex u+v if and provided that u&v=v, where and indicates the bitwise AND activity. There could be no different edges in the chart. 

 

Animal specialist has q inquiries. In the I-th question she will inquire as to whether she can venture out from vertex ui to vertex vi by going through coordinated edges. 

 

Input 

 

The main line contains an integer q (1≤q≤105) — the number of inquiries. 

 

The I-th of the following q lines will contain two integers ui, vi (1≤ui,vi<230) — an inquiry made by Zookeeper. 

 

Output 

 

For the I-th of the q inquiries, output "YES" in a solitary line if Zookeeper can head out from vertex ui to vertex vi. In any case, output "NO". 

 

You can print your reply regardless. For instance, in the event that the appropriate response is "YES", the output "Yes" or "yeS" will likewise be considered as right reply.

 

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Approximation Algorithms
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education