from a fishing excursion. The I-th angler has gotten a fish of weight man-made intelligence. Anglers will flaunt the fish they got to one another. To do as such, they initially pick a request where they show their fish (every angler shows his fish precisely once, in this way, officially, the request for showing fish is a stage of integers from 1 to n). Then, at that point,
Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science.
anglers have recently gotten back from a fishing excursion. The I-th angler has gotten a fish of weight man-made intelligence.
Anglers will flaunt the fish they got to one another. To do as such, they initially pick a request where they show their fish (every angler shows his fish precisely once, in this way, officially, the request for showing fish is a stage of integers from 1 to n). Then, at that point, they show the fish they discovered by the picked request. At the point when an angler shows his fish, he may either become glad, become dismal, or stay content.
Assume an angler shows a fish of weight x, and the most extreme load of a formerly shown fish is y (y=0 if that angler is quick to show his fish). Then, at that point:
in the event that x≥2y, the angler becomes cheerful;
in the event that 2x≤y, the angler becomes miserable;
in the event that none of these two conditions is met, the angler stays content.
How about we call a request wherein the anglers show their fish passionate if, after all anglers show their fish as indicated by this request, every angler turns out to be either glad or miserable. Compute the number of enthusiastic orders modulo 998244353.
Input
The principal line contains one integer n (2≤n≤5000).
The subsequent line contains n integers a1, a2, ..., an (1≤
Output
Print one integer — the number of passionate orders, taken modulo 998244353.
Step by step
Solved in 4 steps with 1 images