# B Graph

## 题意

n个点的带权树，你可以删边，但要保证删边后图联通，可以加边，但要保证加边后所有简单环的异或和为0。

# C Easy

## 题意

a是一个和为n长度为k的正数序列，b是一个和为m长度为k的正数序列，定义\begin{aligned}p=\prod_{i=1}^k\min(a_i,b_i)\end{aligned} , 对所有的a和b，求其对应的p的和。

## 题解

\begin{aligned} f&= \sum_{1\le i}\sum_{1\le j} \min(i,j)x^iy^j \&= \sum_{1\le i\lt j} ix^iy^j + \sum_{1\le j \lt i} jx^iy^j + \sum_{1\le i} ix^iy^i \end{aligned}

\begin{aligned} &\sum_{1\le i\lt j} ix^iy^j \=&\sum_{1\le i} ix^i\frac{y^{i+1}}{1-y} \=&\frac{y}{1-y}\sum_{1\le i} ix^iy^i \end{aligned}

\begin{aligned} f&= \sum_{1\le i\lt j} ix^iy^j + \sum_{1\le j \lt i} jx^iy^j + \sum_{1\le i} ix^iy^i \&= \frac{y}{1-y}\sum_{1\le i} ix^iy^i • \frac{x}{1-x}\sum_{1\le i} ix^iy^i • \sum_{1\le i} ix^iy^i \&= (\frac{y}{1-y}+\frac{x}{1-x}+1)\sum_{1\le i} ix^iy^i \&= (\frac{y}{1-y}+\frac{x}{1-x}+1)\frac{xy}{(1-xy)^2} \&=\frac{xy}{(1-x)(1-y)(1-xy)} \end{aligned}

\begin{aligned} &f^k \=&(xy)^k(1-x)^{-k}(1-y)^{-k}(1-xy)^{-k} \end{aligned}

\begin{aligned} &\sum_{i=0}^{min(n-k,m-k)} C_{-k}^i (-1)^i \cdot C_{-k}^{n-k-i} (-1)^{n-k-i} \cdot C_{-k}^{m-k-i} (-1)^{m-k-i} \=&\sum_{i=0}^{min(n-k,m-k)} C_{i+k-1}^{k-1} \cdot C_{n-i-1}^{k-1} \cdot C_{m-i-1}^{k-1} \end{aligned}

# D Drop Voicing

## 题意

• 把排列$P$变为 $P_{n-1},P_1,P_2…P_{n-3},P_{n-2},P_n$
• 把排列$P$变为 $P_2,P_3…P_{n-2},P_n,P_{n-1},P_1$

## 题解

$P_1,P_2,…P_{n-3},P_{n-2},P_{n},P_{n-1}$

$P_1,P_2,…P_{n-3},P_{n},P_{n-2},P_{n-1}$

# I Hard Math Problem

## 题解

$\frac{2}{3}$