I'll Be Done In (By) Five

A: It's Full of Stars!

Yes, it's back. See the attached sheet. (For Nausicaa fans, `Solve it and you'll be famous!' ... actually, the big problem archive reports that eight people have already solved it.)

B: Bring It All Together

Nobody wanted to parse mathematical expressions in infix form when `A Terminal Math Problem' was on a contest, so postfix expressions will be used instead.

The problem: integrate f(x) from a to b with an error tolerance of 0.01.

Each input line consists of two floating point values (a and b) followed by f in RPN (with spaces between tokens, the variable x and the operators +-*/^). The function f(x) will be continuous on the given range.

For each integration, output the the result with two decimal places, accurate within 0.01.

Sample Input:

1 3 -1.0
0 1 x 1 - x 1 + /
-1.5 1.5 2.718281828 0 x 2 ^ - ^

Sample Output:

-2.00
-0.39
1.71

C: It Can't Get Any Bigger Than This

Take two lines of input and produce a sorted list of all of the maximal common substrings. That is to say, if the input strings are X and Y (drawn from the set Sigma*), produce a list of all x such that x is a substring of both X and Y, but for all s in Sigma, neither sx nor xs is a substring of both X and Y.

Sample Input:

hi,_how_are_you_today?
fine,_thank-you_very_much.

Sample Output:

,_
_t
a
e
h
i
r
you_

D: Back to Your Regularly Scheduled Expressions

Write a program that takes a regular expression and zero or more lines of text as input. The program will print `yes' for each line of text that matches the regular expression and `no' for the others.

The expressions will correspond to the following grammar:

E => C | C `|' E
C => B | B C
B => S `*' | S
S => `(' E ')' | L
L => any lower-case letter

Sample Input:

foo|a(aa)*b
foo
foab
aaab
aab
ab
xaaaby

Sample Output:

yes
no
yes
no
yes
no

E: Fixed Point

Submit a program in C, C++ or Pascal that outputs its own source code. There will be no input. Bonus time for using the Y combinator.

Sample Output:

#!/bin/sh
cat $0

(Well, not quite....)