What is the difference between Ultraviolet A, ultraviolet A, and ultraviolet B?
Description
Problem F
Coupons
Input:Standard input
Output:Standard output
Time Limit:2 seconds
Memory Limit:32 MB
Coupons in cereal boxes are numbered1ToN, And a set of one of each is required for a prize (a cereal box, of course ). with one coupon per box, how many boxes on average are required to make a complete setNCoupons?
Input
Input consists of a sequence of lines each containing a single positive integerN, 1<=N<= 33, Giving the size of the set of coupons. Input is terminated by end of file.
Output
For each input line, output the average number of boxes required to collect the complete setNCoupons. if the answer is an integer number, output the number. if the answer is not integer, then output the integer part of the answer followed by a space and then by the proper fraction in the format shown below. the fractional part shoshould be irreducible. there shoshould be no trailing spaces in any line of output.
Sample Input
2
5
17
Sample Output
3
5
11 --
12
340463
58 ------
720720 question: how many out-of-the-box tickets are expected to be collected for n Different coupons? If f [I] is set, the expected number of out-of-the-box coupons are not collected, then, we only need to calculate the expectation that we have not obtained + the expectation of the previous operation + the number of operations 1, that is, f [I] = (n-I) /n * f [I] + I/n * f [I + 1] + 1, after the transfer is f [I] = f [I + 1] + I/n, then there is a score calculation template.# Include <cstdio> # include <cstring> # include <cmath> # include <algorithm> using namespace std; const int maxn = 500; struct fraction {long numerator; // long denominator; // denominator fraction () {numerator = 0; denominator = 1;} fraction (long num) {numerator = num; denominator = 1 ;} fraction (long a, long B) {numerator = a; denominator = B; this-> ction ();} void operator = (const long lo Ng num) {numerator = num; denominator = 1; this-> ction ();} void operator = (const fraction & B) {numerator = B. numerator; denominator = B. denominator; this-> ction ();} fraction operator + (const fraction & B) const {long gcdnum = _ gcd (denominator, B. denominator); fraction tmp = fraction (numerator * (B. denominator/gcdnum) + B. numerator * (denominator/gcdnum), denominator/gcdnum * B. denominator); tmp. r Eduction (); return tmp;} fraction operator + (const int & B) const {return (* this) + fraction (B ));} fraction operator-(const fraction & B) const {return (* this) + fraction (-B. numerator, B. denominator);} fraction operator-(const int & B) const {return (* this)-fraction (B);} fraction operator * (const fraction & B) const {fraction tmp = fraction (numerator * B. numerator, denominator * B. denominator); t Mp. ction (); return tmp;} fraction operator * (const int & B) const {return (* this) * fraction (B ));} fraction operator/(const fraction & B) const {return (* this) * fraction (B. denominator, B. numerator);} void callback ction () {if (numerator = 0) {denominator = 1; return;} long gcdnum = _ gcd (numerator, denominator ); numerator/= gcdnum; denominator/= gcdnum;} void print () {if (denominator = 1) prin Tf ("% lld \ n", numerator); else {long num = numerator/denominator; long tmp = num; int len = 0; while (tmp) {len ++; tmp/= 10;} for (int I = 0; I <len; I ++) printf (""); if (len! = 0) printf (""); printf ("% lld \ n", numerator % denominator); if (num! = 0) printf ("% lld", num); tmp = denominator; while (tmp) {printf ("-"); tmp/= 10 ;} puts (""); for (int I = 0; I <len; I ++) printf (""); if (len! = 0) printf (""); printf ("% lld \ n", denominator) ;}} f [maxn]; int main () {int n; while (scanf ("% d", & n )! = EOF) {f [0] = 0; for (int I = 1; I <= n; I ++) f [I] = f [I-1] + fraction (1, I); f [n] = f [n] * n; f [n]. print ();} return 0 ;}
What are the differences between Ultraviolet A and ultraviolet B and the damage to the skin?
Long-wave ultraviolet A, with a wavelength between 320 and, causes skin damage and aging ~ 400 nm, with a strong penetrating power, can penetrate glass, or even 9 feet of water; and all year round, whether cloudy or sunny, day and night exist. More than 95% of the ultraviolet rays exposed to daily skin are ultraviolet rays, which are the most harmful to the skin. By attacking the dermis layer through the skin of the skin, the collagen and elastic protein in the skin are severely damaged. Moreover, the self-protection capability of the dermis cells is poor, and a small amount of ultraviolet A can cause great damage. Over time, the skin experiences problems such as relaxation, wrinkles, and microvessels. At the same time, it can activate casein, resulting in instant melanin deposition and new melanin formation, skin become black, lack of luster. It can cause long-term, chronic, and persistent damage, premature aging of the skin, and is also called aging rays. Ultraviolet B can cause immediate skin damage. The wavelength is between 290 and ~ 320 nm will make the lipid layer oxidized by the skin protected by leather products, and make the skin dry; further, it will make the nucleic acid and protein in the epidermal cells change, resulting in acute dermatitis (that is, sunburn) and other symptoms, skin becomes red and sore. Serious cases, such as prolonged exposure, may also lead to skin cancer. In addition, long-term damage to ultraviolet B may also cause melanin cell variation, resulting in difficult to eliminate the sun spots.
What are the differences between Ultraviolet A and ultraviolet B and the damage to the skin?
Long-wave ultraviolet A, with a wavelength between 320 and, causes skin damage and aging ~ 400 nm, with a strong penetrating power, can penetrate glass, or even 9 feet of water; and all year round, whether cloudy or sunny, day and night exist. More than 95% of the ultraviolet rays exposed to daily skin are ultraviolet rays, which are the most harmful to the skin. By attacking the dermis layer through the skin of the skin, the collagen and elastic protein in the skin are severely damaged. Moreover, the self-protection capability of the dermis cells is poor, and a small amount of ultraviolet A can cause great damage. Over time, the skin experiences problems such as relaxation, wrinkles, and microvessels. At the same time, it can activate casein, resulting in instant melanin deposition and new melanin formation, skin become black, lack of luster. It can cause long-term, chronic, and persistent damage, premature aging of the skin, and is also called aging rays. Ultraviolet B can cause immediate skin damage. The wavelength is between 290 and ~ 320 nm will make the lipid layer oxidized by the skin protected by leather products, and make the skin dry; further, it will make the nucleic acid and protein in the epidermal cells change, resulting in acute dermatitis (that is, sunburn) and other symptoms, skin becomes red and sore. Serious cases, such as prolonged exposure, may also lead to skin cancer. In addition, long-term damage to ultraviolet B may also cause melanin cell variation, resulting in difficult to eliminate the sun spots.